Browse Source
Now init checks that we understood the root= option, and can act upon it, presenting and error if not. Also, clean up the generation of udev rules such that we don't require /bin/echo.master

5 changed files with 42 additions and 15 deletions
@ -1,6 +1,10 @@
@@ -1,6 +1,10 @@
|
||||
if [ "${root#/dev/}" != "$root" ]; then |
||||
#!/bin/bash # for highlighting |
||||
|
||||
if [ "${root%%:*}" = "block" ]; then |
||||
( |
||||
echo 'KERNEL=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" ' |
||||
echo 'SYMLINK=="'${root#/dev/}'", RUN+="/bin/mount '$fstype' -o '$rflags' '$root' '$NEWROOT'" ' |
||||
printf 'KERNEL=="%s", RUN+="/bin/mount -t %s -o %s %s %s"\n' \ |
||||
${root#block:/dev/} "$fstype" "$rflags" "${root#block:}" "$NEWROOT" |
||||
printf 'SYMLINK=="%s", RUN+="/bin/mount -t %s -o %s %s %s"\n' \ |
||||
${root#block:/dev/} "$fstype" "$rflags" "${root#block:}" "$NEWROOT" |
||||
) >> /etc/udev/rules.d/99-mount.rules |
||||
fi |
||||
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh |
||||
dracut_install echo |
||||
inst_hook cmdline 20 "$moddir/parse-root-opts.sh" |
||||
inst_hook cmdline 10 "$moddir/parse-root-opts.sh" |
||||
inst_hook cmdline 95 "$moddir/parse-block.sh" |
||||
inst_hook pre-udev 30 "$moddir/block-genrules.sh" |
||||
inst_hook mount 99 "$moddir/mount-root.sh" |
||||
|
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash # for highlighting |
||||
|
||||
case "$root" in |
||||
block:LABEL=*|LABEL=*) |
||||
root="${root#block:}" |
||||
root="$(echo $root | sed 's,/,\\x2f,g')" |
||||
root="block:/dev/disk/by-label/${root#LABEL=}" |
||||
rootok=1 ;; |
||||
block:UUID=*|UUID=*) |
||||
root="${root#block:}" |
||||
root="block:/dev/disk/by-uuid/${root#UUID=}" |
||||
rootok=1 ;; |
||||
/dev/*) |
||||
root="block:${root}" |
||||
rootok=1 ;; |
||||
esac |
Loading…
Reference in new issue