summaryrefslogtreecommitdiff
path: root/scripts/build
AgeCommit message (Collapse)Author
2020-03-12grub-efi: fix image type check orderingLyndon Brown
this should take place before working on efi related stuff Gbp-Dch: Short
2020-03-12grub-efi: fix incorrect error handlingLyndon Brown
2020-03-11remove obsolete fdisk hackLyndon Brown
8321653cb36511324d576e65cb13b5c9b0c5f438 (from 2007) introduced a hack to work around bug #445304 in gnu-fdisk for users who may have replaced fdisk with the classic gnu version. the hack allowed users to select an alternate fdisk binary to use to work around the buggy binary. bug #445304 is marked as found in v1.0-1 and fixed in v1.2-1, though may have been fixe din v1.1. it was marked fixed in 2009. checking the package archive, gnu-fdisk does not actually exist anymore in debian, with one exception - it is available for arm64 on sid via debports, and that version is 1.3 so thus includes the necessary fix anyway. it is thus pointless now that we still carry this hack. Gbp-Dch: Short
2020-03-11amend copyright & licensing blocksLyndon Brown
Current versions of the project files are built upon versions published and licensed by Daniel Baumann, but are modified copies of those files and thus need to be marked as such per licensing requirements (afaik he did not pass along ownership / licensing rights to anyone when he left the project). We should also be careful to not be misrepresenting such modified copies as being attributed to Daniel. Adding a new copyright line referring to "The Debian Live team" should suffice for this. The authorship block in man pages has also similarly been updated. Notes: - tweaked a copy of daniel copyright lines stating 2014 instead of 2015. both of these cases were in files that i had personally introduced in some of my past merged commits that moved some code around. i don't know why they stated 2014. - binary_onie was introduced in 2018, so that has a 2018 date instead of 2016 unlike the rest. - 'efi-image' is a 3rd-party (Canonical Ltd) work that we bundle, but it has been modified by 674794a8f4d61a729d2dbd6d99385d2826138694 and 36a3ba76347ef72df1c316312ed3a26aa4b0c816 so I similarly added a debian live copyright line. - 'grub-cpmodules' is similar. it was only changed by the indentation fix of 36a3ba76347ef72df1c316312ed3a26aa4b0c816 but modification is modification, and this does help cover any possible future changes that might be made.
2020-03-11source: target downloads with corresponding versionjnqnfe
Prefer downloading the version of the source package that actually corresponds to the version of the binary. Should apt-update be run and a package updated, we do not really want to fetch a newer copy of the source than that of the binary, we want the exact corresponding version (kinda the whole point of compiling a source disc that they correspond). If the exact version is no longer available then it is surely preferable to list it in the missing list than end up with a newer version. Gbp-Dch: Short Closes: #952932
2020-03-10source: fix apt warningsLyndon Brown
the source stage emitted the following output for each packages downloaded. note the troubling warning at the end. ``` Reading package lists... Done NOTICE: 'grep' packaging is maintained in the 'Git' version control system at: https://salsa.debian.org/debian/grep.git Please use: git clone https://salsa.debian.org/debian/grep.git to retrieve the latest (possibly unreleased) updates to the package. Need to get 1579 kB of source archives. Get:1 http://deb.debian.org/debian buster/main grep 3.3-1 (dsc) [2038 B] Get:2 http://deb.debian.org/debian buster/main grep 3.3-1 (tar) [1473 kB] Get:3 http://deb.debian.org/debian buster/main grep 3.3-1 (diff) [104 kB] Fetched 1579 kB in 1s (1293 kB/s) Download complete and in download only mode W: Download is performed unsandboxed as root as file 'grep_3.3-1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) ``` this occurred because the '_apt' user did not have permission to write to the destination directory and so was falling back to downloading as root in order to do its work. prior to 158950b873bcfbac2d6bd59fd82a15b9fb4476b8 all source packages were downloaded directly to the root of the chroot. that commit changed this to save them into a new clean directory within it instead. thus to fix the problem we can simply set the ownership of this new directory to '_apt'. Gbp-Dch: Short
2020-03-10debootstrap: remove redundant checkLyndon Brown
the check for existence of debootstrap here was completely redundant since there is a check at the beginning of the file which already outputs an appropriate error and exists if missing.
2020-03-10archives: fix typoLyndon Brown
introduced in ee2bbe45782f52d115115b8cf6198afaeb03be9e Gbp-Dch: Ignore
2020-03-10config: improve documentationLyndon Brown
2020-03-10chroot: clarify stagesLyndon Brown
the cache restore/save script is not a chroot modification script unlike the rest of the scripts that it was bunched up with. It is an actual component part of the chroot build stage. let's bring clarity to this with improved documentation. Gbp-Dch: Short
2020-03-10archives: always include enabled/disabled deb-src apt entriesLyndon Brown
LB_APT_SOURCE_ARCHIVES determines whether or not deb-src entries are desired to be included in apt's sources.list. here, instead of excuding them we always include them but commented out where they would previously have been excluded. this means that if a user later changes their mind and wants to make use of them all they have to do is uncomment them rather than add the necessary lines. Gbp-Dch: Short Closes: #952929
2020-03-10archives: simplificationLyndon Brown
as suggested by Raphaƫl Gbp-Dch: Short
2020-03-10arguments: fix unreachable and poor argument error handlingLyndon Brown
all scripts use `set -e` which means that if getop fails, the subsequent error check that would print an error in addition to any printed by getopt itself would never actually be reached. the first though here would be to remove the pointless error check, but getopt does not include the word "error" with an unrecognised option failure, nor does it use colour to highlight problems, both of which mean that it is a little lacking in terms of highlighting problems to users. thus we properly capture and use the exit code here and output an appropriate message per invalid argument vs getopt internal error. also, removed the redundant stderr redirection which is already done by Echo_error(). Gbp-Dch: Short
2020-03-10help/usage: remove pointless varsLyndon Brown
build scripts never call Help() and so the empty HELP strings are pointless. (when called with --help they call Man()). Closes: #952859 Gbp-Dch: Short
2020-03-10source: downloaded pkgs to a clean directory rather than chroot rootjnqnfe
Closes: #952931
2020-03-10source: minor tweaksjnqnfe
Gbp-Dch: Ignore
2020-03-10chroot: improve directory creation/destruction efficiencyjnqnfe
Closes: #952924
2020-03-10config: rename the config set/check functions for clarityjnqnfe
Gbp-Dch: Short Closes: #952920
2020-03-10tidy script init (4/4) - top level cmd "auto redirect" handlingLyndon Brown
Partial fix for #952919 Gbp-Dch: Short Closes: #952919
2020-03-10tidy script init (3/4) - top level commandsjnqnfe
Partialfix for #952919 Gbp-Dch: Short
2020-03-10tidy script init (2/4) - build stage scriptsjnqnfe
Partial fix for #952919 Gbp-Dch: Short
2020-03-10tidy script init (1/4) - arg and config processingjnqnfe
Partial fix for #952919 Gbp-Dch: Short
2020-03-10simplify STAGE checks - use In_Listjnqnfe
Closes: #952917
2020-03-09use actual boolean state for some simple varsLyndon Brown
Gbp-Dch: Ignore
2020-03-09installer: use boolean for clarityLyndon Brown
Closes: #952930
2020-03-09fix consistency in binary execution and existance checkingLyndon Brown
- prefer using `which` over hard coded paths - it is redundant to check that the bin pointed to the return of `which` exists and is executable, `which` already gives us assurance of that if it returns true! - the redirection of output (`2>/dev/null`) seems to be unnecessary from my testing. the instances relatnig to fdisk and losetup in functions/defaults.sh have been left as they are since they get executed by `lb config` which can run without sudo elevation unlike `lb build` and in that case `which` would fail to find these binaries resulting in error. this also fixes a bug showing an error for missing debootstrap - this tool requires sudo privileges to run and thus is not found via a none elevated which search. Gbp-Dch: Short Closes: #952927
2020-03-09fix inadequate chroot_archives validationLyndon Brown
commit d74f2102a0849838eb4e15950b01d49f9f79392f added a validation check to chroot_archives for its 'pass' parameter. this was based upon finding an instance where the wrong value was being submitted to the script and wanting to ensure such mistakes would be caught. unfortunately it seems that I made a mistake in misremembering the facts surrounding the latter issue when constructing the validation check and failed to double check with testing until it was already merged. a correction is needed. the set of valid values is not limited to only 'source|binary' but actually 'source|binary|chroot'. I'd misremembered 'chroot' as being a completely invalid value.
2020-03-05source: add output of config readme file to source imagejnqnfe
To provide an explanation Gbp-Dch: Short Closes: #952921
2020-03-05firmware: enable caching for archive content file with firmware listsLyndon Brown
the existing logic for obtaining a list of firmware packages always downloaded a fresh copy of the archive content file, deleting the file already in the cache. here we move to actually making use of the cache. this helps when building multiple times, at least for the same distro. the package list obtained is rarely going to change after all. it could of course differ between distros, but the cache is per-distro, as it has always been. we of course here switch to caching each of the archive-area files individually rather than having one file that gets overwritten (or appended to in the case of when we kept the decompressed file). Gbp-Dch: Short Closes: #952911
2020-03-05firmware: avoid potentially duplicate workLyndon Brown
addressing an old fixme, should distro and parent-distro be identical (in a derivative build) we want to avoid wasting effort downloading and processing the same content files twice. since parent and non-parent have separate archive-area lists though we should perhaps not just assume that they are identical or ignore any differences; thus here in such a situation we ensure that we handle any archive areas not already done for parent-distro handling in such a case, while skipping those already done. i notice that the fixme actually also refers to avoiding actual overlapping of the cached files, however the cached files are (currently) always ignored anyway, so this is of no concern. reusing the cached files is an entirely separate issue. Gbp-Dch: Short Closes: #952909
2020-03-05firmware: reorder firmware list constructionLyndon Brown
the 'manually add firmware-linux package' bit was stuck inbetween the parent and non-parent logic, which was especially unhelpful before we de-duplicated the logic into a common function. Gbp-Dch: Short
2020-03-05firmware: de-dup firmware list parsingLyndon Brown
Edit: There were four copies of the same logic to keep in sync; Originally this patch deduplicated each file, but leaving a copy of the new function in each, thus reducing the duplication but not eliminating it. A later patch moved it into a shared function file following further enhancements to the code in question. This has since been revised to have the function moved to a shared file here, which simplifies and gives a cleaner diff. Gbp-Dch: Short Closes: #952908
2020-03-05firmware: delete pointlessly cached (large) file after useLyndon Brown
the archive content file downloaded to obtain a list of firmware packages is always deleted and downloaded afresh currently. it may not be ideal that we do not make use of the cache here, however while that remains unaddressed, we might as well delete the file after we've used it in order to not pointlessly waste disk space. note that this file is ~613 MB for sid-amd64 currently. Gbp-Dch: Short Closes: #952907
2020-03-05firmware: fix possible duplication in firmware package lists (inefficiency)Lyndon Brown
where multiple archive areas are used, the code here on each loop is: 1) fetching the archive area contents file (compressed) 2) **appending** the output to that of the previous loop 3) searching the file for firmware references, adding to the list since it appends rather than replaces, entries found in each loop get re-added on each subsequent loop, resulting in duplication in the resulting list below I evaluate the possible solutions to explain why I chose the one I chose, however the reader should not waste too much time worrying about whether one of the other solution would have actually been better because things are changed significantly in further commits shortly! possible solutions: a) switching to output (>) rather than append (>>), but this might fail against an existing file b) removing the file on each loop, but this will complicate any future caching improvements that might be made here (currently the files are always deleted and thus downloaded fresh) c) allow the appending, evaluating the complete file after the loop solution C warrants consideration of disk space consumption; currently the compressed 'main' archive (for sid on amd64) expands to 592.3 MB (feb-2020), 'contrib' is 3.1 MB, and 'non-free' is 18.5 MB. solution C was chosen here; the difference of accumulated file size vs. max-single was minor enough to not be of particular concern (~613 vs. ~592 MB). Gbp-Dch: Short Closes: #952906
2020-03-05firmware: construct file location once and reuseLyndon Brown
2020-03-05firmware: avoid building unnecessary listsLyndon Brown
2020-03-05cache: clarify and simplify package cache save/restorejnqnfe
These functions are specific to handling packages stored in the cache, not other files. They are also always used with the same `cache/packages.` prefix to the path. Gbp-Dch: Short Closes: #952916
2020-03-05installer: download udebs directly from correct mirrorLyndon Brown
instead of trying all from derived mirror then falling back to parent upon failure, which as pointed out by a message printed out can result in a load of spurious 404 errors; actually get each udeb from the mirror it is supposed to be retrieved from. Partial fix for #952914, this is the last commit for it so closes it Gbp-Dch: Short Closes: #952914
2020-03-05installer: filter derived udebs from parent listLyndon Brown
the existing logic just bundled the entire parent and derived udeb lists together, ignoring the fact that there might thus be two instances of some packages, and relying upon getting derived ones first and checking file existence to avoid handling the overridden parent instances. here we now actually filter the list of parent udebs to exclude packages that are to be obtained from the derivative. this enables avoiding the file existence checking Partial fix for #952914 Gbp-Dch: Short
2020-03-05installer: robustify udeb inclusionLyndon Brown
move the code that checks whether a version of a given package has already been obtained (to account for parent and derived both listing the same package) to guard the copy from cache action also, not just the download action. in rare but possible scenarios it would have been possible to end up with both the parent and derived copies of a package included. Partial fix for #952914 Gbp-Dch: Short
2020-03-05installer: improve documentation a littleLyndon Brown
Gbp-Dch: Ignore
2020-03-05archives: deduplicate apt sourcelist file constructionjnqnfe
Geez :O Gbp-Dch: Short Closes: #952889
2020-03-05binary_onie: fix lack of newline on errorLyndon Brown
this script outputs a series of progressive dots as progress is made, finally terminated with ' done.'. however if an error occurs then the error would end up being printed directly on the end of this instead of on a new line since newlines are not printed after each dot. this fixes this oversight. Gbp-Dch: Short Closes: #952883
2020-03-05binarie_onie: fix missing use of echo helpersLyndon Brown
the '.' progress stuff has been left as is. perhaps that should be removed since its use is inconsistent compared to other scripts? Gbp-Dch: Short Closes: #952882
2020-03-05binary_iso: fix wrong echo helperLyndon Brown
Closes: #952881
2020-03-05fix missing use of echo helpersjnqnfe
Closes: #952876
2020-03-05help/usage: fix overly complex script description handlingjnqnfe
Closes: #952887
2020-03-05binary_disk: refactorjnqnfe
Avoid all of the duplication for each installer case Note, what is done for the netboot case (which was previously missing) still needs addressing Gbp-Dch: Short Closes: #952865
2020-03-05config: rename --architectures to --architectureLyndon Brown
this has only ever supported specifying a single arch, thus was confusing being plural Gbp-Dch: Short Closes: #952892
2020-03-05chroot: fix redundant usage linejnqnfe
Closes: #952885