📄 init-udev
字号:
#!/bin/sh## udev This is a minimal non-LSB version of a UDEV startup script. It# was derived by stripping down the udev-058 LSB version for use# with buildroot on embedded hardware using Linux 2.6.12+ kernels.## You may need to customize this for your system's resource limits# (including startup time!) and administration. For example, if# your early userspace has a custom initramfs or initrd you might# need /dev much earlier; or without hotpluggable busses (like USB,# PCMCIA, MMC/SD, and so on) your /dev might be static after boot.## This script assumes your system boots right into the eventual root# filesystem, and that init runs this udev script before any programs# needing more device nodes than the bare-bones set -- /dev/console,# /dev/zero, /dev/null -- that's needed to boot and run this script.## old kernels don't use udevcase $(uname -r) in2.6*|2.7*) ;;*) exit 0;;esac# Check for missing binariesUDEV_BIN=/sbin/udevtest -x $UDEV_BIN || exit 5UDEVSTART_BIN=/sbin/udevstarttest -x $UDEVSTART_BIN || exit 5# Check for config file and read itUDEV_CONFIG=/etc/udev/udev.conftest -r $UDEV_CONFIG || exit 6. $UDEV_CONFIG# Directory where sysfs is mountedSYSFS_DIR=/syscase "$1" in start) # mount sysfs if it's not yet mounted if [ ! -d $SYSFS_DIR ]; then echo "${0}: SYSFS_DIR \"$SYSFS_DIR\" not found" exit 1 fi grep -q "^sysfs $SYSFS_DIR" /proc/mounts || mount -t sysfs /sys /sys || exit 1 # mount $udev_root as ramfs if it's not yet mounted # we know 2.6 kernels always support ramfs if [ ! -d $udev_root ]; then echo "${0}: udev_root \"$udev_root\" not found" exit 1 fi grep -q "^udev $udev_root" /proc/mounts || mount -t ramfs udev $udev_root || exit 1 # heck, go whole-hog: use only new style hotplug # echo $UDEV_BIN > /proc/sys/kernel/hotplug # populate /dev (normally) echo -n "Populating $udev_root using udev... " $UDEVSTART_BIN || (echo "FAIL" && exit 1) mkdir $udev_root/pts $udev_root/shm echo "done" ;; stop) # do nothing ;; *) echo "Usage: $0 {start|stop}" exit 1 ;;esac
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -