55 |
trap_exit() |
trap_exit() |
56 |
{ |
{ |
57 |
[[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD} |
[[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD} |
58 |
is_loc_mounted "${INSTALLPATH}/dev" && umount ${INSTALLPATH}/dev |
is_loc_mounted "${INSTALL_ROOT}/dev" && umount ${INSTALL_ROOT}/dev |
59 |
is_loc_mounted "${INSTALLPATH}/proc" && umount ${INSTALLPATH}/proc |
is_loc_mounted "${INSTALL_ROOT}/proc" && umount ${INSTALL_ROOT}/proc |
60 |
is_loc_mounted "${INSTALLPATH}/sys" && umount ${INSTALLPATH}/sys |
is_loc_mounted "${INSTALL_ROOT}/sys" && umount ${INSTALL_ROOT}/sys |
61 |
is_loc_mounted "${INSTALLPATH}/boot" && umount ${INSTALLPATH}/boot |
is_loc_mounted "${INSTALL_ROOT}/boot" && umount ${INSTALL_ROOT}/boot |
62 |
is_loc_mounted "${INSTALLPATH}" && umount ${INSTALLPATH} |
is_loc_mounted "${INSTALL_ROOT}" && umount ${INSTALL_ROOT} |
63 |
echo "installation aborted" |
echo "installation aborted" |
64 |
exit 1 |
exit 1 |
65 |
} |
} |
68 |
{ |
{ |
69 |
local cmd="$@" |
local cmd="$@" |
70 |
|
|
71 |
is_loc_mounted "${INSTALLPATH}/proc" || mount -t proc proc ${INSTALLPATH}/proc |
is_loc_mounted "${INSTALL_ROOT}/proc" || mount -t proc proc ${INSTALL_ROOT}/proc |
72 |
is_loc_mounted "${INSTALLPATH}/sys" || mount -t sysfs sysfs ${INSTALLPATH}/sys |
is_loc_mounted "${INSTALL_ROOT}/sys" || mount -t sysfs sysfs ${INSTALL_ROOT}/sys |
73 |
is_loc_mounted "${INSTALLPATH}/dev" || mount -o bind /dev ${INSTALLPATH}/dev |
is_loc_mounted "${INSTALL_ROOT}/dev" || mount -o bind /dev ${INSTALL_ROOT}/dev |
74 |
|
|
75 |
chroot ${INSTALLPATH} ${cmd} || die "enter_chroot() '${INSTALLPATH}' '${cmd}'" |
chroot ${INSTALL_ROOT} ${cmd} || die "enter_chroot() '${INSTALL_ROOT}' '${cmd}'" |
76 |
|
|
77 |
is_loc_mounted "${INSTALLPATH}/dev" && umount ${INSTALLPATH}/dev |
is_loc_mounted "${INSTALL_ROOT}/dev" && umount ${INSTALL_ROOT}/dev |
78 |
is_loc_mounted "${INSTALLPATH}/sys" && umount ${INSTALLPATH}/sys |
is_loc_mounted "${INSTALL_ROOT}/sys" && umount ${INSTALL_ROOT}/sys |
79 |
is_loc_mounted "${INSTALLPATH}/proc" && umount ${INSTALLPATH}/proc |
is_loc_mounted "${INSTALL_ROOT}/proc" && umount ${INSTALL_ROOT}/proc |
80 |
} |
} |
81 |
|
|
82 |
enter_chroot_installrc() |
enter_chroot_installrc() |
83 |
{ |
{ |
84 |
[ -f ${INSTALLPATH}/.installrc ] || die "enter_chroot_installrc() ${INSTALLPATH}/.installrc missing" |
[ -f ${INSTALL_ROOT}/.installrc ] || die "enter_chroot_installrc() ${INSTALL_ROOT}/.installrc missing" |
85 |
enter_chroot /bin/bash -i /.installrc || die "enter_chroot_installrc() run" |
enter_chroot /bin/bash -i /.installrc || die "enter_chroot_installrc() run" |
86 |
[ -f ${INSTALLPATH}/.installrc ] && rm ${INSTALLPATH}/.installrc |
[ -f ${INSTALL_ROOT}/.installrc ] && rm ${INSTALL_ROOT}/.installrc |
87 |
} |
} |