⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 devmap_mknod.sh

📁 Linux Device Mapper Source Code
💻 SH
字号:
#! /bin/sh# Startup script to create the device-mapper control device # on non-devfs systems.# Non-zero exit status indicates failure.# These must correspond to the definitions in device-mapper.h and dm.hDM_DIR="mapper"DM_NAME="device-mapper"set -eDIR="/dev/$DM_DIR"CONTROL="$DIR/control"# Check for devfs, procfsif test -e /dev/.devfsd ; then	echo "devfs detected: devmap_mknod.sh script not required."	exitfiif test ! -e /proc/devices ; then	echo "procfs not found: please create $CONTROL manually."	exit 1fi# Get major, minor, and mknodMAJOR=$(sed -n 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)MINOR=$(sed -n "s/^ *\([0-9]\+\) \+$DM_NAME\$/\1/p" /proc/misc)if test -z "$MAJOR" -o -z "$MINOR" ; then	echo "$DM_NAME kernel module not loaded: can't create $CONTROL."	exit 1fimkdir -p --mode=755 $DIRtest -e $CONTROL && rm -f $CONTROLecho "Creating $CONTROL character device with major:$MAJOR minor:$MINOR."mknod --mode=600 $CONTROL c $MAJOR $MINOR

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -