[PATCH/RFC 0/3] UBI: unify mouting rootfs based on cmdline parameter

Richard Weinberger richard at nod.at
Sat Aug 27 13:43:45 PDT 2016


Daniel,

On 27.08.2016 21:43, Daniel Golle wrote:
> Hi!
> 
> In an attempts to fix the flaws of the current set of UBI-related
> patches we are carrying in OpenWrt, I re-wrote the way mounting the
> rootfs from UBI in OpenWrt/LEDE works. The main requirement I face
> which cannot be easily addressed using other means which are already
> available in the kernel is the fact that UBIFS and squashfs-on-UBI
> require different parameters to be set on the cmdline, e.g.
> for UBIFS: ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs
> for squashfs: ubi.mtd=ubi ubiblock=0,1 root=/dev/ubiblock0_1 rootfstype=squashfs
> 
> The idea behind this patchset is to provide a single syntax which
> allows mouting rootfs in both cases. To achieve that, the parsing of
> the volume name string from UBIFS is moved to UBI, so it can be
> reused by other in-kernel users. This is then used by init/do_mounts.c
> to create a ubiblock device if the filesystem on the device is
> non-UBIFS. To actually set this device to be ROOT_DEV, ubiblock_create
> is extended to allow passing-back the created ubiblock device.
> 
> With those changes, a single set of cmdline parameters is
> sufficient to mount either UBIFS or any other block filesystem
> by creating a ubiblock device:
> ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs,squashfs

well, this all boils down to the point we have already been.
I will tell you do set the cmdline correctly, either via bootloader
or devicetree, or use an initramfs.

I can understand that OpenWrt/LEDE sometimes has to start from a hostile
bootloader which doesn't let you changing the cmdline.
But you can still set (and override) it either using CONFIG_CMDLINE or
in your device tree.
For advanced booting you can also use a inittamfs.

So, what do I miss?

Thanks,
//richard



More information about the linux-mtd mailing list