diff --git a/init.d/devfs-links b/init.d/devfs-links new file mode 100755 index 0000000..02fea03 --- /dev/null +++ b/init.d/devfs-links @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# This is a script to set up the links in /dev in absence of e?(u|s?m)dev. +# Run this _after_ miscfs. + +service_type='oneshot' + +# Config +cfg_links=( + '/proc/self/fd;/dev/fd' + ) + +start() { + for l in "${cfg_links[@]}"; do + IFS=';' read dest link <<< "$l" + + [[ -e "$link" ]] || { + [[ -e "$dest" ]] && { + ln -s "$dest" "$link" + } + } + done +} diff --git a/init.d/devfs-permissions b/init.d/devfs-permissions new file mode 100755 index 0000000..fe6dfc2 --- /dev/null +++ b/init.d/devfs-permissions @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# This is a script to set up the right permissions in /dev in absence of e?(u|s?m)dev. +# Run this _after_ miscfs. + +service_type='oneshot' + +# Config +cfg_devices=( + '/dev/snd;root:audio;770' + '/dev/dri;root:video;770' + '/dev/fuse;root:root;777' + ) + +cfg_links=( + '/proc/self/fd;/dev/fd' + ) + +start() { + for d in "${cfg_devices[@]}"; do + IFS=';' read device owner perms <<< "$d" + + [[ -e "$device" ]] && { + chown -R "$owner" "$device" + chmod -R "$perms" "$device" + } + done + + for l in "${cfg_links[@]}"; do + IFS=';' read dest link <<< "$l" + + [[ -e "$link" ]] || { + [[ -e "$dest" ]] && { + ln -s "$dest" "$link" + } + } + done +} diff --git a/init.d/fsck b/init.d/fsck index 897dd29..7bde37d 100755 --- a/init.d/fsck +++ b/init.d/fsck @@ -1,7 +1,5 @@ #!/usr/bin/env watchman -service_command='/bin/fsck' -service_args='-A -C -p' service_type='oneshot' start() { @@ -9,7 +7,7 @@ start() { mount / -o remount,ro watchman.msg "Checking filesystems..." - watchman.start + /usr/bin/fsck -A -C -p watchman.msg "Remounting / as read-write..." mount / -o remount,rw