diff --git a/bash/mount.sh b/bash/mount.sh index 5fe26a7..9fda047 100644 --- a/bash/mount.sh +++ b/bash/mount.sh @@ -4,36 +4,36 @@ local file if [ "${directory}" ] ; then directory="$(realpath "${directory}")" file="${directory}/filesystem.squashfs" - if mkdir 'overlay' ; then - cd 'overlay' + if mkdir "overlay" ; then + cd "overlay" mkdir {lower,upper,work,mount} - if mount "${file}" 'lower' ; then - mount -t 'overlay' 'overlay' 'mount' \ --o lowerdir='lower',upperdir='upper',workdir='work' + if mount "${file}" "lower" ; then + mount -t "overlay" "overlay" "mount" \ +-o lowerdir="lower",upperdir="upper",workdir="work" fi cd .. fi else - echo 'KO: directory?' + echo "KO: directory?" fi } uo() { -cd 'overlay' -if umount 'mount' ; then - rmdir 'mount' - rm --recursive 'upper' 'work' - if umount 'lower' ; then - rmdir 'lower' +cd "overlay" +if umount "mount" ; then + rmdir "mount" + rm --recursive "upper" "work" + if umount "lower" ; then + rmdir "lower" fi fi cd .. -rmdir 'overlay' +rmdir "overlay" } mr() { -for f in 'dev' 'dev/pts' 'proc' 'sys' ; do +for f in "dev" "dev/pts" "proc" "sys" ; do mount --bind "/${f}" "overlay/mount/${f}" done } @@ -50,18 +50,18 @@ chroot \ " ur() { -for f in 'sys' 'proc' 'dev/pts' 'dev' ; do +for f in "sys" "proc" "dev/pts" "dev" ; do umount --lazy "overlay/mount/${f}" done } mm() { -mount --make-rslave --rbind '/deb' 'overlay/mount/deb' +mount --make-rslave --rbind "/deb" "overlay/mount/deb" } um() { -umount --recursive 'overlay/mount/deb' +umount --recursive "overlay/mount/deb" } @@ -70,12 +70,12 @@ local directory="${1}" local level="${2}" if [ "${directory}" ] ; then if mkdir "${directory}" ; then - [ "${level}" ] || level='18' + [ "${level}" ] || level="18" cp overlay/mount/{vmlinuz,initrd.img} "${directory}" mksquashfs \ -'overlay/mount' "${directory}/filesystem.squashfs" \ +"overlay/mount" "${directory}/filesystem.squashfs" \ -noappend \ --comp 'zstd' -Xcompression-level "${level}" +-comp "zstd" -Xcompression-level "${level}" chown --recursive 1000:1000 "${directory}" fi fi