aboutsummaryrefslogtreecommitdiff
path: root/sutils
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-15 15:43:23 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-15 15:45:04 +0100
commitb0bc5a592ba84b22518609e2e56f1ed466929c58 (patch)
treecb0a005ea1d317f3f1134dd7b3ab998897bf8635 /sutils
parentf28ca0a89bd1b23e136bb09685b1d9d3ea0b5bb1 (diff)
downloadhurd-b0bc5a592ba84b22518609e2e56f1ed466929c58.tar.gz
hurd-b0bc5a592ba84b22518609e2e56f1ed466929c58.tar.bz2
hurd-b0bc5a592ba84b22518609e2e56f1ed466929c58.zip
MAKEDEV: Add master and rumpdisk support
* sutils/MAKEDEV.sh: Add -M option to set the master device node. Add support for wd* devices through rumpdisk.
Diffstat (limited to 'sutils')
-rw-r--r--sutils/MAKEDEV.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/sutils/MAKEDEV.sh b/sutils/MAKEDEV.sh
index 0b040e0f..61b92eb3 100644
--- a/sutils/MAKEDEV.sh
+++ b/sutils/MAKEDEV.sh
@@ -11,6 +11,7 @@ DEVDIR=`pwd` # Reset below by -D/--devdir command line option.
STFLAGS="-g" # Set to -k if active translators are to be kept.
KEEP= # Set to something if existing files are to be left alone.
USE_PARTSTORE= # Whether to use the newer part: stores
+MASTER= # Where to get master device from
while :; do
case "$1" in
@@ -21,6 +22,7 @@ Make filesystem nodes for accessing standard system devices
-D, --devdir=DIR Use DIR when a device node name must be
embedded in a translator; default is the cwd
+ -M, --master-device=FILE Use FILE as master device node.
-k, --keep-active Leave any existing active translator running
-K, --keep-all Don't overwrite existing files
-p, --parted Prefer user-space parted stores to kernel devices
@@ -32,9 +34,13 @@ Make filesystem nodes for accessing standard system devices
-V, --version Print program version"
exit 0;;
--devdir) DEVDIR="$2"; shift 2;;
- --devdir=*) DEVDIR="`echo "$1" | sed 's/^--devdir=//'`"; shift 1;;
+ --devdir=*) DEVDIR="${1#--devdir=}"; shift 1;;
-D) DEVDIR="$2"; shift 2;;
- -D*) DEVDIR="`echo "$1" | sed 's/^-D//'`"; shift 1;;
+ -D*) DEVDIR="${1#-D}"; shift 1;;
+ --master-device) MASTER="$2":; shift 2;;
+ --master-device=*) MASTER="${1#--master-device=}"; shift 1;;
+ -M) MASTER="$2":; shift 2;;
+ -M*) MASTER="${1#-M}"; shift 1;;
--keep-active|-k) STFLAGS="-k"; shift;;
--keep-all|-K) KEEP=1; shift;;
--parted|-p) USE_PARTSTORE=1; shift;;
@@ -159,7 +165,7 @@ mkdev() {
st $I root 640 /hurd/storeio $I
;;
- [hrsc]d*)
+ [hrscw]d*)
local sliceno=
local n="${I#?d}"
local major="${n%%[!0-9]*}"
@@ -194,13 +200,19 @@ mkdev() {
lose "$I: Invalid slice or partition syntax"
;;
esac
+ case "$I" in
+ wd*)
+ USE_PARTSTORE=1
+ MASTER=@/dev/disk:
+ ;;
+ esac
# The device name passed all syntax checks, so finally use it!
if [ "$USE_PARTSTORE" ] && [ -z "$rest" ] && [ "$sliceno" ]; then
local dev=${I%s[0-9]*}
- st $I root 640 /hurd/storeio -T typed part:$sliceno:device:$dev
+ st $I root 640 /hurd/storeio -T typed part:$sliceno:device:$MASTER$dev
else
- st $I root 640 /hurd/storeio $I
+ st $I root 640 /hurd/storeio $MASTER$I
fi
;;