mounting these is the rc's job
This commit is contained in:
parent
0b8f15ee5e
commit
e2c9da41a8
29
bin/rc
29
bin/rc
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Default virtual mounts for linux systems
|
||||||
|
cfg_mounts+=( 'proc:proc:/proc:' )
|
||||||
|
cfg_mounts+=( 'run:tmpfs:/run:' )
|
||||||
|
cfg_mounts+=( 'sys:sysfs:/sys:' )
|
||||||
|
cfg_mounts+=( 'dev:devtmpfs:/dev:' )
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
||||||
|
|
||||||
|
@ -13,23 +19,14 @@ rc.motd() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.mount() {
|
|
||||||
local fs
|
|
||||||
local fs_type
|
|
||||||
local mountpoint
|
|
||||||
local mount_options
|
|
||||||
|
|
||||||
fs="$1"
|
|
||||||
fs_type="$2"
|
|
||||||
mountpoint="$3"
|
|
||||||
mount_options="${4:-defaults}"
|
|
||||||
|
|
||||||
mount "$1" -n -t "$2" -o "$mount_options" "$3"
|
|
||||||
}
|
|
||||||
|
|
||||||
rc.mount_misc() {
|
rc.mount_misc() {
|
||||||
mountpoint -q /proc || { rc.mount proc proc /proc; }
|
for m in "${cfg_mounts[@]}"; do
|
||||||
mountpoint -q /dev || { rc.mount dev devtmpfs /dev; }
|
IFS=':' read fs fs_type mountpoint mount_options <<< "$m"
|
||||||
|
|
||||||
|
[[ "$mount_options" ]] || { mount_options='defaults' }
|
||||||
|
|
||||||
|
mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.parse_cmdline() {
|
rc.parse_cmdline() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user