Message ID | 20240906171503.3495498-2-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Dario, All., On 2024-09-06 19:15 +0200, Dario Binacchi spake thusly: > The previous default URL used for the PEN registry was not stable and > could change at any time, making it unacceptable to have to update its > hash every time. > > With this patch, ipmitool now uses by default a versioned PEN (Enterprise > Numbers) registry file from IANA provided by the iana-assignments package. > Alternatively, it also allows the use of a local file. URL paths for > downloading such a file are no longer supported. > > Co-Developed-by: Yann E. MORIN <yann.morin.1998@free.fr> > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> > Co-Developed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- [--SNIP--] > +choice > + prompt "PEN registry" > + default BR2_PACKAGE_IPMITOOL_USE_IANA_PEN > + > +config BR2_PACKAGE_IPMITOOL_USE_IANA_PEN > + bool "Using IANA PEN registry" > + select BR2_PACKAGE_IANA_ASSIGNMENTS > + select BR2_PACKAGE_IANA_ASSIGNMENTS_PEN_REG > + > +config BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN > + bool "Using a custom PEN registry file" This is supposed to be covered by the rootfs-overlay feature, in my opinion. So, I would really suggest we do like I explained in my previous review: if the PEN is installed by ieana-assginments, the ipmi-tools uses it. Otherwise, it is the responsibility of the user to provide one in the proper location. Which means the IANADIR must always be set, and a comment in the help text for ipmitool should explain where th euser can install their custom PEN in an overlay. [--SNIP--] > diff --git a/package/ipmitool/ipmitool.mk b/package/ipmitool/ipmitool.mk > index 4f2151904d43..f16500739ce6 100644 > --- a/package/ipmitool/ipmitool.mk > +++ b/package/ipmitool/ipmitool.mk > @@ -49,20 +49,20 @@ endef > IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_REMOVE_IPMIEVD > endif > > -IPMITOOL_PEN_REG_URI = $(call qstrip,$(BR2_PACKAGE_IPMITOOL_PEN_REG_URI)) > -ifneq ($(IPMITOOL_PEN_REG_URI),) > -ifneq ($(findstring ://,$(IPMITOOL_PEN_REG_URI)),) > -IPMITOOL_EXTRA_DOWNLOADS += $(IPMITOOL_PEN_REG_URI) > -BR_NO_CHECK_HASH_FOR += $(notdir $(IPMITOOL_PEN_REG_URI)) > -IPMITOOL_PEN_REG = $(IPMITOOL_DL_DIR)/$(notdir $(IPMITOOL_PEN_REG_URI)) > +ifeq ($(BR2_PACKAGE_IPMITOOL_USE_IANA_PEN),y) > +IPMITOOL_DEPENDENCIES += iana-assignments There is no need for a build-time dependency, as the file is only ever needed at runtime, is there? Regards, Yann E. MORIN. > +IPMITOOL_CONF_ENV += IANADIR=/usr/share/misc/iana > else > -IPMITOOL_PEN_REG = $(IPMITOOL_PEN_REG_URI) > +IPMITOOL_PEN_FILE = $(call qstrip,$(BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN_FILE)) > +ifneq ($(IPMITOOL_PEN_FILE),) > +ifneq ($(findstring ://,$(IPMITOOL_PEN_FILE)),) > +$(error "URL paths are no supported") > endif #findstring > -define IPMITOOL_INSTALL_PEN_REG > - $(INSTALL) -D -m 0644 $(IPMITOOL_PEN_REG) \ > +define IPMITOOL_INSTALL_PEN_FILE > + $(INSTALL) -D -m 0644 $(IPMITOOL_PEN_FILE) \ > $(TARGET_DIR)/usr/share/misc/enterprise-numbers > endef > -IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_INSTALL_PEN_REG > -endif # IPMITOOL_PEN_REG_URI !empty > - > +IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_INSTALL_PEN_FILE > +endif # IPMITOOL_PEN_REG_FILEI !empty > +endif # BR2_PACKAGE_IPMITOOL_USE_IANA_PEN > $(eval $(autotools-package)) > -- > 2.43.0 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot
Dario, All, On 2024-09-06 19:15 +0200, Dario Binacchi spake thusly: [--SNIP--] > diff --git a/package/ipmitool/Config.in b/package/ipmitool/Config.in > index 9516ff8596d3..c4b3ee734d44 100644 > --- a/package/ipmitool/Config.in > +++ b/package/ipmitool/Config.in > @@ -9,14 +9,34 @@ config BR2_PACKAGE_IPMITOOL > > if BR2_PACKAGE_IPMITOOL > > -config BR2_PACKAGE_IPMITOOL_PEN_REG_URI > - string "IANA PEN registry URL or path" > - default "https://www.iana.org/assignments/enterprise-numbers.txt" You forgot to add legacy handling for this variable: config BR2_PACKAGE_IPMITOOL_PEN_REG_URI string "IANA PEN registry move to iana-assignment package" help Installation of the IANA PEN is now handled by the iana-assignment package; to install a custom PEN, use a rootfs-overlay for example. config BR2_PACKAGE_IPMITOOL_PEN_REG_URI_WRAP bool default y if BR2_PACKAGE_IPMITOOL_PEN_REG_URI != "" select BR2_LEGACY Regards, Yann E. MORIN.
diff --git a/package/ipmitool/Config.in b/package/ipmitool/Config.in index 9516ff8596d3..c4b3ee734d44 100644 --- a/package/ipmitool/Config.in +++ b/package/ipmitool/Config.in @@ -9,14 +9,34 @@ config BR2_PACKAGE_IPMITOOL if BR2_PACKAGE_IPMITOOL -config BR2_PACKAGE_IPMITOOL_PEN_REG_URI - string "IANA PEN registry URL or path" - default "https://www.iana.org/assignments/enterprise-numbers.txt" +# +# PEN registry selection +# + +choice + prompt "PEN registry" + default BR2_PACKAGE_IPMITOOL_USE_IANA_PEN + +config BR2_PACKAGE_IPMITOOL_USE_IANA_PEN + bool "Using IANA PEN registry" + select BR2_PACKAGE_IANA_ASSIGNMENTS + select BR2_PACKAGE_IANA_ASSIGNMENTS_PEN_REG + +config BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN + bool "Using a custom PEN registry file" help - Enter an URL or a file path to the PEN registry to use. + Enter a file path to the PEN registry to use. + + Leave empty to not use a registry; vendor IDs will be + displayed instead of the corresponding names. - Note that the official registry is 4MiB+ and may change any - time and is thus not guaranteed to be reproducible. +endchoice + +config BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN_FILE + string "PEN registry file path" + depends on BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN + help + Path to the PEN registry file. Leave empty to not use a registry; vendor IDs will be displayed instead of the corresponding names. diff --git a/package/ipmitool/ipmitool.mk b/package/ipmitool/ipmitool.mk index 4f2151904d43..f16500739ce6 100644 --- a/package/ipmitool/ipmitool.mk +++ b/package/ipmitool/ipmitool.mk @@ -49,20 +49,20 @@ endef IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_REMOVE_IPMIEVD endif -IPMITOOL_PEN_REG_URI = $(call qstrip,$(BR2_PACKAGE_IPMITOOL_PEN_REG_URI)) -ifneq ($(IPMITOOL_PEN_REG_URI),) -ifneq ($(findstring ://,$(IPMITOOL_PEN_REG_URI)),) -IPMITOOL_EXTRA_DOWNLOADS += $(IPMITOOL_PEN_REG_URI) -BR_NO_CHECK_HASH_FOR += $(notdir $(IPMITOOL_PEN_REG_URI)) -IPMITOOL_PEN_REG = $(IPMITOOL_DL_DIR)/$(notdir $(IPMITOOL_PEN_REG_URI)) +ifeq ($(BR2_PACKAGE_IPMITOOL_USE_IANA_PEN),y) +IPMITOOL_DEPENDENCIES += iana-assignments +IPMITOOL_CONF_ENV += IANADIR=/usr/share/misc/iana else -IPMITOOL_PEN_REG = $(IPMITOOL_PEN_REG_URI) +IPMITOOL_PEN_FILE = $(call qstrip,$(BR2_PACKAGE_IPMITOOL_USE_CUSTOM_PEN_FILE)) +ifneq ($(IPMITOOL_PEN_FILE),) +ifneq ($(findstring ://,$(IPMITOOL_PEN_FILE)),) +$(error "URL paths are no supported") endif #findstring -define IPMITOOL_INSTALL_PEN_REG - $(INSTALL) -D -m 0644 $(IPMITOOL_PEN_REG) \ +define IPMITOOL_INSTALL_PEN_FILE + $(INSTALL) -D -m 0644 $(IPMITOOL_PEN_FILE) \ $(TARGET_DIR)/usr/share/misc/enterprise-numbers endef -IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_INSTALL_PEN_REG -endif # IPMITOOL_PEN_REG_URI !empty - +IPMITOOL_POST_INSTALL_TARGET_HOOKS += IPMITOOL_INSTALL_PEN_FILE +endif # IPMITOOL_PEN_REG_FILEI !empty +endif # BR2_PACKAGE_IPMITOOL_USE_IANA_PEN $(eval $(autotools-package))