rc.mounts.broken (1453B)
1 ## --- beginning of mounter --- # 2 ## the following is inspired by getopt in c, meant to make adding different mountpoints to this easier 3 #forx x { /proc /sys /sys/firmware/efi/efivars /dev /dev/pts /dev/shm /run /tmp } 4 #{ # begin loop 5 #foreground { # foreground wrapper 6 # case -N -- $x 7 # { # open case 8 # /proc { export mntargs "proc proc ${x} -o nosuid,noexec,nodev" } 9 # /sys { export mntargs "sysfs sysfs ${x} -o nosuid,noexec,nodev" } 10 # /sys/firmware/efi/efivars { export mntargs "efivarfs -o ro efivarfs ${x}" } 11 # /dev { export mntargs "devtmpfs devtmpfs ${x} -o mode=0755,nosuid" } 12 # /dev/pts { export mntargs "devpts devpts ${x} -o mode=0620,gid=5,nosuid,noexec" } 13 # /dev/shm { export mntargs "tmpfs tmpfs ${x} -o mode=1777,nosuid,nodev" } 14 # /run { export mntargs "tmpfs tmpfs ${x} -o mode=0755,nosuid,nodev" } 15 # /tmp { export mntargs "tmpfs tmpfs ${x}" } 16 # } # close case 17 # 18 # # default case if one of the things above does not match. TODO: dropping into shell may not work depending on the shell, maybe we should just trigger reboot 19 # { 20 # foreground 21 # { printf "Broken forx mounter loop at %s. Fix %s.\nDropping into shell." ${x} ${0} } 22 # exec /bin/sh 23 # } 24 # 25 #} # close foreground wrapper (around case statement) 26 # 27 ## if said dir is a mountpoint 28 #importas -S mntargs 29 #if { ! mountpoint -q ${x} } 30 # { mount -t ${mntargs} } 31 # 32 #} # close forx 33 # 34 ## --- end of mounter --- #