Indexed arrays were only needed to override defaults.

This commit is contained in:
Jack L. Frost 2015-08-31 01:56:54 +03:00
parent ec2ff428f8
commit 2b32655365
2 changed files with 22 additions and 23 deletions

25
rc.conf
View File

@ -14,25 +14,24 @@ cfg_services+=(
'@lo.iface' '@scron' '@lo.iface' '@scron'
) )
# Add modules you want to be loaded at boot time here # Uncomment and add modules you want to be loaded at boot time here
#cfg_modules=( ) #cfg_modules=( )
# Make C-A-D perform a soft reset # Make C-A-D perform a soft reset
ctrlaltdel soft ctrlaltdel soft
# Default virtual mounts for linux systems # Virtual filesystems
cfg_mounts[proc]='proc:/proc' cfg_mounts=(
cfg_mounts[run]='tmpfs:/run' 'proc:proc:/proc'
cfg_mounts[sys]='sysfs:/sys' 'run:tmpfs:/run'
'sys:sysfs:/sys'
# devfs and its children 'dev:devtmpfs:/dev'
cfg_mounts[dev]='devtmpfs:/dev' 'pts:devpts:/dev/pts:noexec,nosuid,gid=5,mode=0620'
cfg_mounts[pts]='devpts:/dev/pts:noexec,nosuid,gid=5,mode=0620' 'mqueue:mqueue:/dev/mqueue:noexec,nosuid,nodev'
cfg_mounts[mqueue]='mqueue:/dev/mqueue:noexec,nosuid,nodev' 'shm:tmpfs:/dev/shm:defaults,mode=0777'
cfg_mounts[shm]='tmpfs:/dev/shm:defaults,mode=0777' )
# Some temporary directories # Some temporary directories and files
cfg_tmpdirs+=( '/run/lock' '/run/lock/lvm' '/run/lvm' '/run/user' ) cfg_tmpdirs+=( '/run/lock' '/run/lock/lvm' '/run/lvm' '/run/user' )
# And temporary files
cfg_tmpfiles+=( '/run/utmp' ) cfg_tmpfiles+=( '/run/utmp' )

20
rc.in
View File

@ -26,16 +26,16 @@ rc.tmpfiles() {
done done
} }
rc.mount_misc() { rc.mount() {
for fs in "${!cfg_mounts[@]}"; do for fs in "${cfg_mounts[@]}"; do
echo "${cfg_mounts[$fs]}" | while IFS=':' read fs_type mountpoint mount_options; do echo "$fs" | while IFS=':' read device fs_type mountpoint mount_options
[[ "$mount_options" ]] || { mount_options='defaults'; }
mountpoint -q "$mountpoint" || { [[ "$mount_options" ]] || { mount_options='defaults'; }
[[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; }
mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" mountpoint -q "$mountpoint" || {
} [[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; }
done mount "$device" -n -t "$fs_type" -o "$mount_options" "$mountpoint"
}
done done
} }
@ -108,7 +108,7 @@ rc.remount_root() {
} }
rc.boot() { rc.boot() {
rc.mount_misc rc.mount
rc.tmpfiles rc.tmpfiles
rc.hostname rc.hostname
rc.timezone rc.timezone