Changeset View
Changeset View
Standalone View
Standalone View
tools/tools/nanobsd/defaults.sh
| Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | if [ -n "$NANO_METALOG" ]; then | ||||
| path="${path}/${dir}" | path="${path}/${dir}" | ||||
| echo ".${path} type=dir uname=${NANO_DEF_UNAME}" \ | echo ".${path} type=dir uname=${NANO_DEF_UNAME}" \ | ||||
| "gname=${NANO_DEF_GNAME} mode=0755" >> "${NANO_METALOG}" | "gname=${NANO_DEF_GNAME} mode=0755" >> "${NANO_METALOG}" | ||||
| done | done | ||||
| fi | fi | ||||
| done | done | ||||
| } | } | ||||
| # | |||||
| # Switch the current root partition in the target file system tab. | |||||
| # Takes two arguments: the current, and the new partition. | |||||
| # | |||||
| tgt_switch_root_fstab() | |||||
| { | |||||
| local current new | |||||
| current="$1" | |||||
| new="$2" | |||||
| for f in ${NANO_WORLDDIR}/etc/fstab ${NANO_WORLDDIR}/conf/base/etc/fstab | |||||
| do | |||||
| sed -i "" "s=${NANO_DRIVE}${current}=${NANO_DRIVE}${new}=g" "${f}" | |||||
| done | |||||
| } | |||||
| # run in the world chroot, errors fatal | # run in the world chroot, errors fatal | ||||
| CR() { | CR() { | ||||
| chroot "${NANO_WORLDDIR}" /bin/sh -exc "$*" | chroot "${NANO_WORLDDIR}" /bin/sh -exc "$*" | ||||
| } | } | ||||
| # run in the world chroot, errors not fatal | # run in the world chroot, errors not fatal | ||||
| CR0() { | CR0() { | ||||
| chroot "${NANO_WORLDDIR}" /bin/sh -c "$*" || true | chroot "${NANO_WORLDDIR}" /bin/sh -c "$*" || true | ||||
| ▲ Show 20 Lines • Show All 693 Lines • Show Last 20 Lines | |||||