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 | |
| 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')
| -rw-r--r-- | debian/patches/makedev_keep_options.patch | 56 | ||||
| -rw-r--r-- | debian/patches/makedev_parted_store.patch | 70 | ||||
| -rw-r--r-- | debian/patches/series | 2 |
3 files changed, 128 insertions, 0 deletions
diff --git a/debian/patches/makedev_keep_options.patch b/debian/patches/makedev_keep_options.patch new file mode 100644 index 00000000..90a6c6e9 --- /dev/null +++ b/debian/patches/makedev_keep_options.patch @@ -0,0 +1,56 @@ +Add options -k and -K to MAKEDEV.sh to chose not to overwrite existing entries. + +Index: hurd/sutils/MAKEDEV.sh +=================================================================== +--- hurd.orig/sutils/MAKEDEV.sh 2010-07-01 18:14:22.000000000 +0200 ++++ hurd/sutils/MAKEDEV.sh 2010-07-01 18:17:37.000000000 +0200 +@@ -8,6 +8,8 @@ + ECHO=: # Change to "echo" to echo commands. + EXEC="" # Change to ":" to suppress command execution. + 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. + + while :; do + case "$1" in +@@ -18,6 +20,8 @@ + + -D, --devdir=DIR Use DIR when a device node name must be + 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 + -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 +@@ -28,11 +32,14 @@ + --devdir=*) DEVDIR="`echo "$1" | sed 's/^--devdir=//'`"; shift 1;; + -D) DEVDIR="$2"; shift 2;; + -D*) DEVDIR="`echo "$1" | sed 's/^-D//'`"; shift 1;; ++ --keep-active|-k) STFLAGS="-k"; shift;; ++ --keep-all|-K) KEEP=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] [--devdir=DIR] DEVNAME..." ++ echo "Usage: $0 [-V?] [-D DIR] [--help] [--usage] [--version]" ++ echo " [--devdir=DIR] [--keep-active] [--keep-all] DEVNAME..." + exit 0;; + --version|-V) + echo "STANDARD_HURD_VERSION_MAKEDEV_"; exit 0;; +@@ -61,10 +68,13 @@ + local OWNER="$2" + local PERM="$3" + shift 3 +- if cmd settrans -cg "$NODE"; then ++ if [ "$KEEP" ] && [ -e "$NODE" ]; then ++ return; ++ fi ++ if cmd settrans $STFLAGS -c "$NODE"; then + cmd chown "$OWNER" "$NODE" + cmd chmod "$PERM" "$NODE" +- cmd settrans "$NODE" "$@" ++ cmd settrans $STFLAGS "$NODE" "$@" + fi + } + 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. diff --git a/debian/patches/series b/debian/patches/series index bdc0719d..aaa67b3b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,3 +22,5 @@ libpthread_fix.patch extern_inline_fix.patch proxy-defpager.diff libpthread_procfs.patch +makedev_keep_options.patch +makedev_parted_store.patch |
