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