Commit Graph

78 Commits

Author SHA1 Message Date
Paul Spooren
941ec28b35 imagebuilder: Remove json_info_files/ before build
The folder `json_info_files` contains multiple JSON files which describe
created firmware images. The folder is not removed between builds as the
ImageBuilder does not use `image.mk`.

Not removing the JSON files result in a merged `profiles.json` file
containing entries for outdated or non-existing images.

This commit adds the `json_info_files/` cleanup step to the ImageBuilder
Makefile.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-06-11 11:12:56 +01:00
Paul Spooren
4f38063640 imagebuilder: pass IB=1 on checking requirements
The patch 4a1a58a3  build, imagebuilder: Do not require libncurses-dev
was supposed to remove libncurses as a requirement for the ImageBuilder.
However as the IB=1 is only exported during building, not for checking
requirements, it did never actually work.

This commit export IB=1 to the requirement check.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-06-11 10:49:18 +01:00
Paul Spooren
07449f692c build: refactor JSON info files to profiles.json
JSON info files contain machine readable information of built profiles
and resulting images. These files were added in commit 881ed09ee6
("build: create JSON files containing image info").

They are useful for firmware wizards and script checking for
reproducibility.

Currently all JSON files are stored next to the built images, resulting
in up to 168 individual files for the ath79/generic target.

This patch refactors the JSON creation to store individual per image
(not per profile) files in $(BUILD_DIR)/json_info_files and create an
single overview file called `profiles.json` in the target directory.

Storing per image files and not per profile solves the problem of
parallel file writes. If a profiles sysupgrade and factory image are
finished at the same time both processes would write to the same JSON
file, resulting in randomly broken outputs.

Some target like x86/64 do not use the image code yet, resulting in
missing JSON files. If no JSON info files were created, no
`profiles.json` files is created as it would be empty anyway.

As before, this creation is enabled by default only if `BUILDBOT` is set.

Tested via buildroot & ImageBuilder on ath79/generic, imx6 and x86/64.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[json_info_files dir handling in Make, if case refactoring]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-04-03 12:17:45 +02:00
Paul Spooren
07926d7def imagebuilder: fix make info for empty SUPPORTED_DEVICES
For x86/64 (maybe more) target the SUPPORTED_DEVICES variable is empty
which causes the `&&` junction to fail, producing a non zero exit code.

Tested-by: Paul Spooren <mail@aparcar.org>
Fixed-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-08-14 08:14:52 +02:00
Richard Musil
71ab2c9d17 imagebuilder: new DISABLED_SERVICES make variable
Adds a new variable DISABLED_SERVICES to ImageBuilder Makefile, which
defines a list of services (installed as /etc/init.d/*) to be disabled
during the build of a custom image (normally all are enabled).

It comes handy when a particular service should not be run under normal
circumstances, but should be ready in the image for situations when it
might be needed.

Signed-off-by: Richard Musil <risa2000x@gmail.com>
2019-05-15 13:34:24 +02:00
Daniel Golle
d6fa04a437 IB: include SUPPORTED_DEVICES in 'make info' output
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-11 05:32:29 +01:00
Paul Spooren
483498808e ib: show current revision based on $(REVISION)
This is useful in for the attendedsyupsgrade server (asu) to
distinguish between snapshot version. Currently asu can't tell devices
requesting a snapshot build if the same build is already installed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-03-08 01:18:12 +01:00
Paul Spooren
f37afec866 ib: show unified target based on $(TARGETID)
Instead of showing a slightly more readable target like
"ar71xx (Generic)" print the more generic format "ar71xx/genric"

Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-03-08 01:18:12 +01:00
Daniel Golle
13c379e5c6 ib: display whether profile comes with image metadata
Having image metadata (and signature) appended is a condition for
semi-automated sysupgrade, hence IB needs to be able to tell which
images will end up with metadata.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-06 14:50:42 +01:00
Paul Spooren
ad5c2897ec imagebuilder: manifest function show stderr
This really simplifies debugging, if a package is not found or a feed is
not reachable, a proper stderr is printed. Currently it would only say
`_call_manifest` failed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2018-08-06 06:54:42 +02:00
Paul Spooren
869b0d11db 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>
2018-07-30 15:55:21 +02:00
Matthias Schiffer
2fbf669730
imagebuilder: reuse rootfs preparation from rootfs.mk
In addition to removing redundant code, this fixes various issues in
IB-generated images that have been fixed in prepare_rootfs before,
including better handling of CONFIG_CLEAN_IPKG and enabling of initscripts
from FILES.

We also reuse the opkg macro and remove --force-... flags that have been
removed from rootfs.mk as well.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2018-03-07 09:59:08 +01:00
Zoltan HERPAI
d2c06eb075 merge: etc: update remaining files
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2017-12-08 19:41:18 +01:00
Daniel Golle
d80d1b6c42 imagebuilder: don't rewrite package list output
No longer rewrite opkg list output in package_list function, remove
the awk call in the pipe (which was intended for a single specific
use-case).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-06-17 01:24:43 +02:00
Daniel Golle
1b555e1d2b imagebuilder: clean package_list
commit 19ac879954 (imagebuilder: add package_list function) introduced
a new function 'package_list' to the imagebuilder Makefile.
Unfortunately the package list was poluted by stdout noise of the
Makefile itself as well as opkg. Redirect those outputs to stderr to
make sure that the package_list returned doesn't contain progress
info output but really only packages.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-06-17 00:54:46 +02:00
Paul Spooren
19ac879954 imagebuilder: add package_list function
The imagebuilder can now list all available packages by using make
package_list. This is usefull for scripts to retrieve a list of all
packages with versions (and size)

Signed-off-by: Paul Spooren <paul@spooren.de>
[daniel@makrotopia.org: fixed commit message]
2017-06-15 00:36:08 +02:00
Felix Fietkau
9467ce42da build: get rid of host.mk
Defined required host related variables in toplevel.mk instead

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-02-26 13:31:44 +01:00
Jo-Philipp Wich
0d1765b4ba imagebuilder: make submake invocations less verbose
Use silent make invocations for sub-makes like build_image or checksum to
avoid bloating the IB output with non-status info.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-02-02 00:13:49 +01:00
Jo-Philipp Wich
6cb8e30837 imagebuilder: properly escape single quotes in device titles
The name "Plat'Home OpenBlocks AX3" causes the imagebuilders "make info"
command to fail with:

    bash: -c: line 0: syntax error near unexpected token `('
    bash: -c: line 0: `echo;  [...]'
    Makefile:99: recipe for target '_call_info' failed

Properly escape single quotes to avoid breaking the echo commands.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-26 10:16:32 +01:00
Jo-Philipp Wich
27854a0a84 build: add checksum target
Add a new "checksum" make target which generates an sha256sums file over the
image files produced in bin/targets/ and automatically call it during make
world after the package index generation.

The advantage of this new target is that it is guaranteed to run after the
images, the SDK and the ImageBuilder archives have been generated to ensure
that they all end up in the checksum file. Fixes FS#51.

Uses sed to postprocess the OpenSSL digest output into an sha256sum command
compatible format.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-08-01 18:11:21 +02:00
Felix Fietkau
37e82e4e42 build: remove obsolete variables from opkg command
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
8265fdcc4d imagebuilder: strip DEVICE_ prefix from profiles (FS#55)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-21 13:41:20 +02:00
Felix Fietkau
9ae952cf8c build: split scripts/metadata.pl into target-metadata.pl and package-metadata.pl
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 08:58:40 +02:00
Daniel Dickinson
9fd8e55132 imagebuilder: Fix sorting package list breaks opkg dependency handling for provides
When imagebuild sorts package lists it breaks opkg's ability to realize
that a providers for a Provides has already been installed, when the sort
results in the provider being later in the list of packages that a package
which depends on a Provides (and hence the provider is not yet installed
for opkg to realize the provider was available doesn't not handle the case
of a package that is to be installed satisfying a dependency, only one that
is already installed (or which it schedules to be installed, which in the
absence of an installed provider is whichever provider happens to be the
default)

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2016-05-18 23:53:01 +02:00
Felix Fietkau
80f4988da3 target/imagebuilder: fix using new device profiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-05-13 16:32:36 +02:00
Alexander Couzens
009a069ec0 imagebuilder: rename OpenWrt into LEDE
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-05-05 19:07:28 +01:00
Felix Fietkau
0a0bfc8507 images imagebuilder: Allow to add sanitized extra name
For final output image names allow user to add an
extra string (which is sanitized).  This is particularly
useful with ImageBuilder where you may generate multiple
images from the same base and for the same board,
with different package selections and additional files
(via FILES=).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>

SVN-Revision: 48083
2016-01-03 14:44:56 +00:00
Jo-Philipp Wich
fb3fb9b6c1 imagebuilder: store package lists in cache directory
Force opkg to store the downloaded repository indizes into the cache
directory as well, this way the IB can be used in an offline setting
once all required files have been cached.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 46912
2015-09-14 16:57:03 +00:00
Felix Fietkau
add0c00c96 imagebuilder: run build prereq checks before building image to set up host commands properly
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 46840
2015-09-10 11:06:42 +00:00
John Crispin
096b3759a9 build: Prevent more gzip timestamps
To improve reproducibility, prevent the inclusion of timestamps
in the gzip header.

Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>

SVN-Revision: 46361
2015-07-14 09:57:45 +00:00
Jo-Philipp Wich
11f05afd26 imagebuilder: create cache directory if needed (#18629)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 45866
2015-06-01 06:15:39 +00:00
Jo-Philipp Wich
6c21bcaa65 IB: use online repositories
Change the IB packaging to only embed libc, kernel and kmod packages by default
and generate repositories.conf to refer to the remote package repositories.

Introduce a new config option CONFIG_IB_STANDALONE which restores the old
behaviour of building self contained IB archives.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 45772
2015-05-27 11:22:20 +00:00
Jo-Philipp Wich
dffaf94d44 imagebuilder: fail with error if the passed profile name does not exist
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 43916
2015-01-10 18:19:59 +00:00
John Crispin
44249f71a8 postinst trigger: the new postinst trigger broke IB
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42571
2014-09-16 11:56:19 +00:00
Felix Fietkau
7632358add imagebuilder: remove postinst files before generating image
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42339
2014-08-31 11:06:31 +00:00
Jo-Philipp Wich
a720dd209f build: introduce per feed repository support
This changeset implements a new menuconfig option to generate separate
repositories for each enabled package feed instead of one monolithic one.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 42002
2014-08-05 11:24:24 +00:00
Jo-Philipp Wich
476ea2bcb4 imagebuilder: use file_copy to deploy files/ in the image generation phase
SVN-Revision: 34439
2012-12-02 12:20:43 +00:00
Jo-Philipp Wich
b73f22de1e imagebuilder: merge r25078 to align files/ handling with current buildroot
SVN-Revision: 34301
2012-11-22 19:46:54 +00:00
Felix Fietkau
7cb42738e6 package/index: filter out the libc package from the index
SVN-Revision: 32187
2012-06-11 01:29:11 +00:00
Felix Fietkau
fab5ee9566 imagebuilder: explicitly install the kernel .ipk before installing anything else, it is no longer part of the package index (fixes #11450)
SVN-Revision: 31711
2012-05-14 14:00:01 +00:00
Felix Fietkau
34ffb526a2 build: rework verbosity level selection
V=99 and V=1 are now deprecated in favor of a new verbosity class system,
though the old flags are still supported.
You can set the V variable on the command line (or OPENWRT_VERBOSE in the
environment) to one or more of the following characters:

- s: stdout+stderr (equal to the old V=99)
- c: commands (for build systems that suppress commands by default, e.g. kbuild)
- w: warnings/errors only (equal to the old V=1)

SVN-Revision: 31484
2012-04-26 17:53:56 +00:00
Jo-Philipp Wich
3cb72f38fd populate repositories.conf from version.mk
SVN-Revision: 31268
2012-04-12 23:08:13 +00:00
Gabor Juhos
faf17f197f ImageBuilder: respect the PROFILE parameter
Based on a patch from #10766

SVN-Revision: 29877
2012-01-24 09:47:20 +00:00
Jo-Philipp Wich
1e24383ae6 Various enhancements from Manuel Munz <freifunk@somakoma.de> - don't regenerate Package index unless the packagedir changes - remove opkg lists from rootfs, saves > 1MB uncompressed - don't direct errors on index creation into packagelist
SVN-Revision: 28205
2011-09-09 17:25:20 +00:00
Felix Fietkau
e5e17a1ce8 imagebuilder: clean opkg files if requested (patch from #9866)
SVN-Revision: 27872
2011-08-01 23:58:11 +00:00
Jo-Philipp Wich
c5a65a0373 Send ipkg-make-index.sh output to stdout
The "Generating index for package" created by ipkg-make-index only
clutter stderr and serve to push previous warnings/errors off-screen.
Instead, send to stdout.

Note:  This would send incorrect invocation messages to stdout as well.
If this is a concern, perhaps we could send them to FD 3, then send 3 to
2...

Signed-off-by: Kevin Locke <klocke@digitalenginesoftware.com>

SVN-Revision: 25678
2011-02-23 22:59:57 +00:00
Jo-Philipp Wich
d45c310c34 allow overriding BIN_DIR (#7412)
SVN-Revision: 23643
2010-10-26 14:15:52 +00:00
Jo-Philipp Wich
ea5904ff93 - sync with host opkg changes - get rid of autogenerated opkg.conf - utilize dl/ as package cache, useful for remote downloads
SVN-Revision: 23039
2010-09-12 22:04:09 +00:00
Jo-Philipp Wich
ee81bb7cdb fix a small typo in sed pattern
SVN-Revision: 22997
2010-09-10 15:40:42 +00:00
Jo-Philipp Wich
7a2ce99fe5 fix arch detection pattern to cope with underscores in board name, e.g. "adm5120_mips"
SVN-Revision: 22980
2010-09-08 05:46:37 +00:00