mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
imagebuilder: add function to show manifest
Tested with 18.06.0-rc2/ar71xx/generic/tl-wdr4300-v1, image & list
This PR is based on the work of @fewckert[1] with slight improvements.
Add function `manifest` to show the manifest of the produced image,
before actually building it. The manifest contains an orderd list of
package name and version.
This is usefull to check package dependencies but also determine a
unique and reproducible image name before building the package. The
sysupgrade server[2] builds images on request with individual package
selection. To distignish between created images which contain differnt
packages, the EXTRA_IMAGE_NAME is set to a shortend hash of the
manifest's content. So far the image was renamed afterwards as the
manifests content was unknown, however this corrupts the signed
sha256sums. This patch allows a clean solution as to dtermine the
manifest in advance and set the EXTRA_IMAGE_NAME accordingly.
[1]: https://github.com/lede-project/source/pull/1591
[2]: https://github.com/aparcar/attendedsysupgrade-server
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry-picked from commit 869b0d11db
)
This commit is contained in:
parent
a3dd6c939d
commit
f4798d37f1
@ -45,6 +45,14 @@ Building images:
|
|||||||
make image FILES="<path>" # include extra files from <path>
|
make image FILES="<path>" # include extra files from <path>
|
||||||
make image BIN_DIR="<path>" # alternative output directory for the images
|
make image BIN_DIR="<path>" # alternative output directory for the images
|
||||||
make image EXTRA_IMAGE_NAME="<string>" # Add this to the output image filename (sanitized)
|
make image EXTRA_IMAGE_NAME="<string>" # Add this to the output image filename (sanitized)
|
||||||
|
|
||||||
|
Print manifest:
|
||||||
|
List "all" packages which get installed into the image.
|
||||||
|
You can use the following parameters:
|
||||||
|
|
||||||
|
make manifest PROFILE="<profilename>" # override the default target profile
|
||||||
|
make manifest PACKAGES="<pkg1> [<pkg2> [<pkg3> ...]]" # include extra packages
|
||||||
|
|
||||||
endef
|
endef
|
||||||
$(eval $(call shexport,Helptext))
|
$(eval $(call shexport,Helptext))
|
||||||
|
|
||||||
@ -108,6 +116,13 @@ _call_image: staging_dir/host/.prereq-build
|
|||||||
$(MAKE) -s build_image
|
$(MAKE) -s build_image
|
||||||
$(MAKE) -s checksum
|
$(MAKE) -s checksum
|
||||||
|
|
||||||
|
_call_manifest: FORCE
|
||||||
|
rm -rf $(TARGET_DIR)
|
||||||
|
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
|
||||||
|
$(MAKE) package_reload >/dev/null 2>/dev/null
|
||||||
|
$(MAKE) package_install >/dev/null 2>/dev/null
|
||||||
|
$(OPKG) list-installed
|
||||||
|
|
||||||
package_index: FORCE
|
package_index: FORCE
|
||||||
@echo >&2
|
@echo >&2
|
||||||
@echo Building package index... >&2
|
@echo Building package index... >&2
|
||||||
@ -164,7 +179,7 @@ info:
|
|||||||
|
|
||||||
PROFILE_FILTER = $(filter DEVICE_$(PROFILE) $(PROFILE),$(PROFILE_NAMES))
|
PROFILE_FILTER = $(filter DEVICE_$(PROFILE) $(PROFILE),$(PROFILE_NAMES))
|
||||||
|
|
||||||
image:
|
_check_profile: FORCE
|
||||||
ifneq ($(PROFILE),)
|
ifneq ($(PROFILE),)
|
||||||
ifeq ($(PROFILE_FILTER),)
|
ifeq ($(PROFILE_FILTER),)
|
||||||
@echo 'Profile "$(PROFILE)" does not exist!'
|
@echo 'Profile "$(PROFILE)" does not exist!'
|
||||||
@ -172,6 +187,9 @@ ifneq ($(PROFILE),)
|
|||||||
@exit 1
|
@exit 1
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
image:
|
||||||
|
$(MAKE) -s _check_profile
|
||||||
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
|
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
|
||||||
$(MAKE) -s _call_image \
|
$(MAKE) -s _call_image \
|
||||||
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
|
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
|
||||||
@ -179,4 +197,11 @@ endif
|
|||||||
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
|
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
|
||||||
$(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)"))
|
$(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)"))
|
||||||
|
|
||||||
.SILENT: help info image
|
manifest: FORCE
|
||||||
|
$(MAKE) -s _check_profile
|
||||||
|
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
|
||||||
|
$(MAKE) -s _call_manifest \
|
||||||
|
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
|
||||||
|
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)"))
|
||||||
|
|
||||||
|
.SILENT: help info image manifest
|
||||||
|
Loading…
Reference in New Issue
Block a user