[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#782785: initramfs-tools: allow URI/server:/path root= arguments



Package: initramfs-tools
Version: 0.120
Severity: wishlist
Tags: patch

I'm trying to properly package local scripts which allow me to boot from a
plan9 fs over TCP/IPv6 without using an IPv4 address. I believe the most
natural way of doing so is with a kernel command line along the lines of
"root=server:/path rootfstype=diod boot=diod", which would then call
"/sbin/mount.diod server:/path /root". However, for that to work, bug #697017
needs to be fixed at least in the special case of URL-like root= arguments.
(Very confusingly, the problem only arises when the first character of the
hostname is a valid hexadecimal digit; even more confusingly, a server name
that's a valid hexadecimal string would result in very strange breakage as it
would be parsed as a device name).

An alternative, which would require no modification of scripts/functions, would
be to use nfsroot= to specify the root file system; however, I think that would
be extremely confusing because NFS is not actually being used.

I therefore suggest the following very minor change:

diff --git a/scripts/functions b/scripts/functions
index 8c1bb1f..ae23f3b 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -106,6 +106,9 @@ parse_numeric() {
     /*)
         return
         ;;
+    *:/*)
+        return
+        ;;
     [0-9]*:[0-9]*)
         minor=$(( ${1#*:} ))
         major=$(( ${1%:*} ))

That would retain compatibility with the LILO hexadecimal notation as well as
the decimal major:minor notation, but allow us to pass both URIs and
server:/path expressions as root= arguments, which would allow intuitive and
working command lines for root shares on various networked file system.

(I'd like to reiterate that with a normal initramfs present, as far as I can
see, the Linux kernel does not attempt to parse the root= argument, so we're
free to use it for the first argument for mount(8) or its closest available
equivalent rather than being restricted to the few values accepted by the very
old code in linux/init/do_mounts.c.)


Reply to: