summaryrefslogtreecommitdiff
path: root/scripts/build
AgeCommit message (Collapse)Author
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
2020-04-23config: obsolete unused --net-cow-* optionsLyndon Brown
2020-04-23config: obsolete unused --isohybrid-options optionLyndon Brown
2020-04-23config: apt-get should probably be an allowed and documented --apt valueLyndon Brown
since everywhere where 'apt' is a permitted value, 'apt-get' is also, it just wasn't listed in the option's documentation and thus was also not listed in the new validation check. Gbp-Dch: Short
2020-04-23config: fix broken backwards compatibility hackLyndon Brown
80aa5ab61100b6b11ae47984bab9a2eb988074f5 implemented a hack to handle replacement of LB_LINUX_FLAVOURS with LB_LINUX_FLAVOURS_WITH_ARCH in config files, but implemented it in the wrong place. adding a conditional conversion within the config file meant that the old value would only be read from **new** config files that are created obviously without it, including re-saved configs if `lb config` were re-run with additional options (not recommended). any existing value in an existing config file would actually be ignored. the right place to read the old value was in the Set_defaults() function (since renamed). a second issue also existed with the hack, it failed to excape the `$` and thus printed the existing value of $LB_LINUX_FLAVOURS into the conditional check being constructed in the config file, instead of printing the name of the variable. the check embedded into the config file thus became this on an amd64 machine: ``` if [ -n "amd64" ] then LB_LINUX_FLAVOURS_WITH_ARCH="amd64" fi ``` which is clearly not what was intended. Gbp-Dch: Short
2020-04-23config: stop writing 'default: <foo>' lines to config filesLyndon Brown
while helpful for users to know the defaults, the values printed as the supposed defaults for most are actually the same values as being configured, or in some cases a piece of text "autodetected or empty", and thus the information is completely wrong and actually unhelpful since it misinforms the user. fixing this to give the real defaults is very much non-trivial. as a workaround users wanting to know the default for an option can always: a. use `lb config` wit no options (or auto) in a clean directory and thus get a config with all defaults. b. look at the live-build code. if they just want to reset an option, they can also just comment it out. Gbp-Dch: Short Closes: #904614
2020-04-23installer: rework validation check for installer typeLyndon Brown
(and move the wget options setting down where it should be while at it) the value of LB_DEBIAN_INSTALLER is now properly checked in the main validation routine, so we can just directly exit here as a simple safety check should validation be bypassed. Gbp-Dch: Short