# HG changeset patch # User Pascal Bellard # Date 1389567603 -3600 # Node ID 8cd1011dc63387d8881e6e66c9ea77d54274532a # Parent ad05e742684d3aab2f4f3bf3baf2de37e24d8c2e busybox: fix unmappable insmod diff -r ad05e742684d -r 8cd1011dc633 busybox/receipt --- a/busybox/receipt Sat Jan 11 11:04:09 2014 +0000 +++ b/busybox/receipt Mon Jan 13 00:00:03 2014 +0100 @@ -43,6 +43,7 @@ diff.u diet.u losetup.u +insmod.u EOT cp $stuff/$PACKAGE-${VERSION%.*}.config .config } diff -r ad05e742684d -r 8cd1011dc633 busybox/stuff/busybox-1.22-insmod.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.22-insmod.u Mon Jan 13 00:00:03 2014 +0100 @@ -0,0 +1,15 @@ +--- busybox-1.22.0/modutils/modutils.c ++++ busybox-1.22.0/modutils/modutils.c +@@ -160,7 +160,11 @@ + mmaped = 1; + } else { + errno = ENOMEM; /* may be changed by e.g. open errors below */ +- image = xmalloc_open_zipped_read_close(filename, &image_size); ++ image = xmalloc_open_read_close(filename, &image_size); ++ if (image && image_size >= 4 && strncmp(image+1,"ELF",3)) { ++ free(image); ++ image = xmalloc_open_zipped_read_close(filename, &image_size); ++ } + if (!image) + return -errno; + }