diff options
Diffstat (limited to 'scripts/build/chroot_devpts')
-rwxr-xr-x | scripts/build/chroot_devpts | 100 |
1 files changed, 73 insertions, 27 deletions
diff --git a/scripts/build/chroot_devpts b/scripts/build/chroot_devpts index 3877fac83..f25a3861a 100755 --- a/scripts/build/chroot_devpts +++ b/scripts/build/chroot_devpts @@ -29,43 +29,89 @@ Require_stagefiles config bootstrap case "${_ACTION}" in install) - Echo_message "Begin mounting /dev/pts..." + if [ "${LB_IMAGE_TYPE}" = "hdd" ]; then + Echo_message "Begin mounting /dev..." - # Checking stage file - Check_stagefile + # Checking stage file + Check_stagefile - # Acquire lock file - Acquire_lockfile + # Acquire lock file + Acquire_lockfile - # Creating mountpoint - mkdir -p chroot/dev/pts + # Mounting /dev/pts + mount --bind /dev chroot/dev || true + mount -t devpts -o gid=5,mode=620,x-gvfs-hide devpts-live chroot/dev/pts || true - # Mounting /dev/pts - mount -t devpts -o gid=5,mode=620,x-gvfs-hide devpts-live chroot/dev/pts || true + # Creating stage file + Create_stagefile + else + Echo_message "Begin mounting /dev/pts..." - # Creating stage file - Create_stagefile - ;; + # Checking stage file + Check_stagefile - remove) - Echo_message "Begin unmounting /dev/pts..." + # Acquire lock file + Acquire_lockfile - # Checking stage file - Ensure_stagefile_exists + # Creating mountpoint + mkdir -p chroot/dev/pts - # Acquire lock file - Acquire_lockfile + # Mounting /dev/pts + mount -t devpts -o gid=5,mode=620,x-gvfs-hide devpts-live 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 + fi + ;; - # Removing stage file - Remove_stagefile + remove) + if [ "${LB_IMAGE_TYPE}" = "hdd" ]; then + Echo_message "Begin unmounting /dev..." + + # Checking stage file + Ensure_stagefile_exists + + # Acquire lock file + Acquire_lockfile + + # 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 + + # Unmounting /dev + if grep -qs "$(pwd)/chroot/dev" /proc/mounts || Find_files chroot/dev/* + then + umount chroot/dev + else + umount -f chroot/dev > /dev/null 2>&1 || true + fi + + # Removing stage file + Remove_stagefile + else + Echo_message "Begin unmounting /dev/pts..." + + # Checking stage file + Ensure_stagefile_exists + + # Acquire lock file + Acquire_lockfile + + # 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 + Remove_stagefile + fi ;; *) |