diff options
author | Martin Michlmayr <tbm@cyrius.com> | 2010-06-13 17:23:14 +0100 |
---|---|---|
committer | Michael Prokop <mika@debian.org> | 2010-06-16 16:48:06 +0200 |
commit | bb66fc2a8b40d6c8ecd093cf1b358d4476ab1e1c (patch) | |
tree | adb3f1eba8cec96f11666e6e25145909a87be388 /scripts | |
parent | 3054e3ed58dee5a70bcd462c71573d380f03bd7a (diff) | |
download | initramfs-tools-bb66fc2a8b40d6c8ecd093cf1b358d4476ab1e1c.tar.gz initramfs-tools-bb66fc2a8b40d6c8ecd093cf1b358d4476ab1e1c.zip |
hook-functions/init/scripts/local: add support for ubifs.
MODULES=dep fails when / is ubifs. This patch adds support for
something like root=ubi0:rootfs when ubi is modular.
Quoting Martin:
It essentially does three things:
- adds the correct modules to the ramdisk (for MODULES=dep and MODULES=most)
- reads ubi.mtd= from the command line
- loads ubi with the ubi.mtd info and ignores the "Waiting for root" check
I've successfully tested this with a kernel with modular ubi and with
the following boot variants:
console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
console=ttyS0,115200 ubi.mtd=2 root=ubi0_0 rootfstype=ubifs
With
console=ttyS0,115200 ubi.mtd=2 root=/dev/ubi0_0 rootfstype=ubifs
I get an error that it cannot mount root but I suspect this is an
ubifs error and has nothing to do with i-t (since at this point I can
manually mount it with -t ubifs ubi0_0 whereas the /dev/ variant
doesn't work).
Tested with MODULES=dep and MODULES=most as well as with a kernel that
has ubifs built in.
Closes: #582858
Thanks: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Reviewed-by: Michael Prokop <mika@debian.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/local | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/local b/scripts/local index 98464f9..9b51174 100644 --- a/scripts/local +++ b/scripts/local @@ -8,6 +8,13 @@ pre_mountroot() wait_for_udev 10 + # Load ubi with the correct MTD partition and return since fstype + # doesn't work with a char device like ubi. + if [ -n "$UBIMTD" ]; then + modprobe ubi mtd=$UBIMTD + return + fi + # Don't wait for a root device that doesn't have a corresponding # device in /dev (ie, mtd0) if [ "${ROOT#/dev}" = "${ROOT}" ]; then |