diff --git a/bin/rc b/bin/rc index d40c622..9a77394 100755 --- a/bin/rc +++ b/bin/rc @@ -4,7 +4,12 @@ cfg_mounts+=( 'proc:proc:/proc:' ) cfg_mounts+=( 'run:tmpfs:/run:' ) cfg_mounts+=( 'sys:sysfs:/sys:' ) + +# devfs and its children cfg_mounts+=( 'dev:devtmpfs:/dev:' ) +cfg_mounts+=( 'pts:devpts:/dev/pts:noexec,nosuid,gid=5,mode=0620' ) +cfg_mounts+=( 'mqueue:mqueue:/dev/mqueue:noexec,nosuid,nodev' ) +cfg_mounts+=( 'shm:tmpfs:/dev/shm:defaults,mode=0777' ) # Functions rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; } @@ -23,9 +28,12 @@ rc.mount_misc() { for m in "${cfg_mounts[@]}"; do IFS=':' read fs fs_type mountpoint mount_options <<< "$m" - [[ "$mount_options" ]] || { mount_options='defaults' } + [[ "$mount_options" ]] || { mount_options='defaults'; } - mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" + mountpoint -q "$mountpoint" || { + [[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; } + mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" + } done } diff --git a/etc/rc.conf b/etc/rc.conf index e6f9691..39a045f 100644 --- a/etc/rc.conf +++ b/etc/rc.conf @@ -5,7 +5,7 @@ export PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin' cfg_hostname='changeme' # Services -cfg_services+=( 'miscf' 'fsck' 'mount' 'systemd-udevd' 'sysctl' ) # Services that need tp be started in an order +cfg_services+=( 'fsck' 'mount' 'systemd-udevd' 'sysctl' ) # Services that need tp be started in an order cfg_services+=( agetty-tty{2..6} ) # Comment this if your init starts something on the ttys itself. cfg_services+=( '@crond' '@network' '@dbus' '@alsa' ) # These start in parallel.