summaryrefslogtreecommitdiff
path: root/scripts/build
AgeCommit message (Collapse)Author
2020-05-02caching: output error on invalid action paramLyndon Brown
for bootstrap, the check is moved to the case statement for greater robustness, and for consistency with other scripts. Gbp-Dch: Ignore
2020-05-02output error for incorrect action in chroot prep scriptsLyndon Brown
...alongside printing usage (which is perhaps unnecessary), so that it is actually clear to users that a problem occurred, and what. and capture it before option processing of remaining args. Gbp-Dch: Ignore
2020-05-02tidy up Echo_breakage()Lyndon Brown
- it's only used by the debootstrap script after alternatives were dropped long ago, so let's move it, avoiding it being loaded for everything else. - there's no need to pass printing another message through it. - there's little point in making the sid distinction if you happen to decide to build sid, it's a given that it's less stable than stable. really, is there any need for this at all? Gbp-Dch: Ignore
2020-05-02debootstrap: remove useless obtaining debootstrap verbose help stringsLyndon Brown
Gbp-Dch: Ignore
2020-05-02move and rename Common_config_files()Lyndon Brown
for better encapsulation, and for consistency with other config file handling functions in the new location. Gbp-Dch: Ignore
2020-05-01grub2: fix duplicate live entriesLyndon Brown
in tweaking a previous commit to remove some excessive change before submission, i mistakenly identified the part of the sed replacement restored here as being unnecessary to its functionality, but in fact it is. without it the placeholder is not actually removed. the lack of removal of the placeholder meant that you ended up with duplicate copies of the live menu entries. Gbp-Dch: Ignore
2020-05-01bootloaders: change 'Advanced options' to 'Utilities'Lyndon Brown
more fitting now that we've moved the advanced installer entries out to a different submenu, leaving just memtest (and HDT on syslinux). the advanced.cfg file is also renamed to utilities.cfg in the syslinux case, but in a backwards compatible way of moving the user advanced.cfg file over the new one, if the user provides a file with the old name. alternatively we could just leave the old name in place, but that would be a little odd. Gbp-Dch: Short
2020-05-01Replace 'which' with 'command -v' to test for the existance of an executablejohnraff
This is considered to be more robust. Two instances remain: scripts/build/chroot_archives, line 257: if [ "${LB_APT}" = "aptitude" ] && [ ! $(Chroot chroot "which aptitude") ] The command is run inside a chroot where the environment might be special, and would need further testing. manpages/Makefile, line 42: @if [ ! -x "$$(which po4a 2>/dev/null)" ]; \ I am insufficiently familiar with makefile syntax to edit this.
2020-05-01grub2|loopback: avoid perl for live entry creation, use temp fileLyndon Brown
instead of cramming the live entries into a string via a layer of functions for terminating entries with newlines, which we then have to run through perl to tweak the newlines for correct use with sed... let's write the entries to a temp file, then use that file in the sed replacement. the helper functions injecting newlines to the end of entries as they were built into a long string have obviously become unnecessary and so were removed. one function was renamed for reasons of consistency and clarity. the file is initially deleted before use for reasons of wanting to bullet proof the codebase to work properly under conditions of recovering from failure/cancellation, `--force` re-running and such. this removes the last use of perl. Gbp-Dch: Short
2020-04-30config: optimise --ignore-system-defaultsLyndon Brown
Gbp-Dch: Ignore
2020-04-30workaround checkbashisms mistakeLyndon Brown
it reported: "possible bashism in scripts/build/binary_loopback_cfg line 284 (should be '.', not 'source')" which is clearly a misidentification. Gbp-Dch: Ignore
2020-04-30syslinux: fix errors re-running under `--force`Lyndon Brown
robustification is required to not just `--force` but recovery from failure or user cancellation. Gbp-Dch: Short
2020-04-30grub2: fix lost pre-prepared files detailLyndon Brown
partly lost in some adjustments that were made to the submitted work, which was focused on restoring the 'start installer' entry. there is no need for dynamic setting of these two `source` imports in the default file, in fact user modifications should also use the fixed import commands in future. note that the old placeholders however remain replaced, which inject precisely this string, for backwards compatibility. Gbp-Dch: Ignore
2020-04-30bootstrap_cache: fix failure conditionLyndon Brown
during testing i encountered an unexpected error resulting from the following condition: - bootstrap was cached - cache of bootstrap packages was empty (from playing with `lb clean`) - installer was not none|live everything works fine up until the main installer script, which comes to an abrupt halt with an error due to the missing cached bootstrap packages that it wants to copy. this situation is easy to unintentionally create, as i managed to do. here we catch the failure condition, correcting for it. this is done by checking for the missing cached packages when restoring the bootstrap from the cache, and skipping this if the packages were missing, thus forcing the bootstrap to be rebuilt. the packages should then be found within the cache, allowing the installer stage to complete successfully. of course the bootstrap stage will only cache the packages if caching is enabled, but if caching is disabled and installer enabled, the config validation will catch that, reporting that problem. Gbp-Dch: Short
2020-04-29loopback: tidy formattingLyndon Brown
Gbp-Dch: Ignore
2020-04-29selinux: fix output consistencyLyndon Brown
install mode was silent when selinux was not enabled, whilst remove mode always output a "Begin unmounting..." message. this makes both modes silent when selinux is not enabled. this also happens to fix an unintended side effect of d79c96232b40fb082233c97ac8d4f75b821ecefe whereby a warning subsequently was always emitted in remove mode when selinux was not in use, which was not ideal. Gbp-Dch: Short
2020-04-29a couple tiny doc fixesLyndon Brown
Gbp-Dch: Ignore
2020-04-28fix auto file handling regressionLyndon Brown
b4598b234c90b6d1c93bd64166d4aa46ce9388bb mistakenly stopped passing along options to auto files. Gbp-Dch: Ignore
2020-04-25Do not overwrite splash.png if the user has provided itRaphaël Hertzog
The unconditional SVG to PNG conversion could overwrite a splash.png provided by the user. Ensure we don't overwrite such a file. But we still remove the SVG file as syslinux is not able to make use of it.
2020-04-25Make librsvg2-bin dependency unconditional for syslinuxRaphaël Hertzog
We do provide a splash.svg by default so the check will always return true unless the user has forked live-build... thus the check is pointless.
2020-04-24syslinux: deduplicate common filesjnqnfe
there are several files of which identical duplicate copies are held in: - share/bootloaders/extlinux - share/bootloaders/pxelinux - share/bootloaders/isolinux - share/bootloaders/syslinux it is a pain to maintain this from a development standpoint, having to copy modified config files into the other directories each time changes are made and mistakes have been made before due to this. this creates a new folder share/bootloaders/syslinux_common and moves them to this new directory. it also expands the binary_syslinux stage to use it, with it now constructing the installed set of bootloader files as follows: 1. copy {LB_DIR}/bootloaders/syslinux_common 2. copy {LB_DIR}/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top 3. copy config/bootloaders/syslinux_common on top 4. copy config/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top note, to explain part of the binary_syslinux change, instead of just copying the correct bootloader folder full of the files, we now make the target bootloader specific directory, then copy the contents of source directories into it. Gbp-Dch: Short
2020-04-24Use correct variable name to detect removal stepRaphaël Hertzog
Due to this mistake, the helpers were not called in reverse order during the removal step. This lead to things like "apt update" failing because a broken /etc/resolv.conf has been restored before the call to "chroot_archives remove". Gbp-Dch: Ignore
2020-04-24Replace "Help" calls with "Man" and get rid of HelpRaphaël Hertzog
2020-04-24Revert "frontend: properly handle option processing"Raphaël Hertzog
This reverts commit 6b7c8ed4bf15175299729355f04d60dcbac1aded as it's breaking multi-value space-separated parameters.
2020-04-24config: tidy directory construction and empty directory cleaningLyndon Brown
2020-04-24config: tidy config filesLyndon Brown
2020-04-23chroot_resolve: fix broken network connectivityLyndon Brown
introduced by an issue with the implementation of 91d446d93ed717b1082bb646fbef65cd1cbc25f5 the introduced of that commit caused builds to fail doing `apt-get update` or downloading packages and such. this tweak fixes the problem. Gbp-Dch: Ignore
2020-04-23stagefiles: guard unnecessary chroot removalLyndon Brown
just as most scripts are skipped if their stagefile exists (indicating that they have already been run to completion), including chroot preparation scripts in install mode, this implements the same guard for chroot prep remove mode, such that they exit early if their stagefile does not exist, indicating that the modification has already been removed. (also override-able by --force in the same way). this basically just uses a tweaked copy of Check_stagefile(). Gbp-Dch: Short
2020-04-23config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/Lyndon Brown
no backwards compatibility hack for reading the old var from existing saved config used because this was previously stored in the alternate format config/build file. Gbp-Dch: Short
2020-04-23config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/Lyndon Brown
no backwards compatibility hack for reading the old var from existing saved config used because this was previously stored in the alternate format config/build file. Gbp-Dch: Short
2020-04-23config: s/LIVE_CONFIGURATION_VERSION/LB_CONFIGURATION_VERSION/Lyndon Brown
2020-04-23config: address fixmeLyndon Brown
these options are not internal, they are user controllable Gbp-Dch: Short
2020-04-23config: remove obsolete variableLyndon Brown
2020-04-23config: revert partial format conversionLyndon Brown
back in v4.0~a6-1 a transition process was started to move the live-build config to a new format. the new format was INI style, and required parsing functions to read/write values, compared to the existing format which was just shell script code setting variables. this partial transition is the explanation for the existence of the `New_configuration()` function, and understanding this is important to understanding the purpose of it - it is not in fact intended for creating a new configuration, it is just related to the new config format transition. the positives of the new format were that it was somewhat cleaner looking, while the negative was the terrible relative efficiency. the file `config/build` was created to hold options in this new format. the transition was only ever completed for a handful of config options: - architecture - archive areas and parent archive areas - live image name - live image type a 'configuration version' attribute was also saved, which is not used by anything. the bootstrap-mirror and parent-bootstrap-mirror attributes are pointlessly stored in it seemingly resulting from work done in v4.0~a17-1. (they are also stored in another config file from which the value is actually used). it in fact seems to have been a source of confusion for Raphaël in authoring 44b9b0a6501476de594ce3783cea5df0c141478c, since the new `[parent]-distribution-{chroot|binary}` options it introduced were stored both in `config/bootstrap` and in `config/build`, while only used from the former. i expect, understandably, that he thought that `config/build` was just an information file. Gbp-Dch: Short
2020-04-23move grub-pc specific code to actual grub-pc scriptLyndon Brown
the grub-pc image creation code has no business being in binary_iso, it should be in binary_grub-pc. it should be noted that the binary_iso script did not even have the necessary package check for grub-mkimage, while binary_grub-pc did have it, pointlessly. Gbp-Dch: Short
2020-04-23syslinux: use linux/initrd placeholdersLyndon Brown
enabling improved flexibility for any possible future path changes. Gbp-Dch: Ignore
2020-04-23config: create config/bootloaders directoryLyndon Brown
to help users know that this is where they can put custom bootloader configs, just as other directories are created for them. Gbp-Dch: Short
2020-04-23binary_syslinux: rely on $LIVE_BUILD_VERSION instead of lb --versionRaphaël Hertzog
2020-04-23tidy version reported in `lb config --dump`Lyndon Brown
live-build might be run from a local folder rather than the system installation, so the dpkg version number should not override the version picked up from VERSION if we care about the possibility of the installed package version potentially differing from the version of the git checkout, or whatever, then this should be printed alongside it, as now done. Gbp-Dch: Ignore [Raphaël Hertzog: tweak to apply on top of my changes]
2020-04-23Use descriptive parameter names for Usage()Raphaël Hertzog
2020-04-23usage: take exit code as paramLyndon Brown
thus it can correctly indicate success/fail status instead of always indicating failure. when a user asks for usage with -u|--usage then we should exit in success mode rather than failure as when usage in printed in response to incorrect usage. Gbp-Dch: Short
2020-04-23frontend: properly handle option processingLyndon Brown
this means that the usage goes from: lb {-h|--help|-u|--usage|-v|--version} lb COMMAND [OPTIONS] to: lb {-h|--help|-u|--usage|-v|--version} lb [FRONTEND_OPTIONS] COMMAND [COMMAND_OPTIONS] though it is probably not worth is to update the description in the manpages...? hmm... so for instance this matters for color control with --color|--no-color (you already had full control via environment vars). previously you could do `lb COMMAND --no-color` to turn off colour, only to find that output at the frontend level was still coloured (the option is processed at the command context level, not the frontend), so you might try to instead use `lb --no-color COMMAND`, only to find that this was not supported. Well now it is, and used at the frontend level will fully control colour output (after the command is processed anyway). the full set of common options are thus available (except --force) at the frontend level, and thus for instance all Echo_*() helpers used in the frontend will work correctly after args are processed. furthermore usage like `lb --color --help` will actually work. (not that color is used there, but this previously would have failed with the frontend treating the `--color` argument as the command; that's the point!) Gbp-Dch: Short
2020-04-23rename LB_BOOTSTRAP_QEMU_ARCHITECTURES to LB_BOOTSTRAP_QEMU_ARCHITECTURELyndon Brown
2020-04-23rename LB_ARCHITECTURES to LB_ARCHITECTURELyndon Brown
this was previously not done in 8b109ffb96282a6dd1aa5d61aa935bcba69c56f1 to keep the renaming simple, but leaving the variable plural is a cause for confusion. since this property is stored in the INI style config/build config file rather than a shell script based one, at the property there is already singular, there was no need for a backwards compatibility hack. Gbp-Dch: Short
2020-04-23fix usageLyndon Brown
Gbp-Dch: Ignore
2020-04-23move script param capture to before arg processingLyndon Brown
makes them consistent with other similar script-specific param handling; saves the arg processing from dealing with it. Gbp-Dch: Short
2020-04-23firmware: robustify and simplify archive area checkingLyndon Brown
2020-04-23config: obsolete old --tasksel optionLyndon Brown
note that the bit of code removed from source_debian relies upon a variable LB_TASKS which itself is an old leftover artefact from before v4.0. Gbp-Dch: Short
2020-04-23config: obsolete --net-root-pathRaphaël Hertzog
2020-04-23config: obsolete --net-root-* options (except one)Lyndon Brown
--net-root-path probably needs to go too, but it is being used for something i don't fully understand currently. Gbp-Dch: Short