archbox/archboxinit.bash

36 lines
1.0 KiB
Bash
Raw Normal View History

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
2020-12-31 16:16:31 +00:00
start)
mount -R /home $CHROOT/home
mount -t proc /proc $CHROOT/proc
mount -R /tmp $CHROOT/tmp
mount -R /sys $CHROOT/sys
mount --make-rslave $CHROOT/sys
mount -R /dev $CHROOT/dev
mount --make-rslave $CHROOT/dev
[[ $MOUNT_RUN = "yes" ]] && mount -R /run $CHROOT/run
mount -R /lib/modules $CHROOT/lib/modules
mount -R /boot $CHROOT/boot
mount -R /var/lib/dbus $CHROOT/var/lib/dbus
mount -R / $CHROOT/var/host
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
[[ $MOUNT_RUN = "yes" ]] && umount -R $CHROOT/run
umount -R $CHROOT/lib/modules
umount -R $CHROOT/boot
umount -R $CHROOT/var/lib/dbus
umount -R $CHROOT/var/host
exit 0
;;
2020-11-11 13:02:05 +00:00
esac