Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
22bb388fdb | |||
8af7868947 | |||
e4b9660bce | |||
550fabfc8e | |||
a607a63107 | |||
782b0a3fe8 | |||
440eada379 | |||
1c91d74984 |
2
rc.conf
2
rc.conf
@@ -10,7 +10,7 @@ cfg_hostname='changeme'
|
|||||||
|
|
||||||
# Services
|
# Services
|
||||||
cfg_services+=( '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+=( '@lo.iface' '@crond' '@dbus' '@alsa' ) # These start in parallel.
|
cfg_services+=( '@lo.iface' ) # These start in parallel.
|
||||||
cfg_services+=( @agetty-tty{2..6} ) # Comment this if your init starts something on the ttys itself.
|
cfg_services+=( @agetty-tty{2..6} ) # Comment this if your init starts something on the ttys itself.
|
||||||
cfg_services+=( 'rc.local' ) # Traditionally, rc.local starts last. Technically here it doesn't. Not quite :)
|
cfg_services+=( 'rc.local' ) # Traditionally, rc.local starts last. Technically here it doesn't. Not quite :)
|
||||||
|
|
||||||
|
23
rc.in
23
rc.in
@@ -14,21 +14,31 @@ cfg_mounts+=( 'shm:tmpfs:/dev/shm:defaults,mode=0777' )
|
|||||||
# Some temporary directories
|
# Some temporary directories
|
||||||
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' )
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
||||||
|
|
||||||
rc.motd() {
|
rc.motd() {
|
||||||
[[ -f "/etc/rc.motd" ]] && {
|
[[ -f "/etc/rc.motd" ]] && {
|
||||||
while read; do
|
while read; do
|
||||||
printf "$REPLY"
|
printf "%s\n" "$REPLY"
|
||||||
done < "/etc/rc.motd"
|
done < "/etc/rc.motd"
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.tmpdirs() {
|
rc.tmpfiles() {
|
||||||
mkdir -p -m0755 "${cfg_tmpdirs[@]}"
|
printf '%s\n' "${cfg_tmpdirs[@]}" | while IFS=':' read dir perm; do
|
||||||
|
mkdir -v -m "${perm:-755}" "$dir"
|
||||||
|
done
|
||||||
|
|
||||||
|
printf '%s\n' "${cfg_tmpfiles[@]}" | while IFS=':' read file perm; do
|
||||||
|
> "$file"
|
||||||
|
chmod -v "${perm:-644}" "$file"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.mount_misc() {
|
rc.mount_misc() {
|
||||||
@@ -104,7 +114,7 @@ rc.stop_everything() {
|
|||||||
|
|
||||||
rc.unmount_everything() {
|
rc.unmount_everything() {
|
||||||
echo "Unmounting filesystems..."
|
echo "Unmounting filesystems..."
|
||||||
umount -a
|
umount -r -a
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.remount_root() {
|
rc.remount_root() {
|
||||||
@@ -114,7 +124,7 @@ rc.remount_root() {
|
|||||||
|
|
||||||
rc.boot() {
|
rc.boot() {
|
||||||
rc.mount_misc
|
rc.mount_misc
|
||||||
rc.tmpdirs
|
rc.tmpfiles
|
||||||
rc.hostname
|
rc.hostname
|
||||||
rc.timezone
|
rc.timezone
|
||||||
rc.modules
|
rc.modules
|
||||||
@@ -143,6 +153,7 @@ rc.shutdown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc.hostname() {
|
rc.hostname() {
|
||||||
|
[[ -f '/etc/hostname' ]] && { hostname "$(</etc/hostname)"; }
|
||||||
[[ "$cfg_hostname" ]] && { hostname "$cfg_hostname"; }
|
[[ "$cfg_hostname" ]] && { hostname "$cfg_hostname"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +176,7 @@ rc.main() {
|
|||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
boot)
|
boot)
|
||||||
echo "Welcome to `uname -rs`"
|
echo "Welcome to $(uname -rs)"
|
||||||
rc.boot
|
rc.boot
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user