2020-12-28 05:22:53 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-10-27 06:12:14 +00:00
|
|
|
|
|
|
|
source /etc/archbox.conf
|
|
|
|
|
2020-11-11 13:02:05 +00:00
|
|
|
case $1 in
|
|
|
|
start)
|
|
|
|
mount -R /home $CHROOT/home
|
|
|
|
mount -t proc /proc $CHROOT/proc
|
|
|
|
mount -R /tmp $CHROOT/tmp
|
|
|
|
mount -R /sys $CHROOT/sys
|
2020-11-13 10:31:07 +00:00
|
|
|
mount --make-rslave $CHROOT/sys
|
2020-11-11 13:02:05 +00:00
|
|
|
mount -R /dev $CHROOT/dev
|
2020-11-13 10:31:07 +00:00
|
|
|
mount --make-rslave $CHROOT/dev
|
2020-12-28 12:15:21 +00:00
|
|
|
[[ $MOUNT_RUN = "yes" ]] && mount -R /run $CHROOT/run
|
2020-11-11 13:02:05 +00:00
|
|
|
mount -R /lib/modules $CHROOT/lib/modules
|
|
|
|
mount -R /boot $CHROOT/boot
|
|
|
|
mount -R /var/lib/dbus $CHROOT/var/lib/dbus
|
2020-11-13 10:31:07 +00:00
|
|
|
mount -R / $CHROOT/var/host
|
2020-11-11 13:02:05 +00:00
|
|
|
chroot $CHROOT /usr/local/bin/serviced >/dev/null 2>&1
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
umount -R $CHROOT/home
|
|
|
|
umount -R $CHROOT/proc
|
|
|
|
umount -R $CHROOT/tmp
|
|
|
|
umount -R $CHROOT/sys
|
|
|
|
umount -R $CHROOT/dev
|
2020-12-28 12:15:21 +00:00
|
|
|
[[ $MOUNT_RUN = "yes" ]] && umount -R $CHROOT/run
|
2020-11-11 13:02:05 +00:00
|
|
|
umount -R $CHROOT/lib/modules
|
|
|
|
umount -R $CHROOT/boot
|
|
|
|
umount -R $CHROOT/var/lib/dbus
|
2020-11-13 10:31:07 +00:00
|
|
|
umount -R $CHROOT/var/host
|
2020-11-11 13:02:05 +00:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|