summaryrefslogtreecommitdiff
path: root/functions
AgeCommit message (Collapse)Author
2021-08-09add items for grub setup and enable persistence1.3.81.3.71.3.61.3.51.3.41.3.3-epa11.3.31.3.2equuleusKim Hagen
2021-07-29create loop partitions with mknod instead of bind mounting /devKim Hagen
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
2015-12-15Remove 586 flavour for i386 architecture. (Closes: #807972)Ben Armstrong
2015-08-29Multi bootloader supportAdrian Gibanel Lopez
Note: OLDIFS use makes IFS to be reset to "" instead to it being unset. Either we need to detect if old IFS was unset to unset it or we need a proper way of setting it as a local variable. Even more IFS it's not currently used in Check_package (which it's called from: binary_hdd). we should have a clean way of resetting/unsetting IFS when calling Check_package. The other approach it's to explicitly define IFS with its default value in the places inside live-build code where we implicitly suppose that it's going to have its default value.
2015-08-10Updating stat calls to also give the right result in container setups, ↵Daniel Baumann
thanks to Kristian Klausen <klausenbusk@hotmail.com> (Closes: #789300).
2015-08-10Getting rid of hard-coded release numbers and using /etc/os-release instead ↵Daniel Baumann
(Closes: #790860). Unfortunately VERSION_ID on testing/unstable is currently not included in /etc/os-release, see #795124.
2015-05-10Switching from http.debian.net to httpredir.debian.org as default binary mirror.Daniel Baumann
2015-05-03Dropping automagics for ubuntu.Daniel Baumann
Future live-build versions will still allow to use casper, but its configuration will be done differently by a custom config tree, rather than embedded and maintenance intensive code in live-build itself.
2015-05-03Dropping automagics for casper.Daniel Baumann
Future live-build versions will still allow to use casper, but its configuration will be done differently by hooks in the config tree, rather than embedded and maintenance intensive code in live-build itself.
2015-04-29Moving grub and grub2 templates into shared bootloader config directory.Daniel Baumann
2015-04-28Setting progress-linux default distribution to cairon.Daniel Baumann
2015-04-28Setting debian default distribution to stretch.Daniel Baumann
2015-04-26Don't truncate files outside the build chroot.Daniel Reichelt
The list of files passed to Truncate() might contain absolute symlinks pointing to files outside the chroot, which previously destroyed files on the build host.
2015-02-07Making functions/chroot_bind_path.sh executable within the source tree ↵Daniel Baumann
(Closes: #777096).
2015-02-04Adding linux flavours for arm64/armhf architectures.Fathi Boudra
Signed-off-by: Fathi Boudra <fabo@debian.org>
2015-01-26Switching to default to linux-image-586 on i386.Daniel Baumann
2015-01-25Correcting packagelist parsing when packages are listed with notation of a ↵Daniel Baumann
specific version (Closes: #775832).
2015-01-25Enabling security and release updates for jessie.Daniel Baumann
2015-01-04Updating year in copyright notices to 2015.Daniel Baumann
2015-01-04Dropping some sparc leftovers (Closes: #774196).Daniel Baumann
2015-01-04Changing package dependency checks within chroot to work outside as well.Daniel Baumann
2014-12-23Dropping cdebootstrap support (Closes: #773657).Daniel Baumann
debootstrap is the official tool to bootstrap debian, cdebootstrap has had the one or other bug making it broken for times during the release cycles. The extra effort of supporting both debootstrap and cdebootstrap is hardly worth it since the bootstrap stage is cached anyway.
2014-12-10Cleaning up from python removal (LIVE_IMAGE_PARENT_ARCHIVE_AREAS).Daniel Baumann
2014-12-10Updating misc settings for progress-linux.Daniel Baumann
2014-12-10Address "should check that we're building on debian through e.g. a ↵jnqnfe
'derivative-is-based-on' variable or somesuch" fixme.
2014-12-10Bind local repository into chroot directory.Jan Blunck
If a local repository path is given as a mirror URL lets bind it into the chroot. The local repository will be unmounted while processing "remove" or latest by the exit function.
2014-12-10Skip comments in package lists.Raphaël Hertzog
Comments in package lists used to work in live-build 3.x (although possibly only as a side-effect of some other logic) and being able to comment package is a useful feature (to explain why some packages are included and to make it easy to uncomment some lines to add more useful packages).
2014-12-10Dropping support for wheezy.Daniel Baumann