some new scripts and fsck fix
This commit is contained in:
37
init.d/devfs-permissions
Executable file
37
init.d/devfs-permissions
Executable file
@@ -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
|
||||
}
|
Reference in New Issue
Block a user