summaryrefslogtreecommitdiff
path: root/functions
AgeCommit message (Collapse)Author
2020-03-05archives: deduplicate apt sourcelist file constructionjnqnfe
Geez :O Gbp-Dch: Short Closes: #952889
2020-03-05echo: tidyLyndon Brown
Gbp-Dch: Ignore
2020-03-05cursor: purge unused cursor functionsLyndon Brown
only a couple were in use and only by unused echo helpers which have now themselves been removed, so nothing in this file is needed. Partial fix for #952880 Gbp-Dch: Short Closes: #952880
2020-03-05echo: purge unused *_running echo helpersLyndon Brown
Partial fix for #952880 Gbp-Dch: Short
2020-03-05echo: purge some unused echo helpersLyndon Brown
Partial fix for #952880 Gbp-Dch: Short
2020-03-05echo: direct warnings via echo helper to stderrLyndon Brown
2020-03-05echo: ensure output goes to stdout/stderrLyndon Brown
all of these echo helpers are essentially 'logging' functions with output always intended for stdout/stderr. lack of explicit stdout/stderr direction means that their output could be captured unintentionally should they be used within a function designed to construct a string. Gbp-Dch: Short Closes: #952879
2020-03-05echo: fix problem with error printingLyndon Brown
lack of stderr directed output for the `E:` prefix meant that it would not appear alongside the message in some use cases Gbp-Dch: Short Closes: #952878
2020-03-05fix missing use of echo helpersjnqnfe
Closes: #952876
2020-03-05help/usage: fix overly complex script description handlingjnqnfe
Closes: #952887
2020-03-05help/usage: fix incorrect program commandLyndon Brown
Closes: #952884
2020-03-05help/usage: avoid unnecessary use of echo helpersjnqnfe
Closes: #952877
2020-03-05fix capitalisation of some output messagesjnqnfe
Closes: #952875
2020-03-05defaults: fix pointlessly split line errorjnqnfe
inconsistent with all other output Gbp-Dch: Ignore Closes: #952874
2020-03-05memtest: better handle obsolete LB_MEMTEST valueLyndon Brown
available values currently are memtest86+|memtest86|none; "false" is presumably handled for backwards compatibility there is no need to handle this in individual scripts. the right place to handle it is in Set_Defaults as now done Gbp-Dch: Short Closes: #952866
2020-03-05simplify --debian-installer choicesjnqnfe
`false` and `none` make no sense as choices for this option. Here we replace `false` with `none`, and remove `true`. Note that `true` was treated as an alias for netinst (see the changes to source_disk and and binary_disk). For backwards compatibility we still allow `true` and `false` by converting them to `netinst` and `none` respectively, whilst printing a warning to encourage users to move to `netinst`/`none`. Gbp-Dch: Short Closes: #952864
2020-03-05don't unnecessarily convert exit codes to stringsLyndon Brown
Closes: #952861
2020-03-05fix indentationLyndon Brown
including: - spaces replaced with tabs for consistency - alignment of `;;` in some case statements changed for consistency Gbp-Dch: Short Closes: #952857
2020-01-22Get rid of extraneous whitespace showing up in syslinux menuRaphaël Hertzog
The leading space ends up in the FLAVOUR substitution in live.cfg.
2019-12-19Support --distribution-binary and --distribution-chrootRaphaël Hertzog
This makes it possible to build an image against a first distribution (--distribution-chroot) and have the resulting image point to another distribution (--distribution-binary). We can use this to build against a snapshot and have the result use the original distribution that was snapshotted. Closes: #888507
2019-12-19installer_debian-installer: don't mess with /var/lib/dpkg/statusRaphaël Hertzog
Use a similar trick as for chroot_live-packages. Relates to #944983.
2019-12-19Set default distribution to busterRaphaël Hertzog
Closes: #934495 Thanks: Алексей Шилин
2019-12-19chroot_live-packages: use dpkg-query to see if a package is installedRaphaël Hertzog
Closes: #944983
2019-06-03Reenabled the command line option for colored messages for all scripts. The ↵Roland Clobus
functionality was added 2008-11-01, but was not really active.
2019-04-17Updated URL in the LB_ISO_PUBLISHER field.Roland Clobus
2019-04-17Updated URL in the LB_ISO_PREPARER field.Roland Clobus
2019-04-17Updated URL for reporting bugs.Roland Clobus
2019-03-14Fixed foreign architecture package support to linux kernel flavoursAdrian Gibanel Lopez
Before Stretch there was an special amd64 kernel in the i386 arch repo. So if you wanted to install an amd64 kernel alongside an i386 system you did not need an additional arch repo. Debian added multiarch support. That way you can install library packages from multiple architectures on the same machine. So there is no longer a need for having an amd64 kernel in i386 arch repo. You can add an amd64 arch repo to an i386 arch system and fetch the amd64 kernel from the am64 arch repo. live-build can be setup to use several linux kernel flavours in a single image. So in the days previous to this patch you could issue: lb config --linux-flavours "486 amd64" to use both 486 and amd64 kernel flavours. Adding additional arch support to linux flavours poses two problems: * Packages need to have its arch suffix (e.g. amd64:amd64). If the suffix is not there apt-get insists on search amd64 kernel package on i386 arch repo and, of course, fails to find it. * The rest of the code which handles labels (bootloader config files) or installed filenames (kernel images themselves) do not use the arch suffix. This patch adds foreign architecture package support to linux kernel flavours having taken those problems into account. Practical example usage: i386 system and extra amd64 kernel. First add amd64 foreign architecture in your i386 system thanks to: dpkg --add-architecture amd64 apt-get update . Finally enable amd64 kernel from amd64 arch alongside the i386 system's 686 kernel thanks to: lb config --architectures i386 --linux-flavours "686 amd64:amd64"
2018-10-13use deb.debian.org as defaultHideki Yamane
replace deprecated httpredir.debian.org to deb.debian.org and use it as default mirror since it is appropriate for users
2018-04-05Print an error and exit if a host package (dependency) is missing.Luca Boccassi
Check_package will just add a missing dependency to the LB_PACKAGES todo list if it doesn't find it, when build-with-chroot is true, even if the check was not for the chroot. Instead error out if the check is not done for the chroot, e.g. Check_package host /bin/foo foo
2018-03-22Add options to build ONIE imagesLuca Boccassi
Open Network Install Environment is an open image format used by networking vendor to ship a standardised image for networking white box switches. ONIE hardware takes this image at boot and a script to chain load into the final environment via kexec. We can support Debian and derivatives on such systems by packing an ISO which then gets unpacked, kexec'ed and live-booted. A base ONIE system can be tested in QEMU by building a VM following these instrunctions: https://github.com/opencomputeproject/onie/blob/master/machine/kvm_x86_64/INSTALL Once built, boot onie-recovery-x86_64-kvm_x86_64-r0.iso in QEMU/libvirt and on the console there will be the terminal prompt. Check the IP assigned by libvirt and then scp the live image (ssh access is enabled as root without password...). Then the .bin can be booted with: ONIE-RECOVERY:/ # onie-nos-install /tmp/live.hybrid.iso-ONIE.bin The implementation is inspired by ONIE's own scripts that can be found at: https://github.com/opencomputeproject/onie/blob/master/contrib/debian-iso/cook-bits.sh A new option, --onie (false by default) can be set to true to enable building this new format in addition to an ISO. An additional option, --onie-kernel-cmdline can be used to specify additional options that the ONIE system should use when kexec'ing the final image. Note that only iso or hybrid-iso formats are supported. For more information about the ONIE ecosystem see: http://onie.org Signed-off-by: Erik Ziegenbalg <eziegenb@Brocade.com> Signed-off-by: Luca Boccassi <bluca@debian.org>
2018-03-09UEFI: add support for Secure Boot on amd64 and arm64Luca Boccassi
Support for UEFI Secure Boot is modelled after how it currently works in Ubuntu and on how it is going to work on Debian. A minimal bootloader, shim, is used as the first-stage and it then loads grub. Both have to be signed. shim-signed is already available in Debian so the filenames are already established, and the grub2 repository and packaging is common between the 2 distros so we can already be reasonably sure of what it is going to be. So if both are available, copy /usr/lib/shim/shim[x64|aa64].efi.signed as boot[x64|aa64].efi so that UEFI loads it first, and copy /usr/lib/grub/[x86_64|arm64]-efi-signed/grub[x64|aa64].efi.signed as grub[x64|aa64].efi. This grub2 EFI monolithic image is currently hard-coded in grub2's repository to look for a config file in efi/debian, so make a copy of the previously added minimal grub.cfg that loads the real one in that directory in both the fat32 and ISO 9660 partitions. The new option --uefi-secure-boot can be set to auto (default, enable or disable. In auto, the lack of the signed EFI binaries is intentionally left as a soft failure - live-build will simply fallback to using the locally generated non-signed grub2 monolithic EFI binary as the only bootloader. Given the difficulties surrounding the Secure Boot signing infrastructure this approach gives the most flexibility and makes sure things will "just work" once the packages are available, without the need to change anything in the configuration. This will also greatly help downstream distributions and users who want to do self-signing. The enable or disable options work as expected. Closes: #821084
2017-09-18Replace "kirkwood" and "orion5x" armel flavors with the new "marvell" oneRaphaël Hertzog
As done by the linux source package since its version 4.4.
2017-09-01Error out when needed packages are missing on the hostMatthijs Kooijman
Previously, Check_package would only show an error when host packages are missing on a non-apt system. On apt system, the packages would be added to _LB_PACKAGES, which causes them to be installed in the chroot, not in the host (or not at all if Install_package is not called). This behaviour could break the build. This applies to either packages that must be present in the host (as checked with `Check_package host ...`), as well as packages that can be either in the chroot or host (as checked with `Check_package chroot`) when LB_BUILD_WITH_CHROOT=false.
2017-09-01Pass --partscan to losetupMatthijs Kooijman
Recent versions of Linux, parted or some other bit of software cause partition devices, like /dev/loop0p1 to be created when running parted mkpart. However, these devices are not cleaned up when running losetup -d to remove /dev/loop0 later, so they linger around and confuse mkfs (which refuses to make a filesystem, thinking there are partitions): mkfs.fat 4.1 (2017-01-24) mkfs.vfat: Partitions or virtual mappings on device '/dev/loop0', not making filesystem (use -I to override) To prevent this behaviour, pass --partscan to losetup when adding a new partition, to clean up any lingering partitions. It seems losetup does not accept --partscan when deleting a loop device, to clean up at that point, but since binary_hdd mounts the partition last, there should not be any lingering partition devices after live-build is done. The --partscan option is available since util-linux 2.21 (released in 2012), so it should be fairly safe to pass it unconditionally.
2017-08-29Update PREPARER data for consistencyRaphaël Hertzog
2017-08-29Drop all references to live-systems.org and update copyright fileRaphaël Hertzog
Also fix the version string in the manual pages. Closes: #859290
2017-02-13Drop the versatile kernel flavour on armel. It's no longer built since Linux ↵Raphaël Hertzog
4.9.
2016-12-02Drop check on configuration versionRaphaël Hertzog
The date based versioning scheme no longer allows such a check. And we don't intend to break backwards compatibility for now.
2016-12-02Default for LB_UNION_FILESYSTEM is now "overlay" just like in live-boot.Raphaël Hertzog
2016-11-28Fix permission on functions/bootloaders.shRaphaël Hertzog
2016-11-28Fix Check_installed function when checking against hostRaphaël Hertzog
Thanks to jnqnfe for the report. Closes: #774807
2016-11-28Export SOURCE_DATE_EPOCH when running chroot commandsRaphaël Hertzog
Thanks to Chris Lamb <lamby@debian.org> for the patch. Closes: #832998
2016-11-28Fix behaviour of (undocumented) "#nif" conditional testRaphaël Hertzog
Thanks to Erik Cumps <erik.cumps@esaturnus.com> for the patch. Closes: #801379
2016-07-31Make: syslinux,grub-efi the default bootloaders becauseAdrian Gibanel Lopez
UEFI is getting widely adopted but BIOS support is still needed.
2016-07-31defaults.sh LB_BOOTLOADER updated to be: LB_BOOTLOADERS in incompatible warningAdrian Gibanel Lopez
2016-07-31Added new multi bootloader helper functionsAdrian Gibanel Lopez
* Added: functions/bootloaders.sh . This file adds bootloader functions that are heavily used in efi scenarios where a bootloader can act as a first or an extra bootloader. Since the introduction of the new switch: --bootloaders you can setup it like this: --bootloaders=syslinux,grub-efi . This means that syslinux is the first bootloader and grub-efi is the extra bootloader. * Added new bootloader functions: Check_Non_First_Bootloader and Check_Non_Extra_Bootloader. These functions let each one of the bootloaders abort the build because they cannot perform a role either as a first bootloader or as an extra bootloader. * Added bootloader functions: Check_First_Bootloader_Role, Check_Extra_Bootloader_Role and Check_Any_Bootloader_Role These functions let bootloaders to force their default role in a single line. At the same time many binary bootloaders were rewritten to make use of the new bootloader role functions explained above. These roles were enforced: binary_grub-legacy : First bootloader binary_grub-pc : Either first or extra bootloader binary_syslinux : Either first or extra bootloader If a bootloader is tried to be used in a role that it's not meant to be used then the build fails because that might lead to a non-bootable system.
2016-07-31functions/default.sh : Define LB_PRIMARY_BOOTLOADER at the Set_defaults ↵Adrian Gibanel Lopez
function which it's the right place where to do it
2016-04-16Include ext{3,4} journal size when calculating image sizeKristian Klausen
Fix #801712
2016-01-05Drop ixp4xx from available armel flavorsRaphaël Hertzog
It's gone from Debian unstable/testing since Linux 3.17. Sponsored-By: Offensive Security