diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-01 13:35:57 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-08-01 13:35:57 +0200 |
commit | 16c741ccaea1356d29e6d9d0ca93bd3a98c2d934 (patch) | |
tree | 195cf0476c502a69f7afca3b46b21f0a6e40cc8a /debian/patches/makedev_parted_store.patch | |
parent | 50861e36b4126aebba2ece7ab0bc3b61ff26add8 (diff) |
Sort out how device and server nodes are created
- debian/patches/makedev_keep_options.patch: Introduces the -k and -K
options to MAKEDEV, respectively to keep active translators running or
leave existing files alone completely.
- debian/patches/makedev_parted_store.patch: MAKEDEV -p will use parted
instead of device stores for disk partitions.
- debian/local/setup-translators: New script installed in /usr/lib/hurd,
uses MAKEDEV's new options to create all the necessary device and
server nodes.
- debian/local/runsystem (hurd-udeb): Uses setup-translators in "minimal
mode" to prepare the initrd when the installer is started. Parted
stores are used to avoid problems when reloading the partition table.
- debian/hurd.postinst: Uses setup-translators to create missing nodes on
upgrades (on initial installs, debootstrap will use the
setup-translators script from the installed hurd package to setup the
devices and servers itself).
Diffstat (limited to 'debian/patches/makedev_parted_store.patch')
-rw-r--r-- | debian/patches/makedev_parted_store.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/debian/patches/makedev_parted_store.patch b/debian/patches/makedev_parted_store.patch new file mode 100644 index 00000000..ea10edff --- /dev/null +++ b/debian/patches/makedev_parted_store.patch @@ -0,0 +1,70 @@ +Add option -p to MAKEDEV to use user-space parted stores for partition devices. + +Index: hurd/sutils/MAKEDEV.sh +=================================================================== +--- hurd.orig/sutils/MAKEDEV.sh 2010-07-08 00:48:13.000000000 +0000 ++++ hurd/sutils/MAKEDEV.sh 2010-07-08 01:18:26.000000000 +0000 +@@ -10,6 +10,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 + + while :; do + case "$1" in +@@ -22,6 +23,8 @@ + embedded in a translator; default is the cwd + -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 ++ for partition devices + -n, --dry-run Don't actually execute any commands + -v, --verbose Show what commands are executed to make the devices + -?, --help Give this help list +@@ -34,11 +37,12 @@ + -D*) DEVDIR="`echo "$1" | sed 's/^-D//'`"; shift 1;; + --keep-active|-k) STFLAGS="-k"; shift;; + --keep-all|-K) KEEP=1; shift;; ++ --parted|-p) USE_PARTSTORE=1; shift;; + --verbose|-v) ECHO=echo; shift;; + --dry-run|-n) EXEC=:; shift;; + -nv|-vn) ECHO=echo; EXEC=:; shift;; + --usage) +- echo "Usage: $0 [-V?] [-D DIR] [--help] [--usage] [--version]" ++ echo "Usage: $0 [-V?] [-D DIR] [--help] [--usage] [--version] [--parted]" + echo " [--devdir=DIR] [--keep-active] [--keep-all] DEVNAME..." + exit 0;; + --version|-V) +@@ -150,6 +154,7 @@ + ;; + + [hrsc]d*) ++ local sliceno= + local n="${I#?d}" + local major="${n%%[!0-9]*}" + if [ -z "$major" ]; then +@@ -170,7 +175,9 @@ + ;; + esac + case "$rest" in +- '') ;; # Whole slice ++ '') # Whole slice, can use parted stores ++ sliceno=$slice ++ ;; + [a-z]) ;; # BSD partition after slice + *) + lose "$I: Invalid partition \`$rest'" +@@ -183,7 +190,12 @@ + esac + + # The device name passed all syntax checks, so finally use it! +- st $I root 640 /hurd/storeio $I ++ 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 ++ else ++ st $I root 640 /hurd/storeio $I ++ fi + ;; + + # /dev/shm is used by the POSIX.1 shm_open call in libc. |