diff mbox series

[OpenWrt-Devel,v2,3/3] apm821xx: set DEVICE_TYPE to "nas" for sata subtarget

Message ID 20200530092816.1610-4-freifunk@adrianschmutzler.de
State Accepted
Delegated to: Adrian Schmutzler
Headers show
Series treewide: tidy up use of DEVICE_TYPE | expand

Commit Message

Adrian Schmutzler May 30, 2020, 9:28 a.m. UTC
Since DEVICE_TYPE cannot be set per device, just set DEVICE_TYPE
to "nas" for the entire subtarget, which only contains this single
device.

Note that while this looks like a cosmetic change in combination
with the previous patches, this particular patch actually changes
the packages for the device.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Cc: Christian Lamparter <chunkeey@gmail.com>
Cc: Sungbo Eo <mans0n@gorani.run>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

This has been added as a separate patch to keep 1/3 cosmetic, i.e.
it only removes stuff that was not having an effect anyway. In
contrast, this patch will have an effect, so I think it's better
to have it separate.
---
 target/linux/apm821xx/sata/target.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij Aug. 6, 2020, 2:57 p.m. UTC | #1
Hi Adrian,

I got back to trying to fix the NAS packages for the Gemini.

On Sat, May 30, 2020 at 11:29 AM Adrian Schmutzler
<freifunk@adrianschmutzler.de> wrote:

> Since DEVICE_TYPE cannot be set per device, just set DEVICE_TYPE
> to "nas" for the entire subtarget, which only contains this single
> device.
>
> Note that while this looks like a cosmetic change in combination
> with the previous patches, this particular patch actually changes
> the packages for the device.
>
> Suggested-by: Christian Lamparter <chunkeey@gmail.com>
> Cc: Christian Lamparter <chunkeey@gmail.com>
> Cc: Sungbo Eo <mans0n@gorani.run>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

So if I understand correctly, what I need to do it to split
Gemini into subtargets (such as "boots from flash" and "boots from harddisk")
like the APM does, so I can establish two profiles, and then
that means I can also split the Makefile for the images
like the APM does?

Yours,
Linus Walleij
Adrian Schmutzler Aug. 6, 2020, 3:07 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Linus Walleij [mailto:linus.walleij@linaro.org]
> Sent: Donnerstag, 6. August 2020 16:57
> To: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> Cc: OpenWrt Development List <openwrt-devel@lists.openwrt.org>;
> Christian Lamparter <chunkeey@gmail.com>; Sungbo Eo
> <mans0n@gorani.run>
> Subject: Re: [PATCH v2 3/3] apm821xx: set DEVICE_TYPE to "nas" for sata
> subtarget
> 
> Hi Adrian,
> 
> I got back to trying to fix the NAS packages for the Gemini.
> 
> On Sat, May 30, 2020 at 11:29 AM Adrian Schmutzler
> <freifunk@adrianschmutzler.de> wrote:
> 
> > Since DEVICE_TYPE cannot be set per device, just set DEVICE_TYPE to
> > "nas" for the entire subtarget, which only contains this single
> > device.
> >
> > Note that while this looks like a cosmetic change in combination with
> > the previous patches, this particular patch actually changes the
> > packages for the device.
> >
> > Suggested-by: Christian Lamparter <chunkeey@gmail.com>
> > Cc: Christian Lamparter <chunkeey@gmail.com>
> > Cc: Sungbo Eo <mans0n@gorani.run>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> So if I understand correctly, what I need to do it to split Gemini into
> subtargets (such as "boots from flash" and "boots from harddisk") like the
> APM does, so I can establish two profiles, and then that means I can also split
> the Makefile for the images like the APM does?

the question is what's your goal at the end. Just taking care of adding/removing packages can be done for the device individually without touching DEVICE_TYPE at all.

Switching parameters in packages based on a DEVICE_TYPE will be another story, I remember that Matthias said it currently was broken anyway IIRC.

We would technically also still have the option to make DEVICE_TYPE a real per-device variable, but then this would only work for package _selection_ again.

If you really desire to change package config stuff, you will indeed need a "NAS" subtarget then. And then you'd still have to check whether the package is really built "per-subtarget", and not just per arch or similar ...

So, as you see, it's hard to discuss this in general, but we would need to base the discussion on the individual packages affected.

Best

Adrian

> 
> Yours,
> Linus Walleij
diff mbox series

Patch

diff --git a/target/linux/apm821xx/sata/target.mk b/target/linux/apm821xx/sata/target.mk
index d3af6ef821..43b1aa0324 100644
--- a/target/linux/apm821xx/sata/target.mk
+++ b/target/linux/apm821xx/sata/target.mk
@@ -1,4 +1,5 @@ 
 BOARDNAME := Devices which boot from SATA (NAS)
+DEVICE_TYPE := nas
 FEATURES += ext4 usb ramdisk squashfs rootfs-part boot-part
 DEFAULT_PACKAGES += badblocks block-mount e2fsprogs kmod-hwmon-drivetemp \
 		    kmod-dm kmod-md-mod partx-utils mkf2fs f2fsck