summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorKim Hagen <kim@sentrium.io>2021-07-29 15:42:06 -0500
committerKim Hagen <kim@sentrium.io>2021-07-29 15:42:06 -0500
commitf81f65598555f88f1b0535807da7418e5326be67 (patch)
tree1b1083ec4100a1cfea184e941781b4ac05bb880c /scripts/build
parentca2a4e78bedd6ec8d6dffd94009163596c1c5e1c (diff)
downloadvyos-live-build-f81f65598555f88f1b0535807da7418e5326be67.tar.gz
vyos-live-build-f81f65598555f88f1b0535807da7418e5326be67.zip
create loop partitions with mknod instead of bind mounting /dev
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/chroot_devpts101
1 files changed, 29 insertions, 72 deletions
diff --git a/scripts/build/chroot_devpts b/scripts/build/chroot_devpts
index 713ff28ae..d917bc4d4 100755
--- a/scripts/build/chroot_devpts
+++ b/scripts/build/chroot_devpts
@@ -29,89 +29,46 @@ Require_stagefile .build/config .build/bootstrap
case "${1}" in
install)
- if [ "${LIVE_IMAGE_TYPE}" = "hdd" ]; then
- Echo_message "Begin mounting /dev..."
+ Echo_message "Begin mounting /dev/pts..."
- # Checking stage file
- Check_stagefile .build/chroot_devpts
+ # Checking stage file
+ Check_stagefile .build/chroot_devpts
- # Checking lock file
- Check_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- # Creating lock file
- Create_lockfile .lock
+ # Creating lock file
+ Create_lockfile .lock
- # Creating mountpoint
- mount --bind /dev chroot/dev || true
- mount devpts-live -t devpts -o gid=5,mode=620 chroot/dev/pts || true
+ # Creating mountpoint
+ mkdir -p chroot/dev/pts
- # Creating stage file
- Create_stagefile .build/chroot_devpts
- else
- Echo_message "Begin mounting /dev/pts..."
+ # Mounting /dev/pts
+ mount devpts-live -t devpts -o gid=5,mode=620 chroot/dev/pts || true
- # Checking stage file
- Check_stagefile .build/chroot_devpts
+ # Creating stage file
+ Create_stagefile .build/chroot_devpts
+ ;;
- # Checking lock file
- Check_lockfile .lock
+ remove)
+ Echo_message "Begin unmounting /dev/pts..."
- # Creating lock file
- Create_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- # Creating mountpoint
- mkdir -p chroot/dev/pts
+ # Creating lock file
+ Create_lockfile .lock
- # Mounting /dev/pts
- mount devpts-live -t devpts -o gid=5,mode=620 chroot/dev/pts || true
+ # Unmounting /dev/pts
+ if grep -qs "$(pwd)/chroot/dev/pts" /proc/mounts || Find_files chroot/dev/pts/*
+ then
+ umount chroot/dev/pts
+ else
+ umount -f chroot/dev/pts > /dev/null 2>&1 || true
+ fi
- # Creating stage file
- Create_stagefile .build/chroot_devpts
- fi
- ;;
-
- remove)
- if [ "${LIVE_IMAGE_TYPE}" = "hdd" ]; then
- Echo_message "Begin unmounting /dev..."
-
- # Checking lock file
- Check_lockfile .lock
-
- # Creating lock file
- Create_lockfile .lock
-
- # Unmounting /dev
- if grep -qs "$(pwd)/chroot/dev" /proc/mounts || Find_files chroot/dev/*
- then
- umount chroot/dev/pts
- umount chroot/dev
- else
- umount -f chroot/dev/pts > /dev/null 2>&1 || true
- umount -f chroot/dev > /dev/null 2>&1 || true
- fi
-
- # Removing stage file
- rm -f .build/chroot_devpts
- else
- Echo_message "Begin unmounting /dev/pts..."
-
- # Checking lock file
- Check_lockfile .lock
-
- # Creating lock file
- Create_lockfile .lock
-
- # Unmounting /dev/pts
- if grep -qs "$(pwd)/chroot/dev/pts" /proc/mounts || Find_files chroot/dev/pts/*
- then
- umount chroot/dev/pts
- else
- umount -f chroot/dev/pts > /dev/null 2>&1 || true
- fi
-
- # Removing stage file
- rm -f .build/chroot_devpts
- fi
+ # Removing stage file
+ rm -f .build/chroot_devpts
;;
*)