[OpenWrt-Devel] [PATCH 1/3] treewide: drop DEVICE_TYPE when used as device variable
Christian Lamparter
chunkeey at gmail.com
Fri May 29 17:23:43 EDT 2020
On Friday, 29 May 2020 22:32:10 CEST mail at adrianschmutzler.de wrote:
> > > > Or am I completely misled here?
> > >
> > > I believe you are right, it seems DEVICE_TYPE is not evaluated when
> > > set in a device definition.
> > True, question is then, should this really be called "DEVICE"_TYPE?
> > It's not like other DEVICE_* variables (DEVICE_NAME, DEVICE_PACKAGES or
> > DEVICE_DTS).
> > Because the "targets" of ath79/ipq40xx/etc... wouldn't work if they all had to
> > share a single, common DEVICE_NAME/_DTS/_PACKAGE.
> >
> > As for the MBLs, if I got this all correctly, that DEVICE_TYPE could be simply
> > moved to the apm821xx/sata target.mk
> > ---
> > --- a/target/linux/apm821xx/image/Makefile
> > +++ b/target/linux/apm821xx/image/Makefile
> > @@ -251,7 +251,6 @@ define Device/wd_mybooklive
> > DEVICE_VENDOR := Western Digital
> > DEVICE_MODEL := My Book Live Series (Single + Duo)
> > DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-
> > usb-storage kmod-fs-vfat wpad-basic
> > - DEVICE_TYPE := nas
> > DEVICE_DTS := wd-mybooklive
> > SUPPORTED_DEVICES += mbl wd,mybooklive-duo
> > BLOCKSIZE := 1k
> > --- a/target/linux/apm821xx/sata/target.mk
> > +++ b/target/linux/apm821xx/sata/target.mk
> > @@ -1,5 +1,6 @@
> > BOARDNAME := Devices which boot from SATA (NAS) FEATURES += ext4
> > usb ramdisk squashfs rootfs-part boot-part
> > +DEVICE_TYPE := nas
> > DEFAULT_PACKAGES += badblocks block-mount e2fsprogs kmod-hwmon-
> > drivetemp \
> > kmod-dm kmod-md-mod partx-utils mkf2fs f2fsck
> >
> > ---
> > And it would work as expected, right?
> >
> > Cheers,
> > Christian
> >
>
> Yes, in this case this would work as expected after change. Of course, this assumes that future additions to the subtarget would be "NAS-devices" as well.
>
> > True, question is then, should this really be called "DEVICE"_TYPE?
>
> That's exactly the question we are discussing in 3/3 of this series which went to the openwrt-devel, I only Cc-ed you for the 1/3.
Ah ok, that might explain more than you think. I got hit by a bug interaction
with debian's cyrus-imap in my mail setup: Well, thankfully it's fixed now:
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=960558>. I know that I
got sliently dropped from various MLs, since the mailsystem generated a ton
of bounces all at once. Sorry!
> I personally tend towards dropping DEVICE_TYPE entirely and separate the
> selection of different subsets for DEFAULT_PACKAGES from providing a config
> option for packages like busybox.
Ok, I guess it's time to say farewell to DEVICE_TYPE then...
The nice thing about DEVICE_TYPE was that it automatically included
a bunch of generally useful packages. On the other hand, if these would all
become default, then there will be more "-$package" showing up in
DEVICE_PACKAGES variables and possibly heated commit wars about whenever a
package should be included or dropped (but that's already happening right
now too).
I liked the idea of the DEVICE_TYPE variable though. But yes, it doesn't
really work the way its named. For this to have any merrit, DEVICE_TYPE
would need to stop meddling with DEFAULT_PACKAGES and add the selected
packages with something like a second "DEVICE_PACKAGES"... and hope that
TARGET_PER_DEVICE_ROOTFS can enforce the barriers between the devices
(well, sadly it can't do that 100%).
Cheers,
Christian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list