Bug#773991: flash-kernel: Fails when mtdblock kernel module isn't loaded
On Mon, 2014-12-29 at 13:58 +0000, Ian Campbell wrote:
> On Mon, 2014-12-29 at 14:50 +0100, Ben Hutchings wrote:
> > On Mon, 2014-12-29 at 13:24 +0000, Ian Campbell wrote:
> > > On Fri, 2014-12-26 at 20:30 +0100, Uwe Kleine-König wrote:
> > > > I wonder if flash-kernel should be smart enough to
> > > > load the module itself.
> > >
> > > I think it should.
> > >
> > > I think all which is needed is to add "modprobe -q mtdblock" into the
> > > mtdblock function. I believe anything which uses an mtdblock device
> > > passes through that function to translate the name into a device node.
> > >
> > > What do you think?
> >
> > You also need 'udevadm settle' to wait for the device nodes to appear.
>
> Good point, thanks.
Uwe, any chance you could try this please:
diff --git a/functions b/functions
index d45a4e6..a7ff6de 100644
--- a/functions
+++ b/functions
@@ -41,7 +41,11 @@ error() {
mtdblock() {
local mtdname="$1"
- sed -rn "s,^mtd([^:]*).*\"$mtdname\"\$,/dev/mtdblock\\1,p" "$PROC_MTD"
+ local dev=`sed -rn "s,^mtd([^:]*).*\"$mtdname\"\$,/dev/mtdblock\\1,p" "$PROC_MTD"`
+
+ modprobe -q mtdblock && udevadm settle --exit-if-exists=$dev || :
+
+ echo $dev
}
check_block_dev() {
Reply to: