mbox series

[OpenWrt-Devel,0/2,RFC] build: allow selective per device initramfs

Message ID 1557087260-32680-1-git-send-email-ynezz@true.cz
Headers show
Series build: allow selective per device initramfs | expand

Message

Petr Štetiar May 5, 2019, 8:14 p.m. UTC
Hi,

I've added "lantiq/xrx200: enable initramfs images" into my staging tree[1],
where this patch tries to fix shortcoming of the commit eae6cac6a3 ("lantiq:
add support for AVM FRITZ!Box 7362 SL"), as one needs an initramfs image to
flash OpenWrt from stock firmware (as described in the commit log). This patch
is simply going to enable build of initramfs images for all devices under
lantiq's xrx200 subtarget.

Then I've started a review of "ramips: Add support for Head Weblink
HDRM200"[2], where it's apparent, that this device needs initramfs as well ,
excerpt from commit message:

 In order to install OpenWRT, you first need to compile an initramfs
 (ramdisk)-image for the device. Once the image is ready, you need to do
 the following:

I find it quite weird to demand any kind of compilation by the end-users, but
I also find it quite wasteful to build initramfs images for all devices under
particular target (lantiq/xrx200 and ramips/mt7620), just because one (or
minority) of device needs this image.

So I've looked at the possible solutions, and with the limited time on hand
I've come up with the following patch series. I'm sure, that this is kind of a
weird workaround, but I find it less obtrusive then building of initramfs
images for all targets, with no apparent use.

Essential solution would be something like image recipe for initramfs, but
since it's quite complicated topic it would need a lot more time to fix it
properly.

So I'm wondering if such workaround to avoid building of unnecessary initramfs
images would be acceptable, or until there's a proper solution, we should
simply live with the `FEATURES += ramdisk` based "solution".

-- ynezz

1. https://git.openwrt.org/b0d143cf6d3905
2. https://patchwork.ozlabs.org/patch/1094927/

Petr Štetiar (2):
  build: allow selective per device building of initramfs
  lantiq: image: build initramfs only for FRITZ7362SL

 config/Config-images.in              |  2 +-
 include/image.mk                     | 11 ++++++++++-
 scripts/target-metadata.pl           |  1 +
 target/Config.in                     |  3 +++
 target/linux/lantiq/image/Makefile   |  1 +
 target/linux/lantiq/xrx200/target.mk |  2 +-
 6 files changed, 17 insertions(+), 3 deletions(-)

Comments

Kristian Evensen May 6, 2019, 8:12 a.m. UTC | #1
Hi Petr,

On Sun, May 5, 2019 at 10:14 PM Petr Štetiar <ynezz@true.cz> wrote:
> I find it quite weird to demand any kind of compilation by the end-users, but
> I also find it quite wasteful to build initramfs images for all devices under
> particular target (lantiq/xrx200 and ramips/mt7620), just because one (or
> minority) of device needs this image.
>
> So I've looked at the possible solutions, and with the limited time on hand
> I've come up with the following patch series. I'm sure, that this is kind of a
> weird workaround, but I find it less obtrusive then building of initramfs
> images for all targets, with no apparent use.
>
> Essential solution would be something like image recipe for initramfs, but
> since it's quite complicated topic it would need a lot more time to fix it
> properly.
>
> So I'm wondering if such workaround to avoid building of unnecessary initramfs
> images would be acceptable, or until there's a proper solution, we should
> simply live with the `FEATURES += ramdisk` based "solution".

Thank you for sharing your patches. I had started implementing a
similar solution, but quickly abandoned my work when I saw the commits
in your staging tree. Even though I have no authority, I think your
solution is nice and it solves the problem at hand. I applied your
patches and modified mt7620 + the HDRM200 target accordingly, and as
expected I only get one initramfs image. I agree that building
initramfs for devices that do not need it is redundant (I see that
initramfs is built for all mt7621 targets for example), so I am very
much in favor of merging this series.

BR,
Kristian