Commit Graph

1335 Commits

Author SHA1 Message Date
Roland Clobus 4086f078d9
Installer: ignore the configured kernel version
When building the Debian installer from git, ignore any configured
kernel version, and use the kernel version that is present in the chroot
environment.

This fixes a build error on Trixie/testing, which occurred after a new
kernel became available when the freeze was lifted.
2023-07-08 08:01:19 +02:00
Roland Clobus 29e26d11f8 If there is more than one kernel for the installer, use the newest 2023-06-21 10:13:51 +00:00
Roland Clobus ba34bfbfd0
non-free firmware detection: in chroot, not on host
Follow-up for 18ad612b72.
The availability of 'firmware-linux' must be checked inside the chroot
instead of on the host.
This fixes building Bullseye without 'non-free' available (as discovered
by autopkgtest)
2023-06-21 09:04:08 +02:00
Thore Sommer dd916ac5be ISO generation: add support for hybrid ISOs with grub-pc 2023-06-06 18:31:51 +03:00
Jonathan Carter d5b3a21031 Add cryptsetup-initramfs to package pool 2023-05-02 14:33:08 +02:00
Roland Clobus 7b36f5b0ad
UEFI-secure: Don't attempt to load unsigned modules
The part_*.mod modules are not inside the signed .efi-file, so they must
not be 'insmod'ed in secure boot mode.
2023-04-30 12:59:36 +02:00
Roland Clobus 7690fb206f
Share the splash screen from isolinux in grub
This adds the version information on the grub splash screen and offers
the image at 800x600 instead of 640x480, which looks less unsharp.
2023-04-30 09:15:44 +02:00
Roland Clobus 18ad612b72
Detect firmware-linux, without references for Debian versions 2023-03-14 20:28:00 +01:00
Roland Clobus 50c7e1a8b7
Add support for non-free-firmware 2023-03-12 00:16:04 +01:00
Roland Clobus 27f50aef9a
Use either ${LIVE_BUILD}/share/hooks or /usr/share/live/build/hooks, not both 2023-03-04 17:08:33 +01:00
Patrice Duroux 2bd841f835 replace 2&>1 by 2>&1 2023-03-01 17:19:44 +00:00
Raphaël Hertzog 7b5fce3fa6
Fix binary_memtest for x32 -> ia32 renaming made in memtest86+ >= 6.10-3
memtest86+ switched to /boot/memtest86+ia32.{bin,efi} for 32bits to be
coherent with the usual EFI naming.
2023-02-22 08:43:20 +01:00
Roland Clobus 8c50c9c0ed installer: Mark the local repository as trusted
apt-secure will now accept the local repository and Calamares can be run
without network connections.
2023-01-31 15:27:59 +00:00
Roland Clobus 61ae406dd7 installer: add grub packages for d-i and Calamares
d-i and Calamares select the needed grub packages based on how the
computer is started (BIOS vs UEFI). Because the packages for each
variant conflict, they must be provided as .deb files.
2023-01-31 15:27:59 +00:00
Roland Clobus 947f6aafe8 installer: No error if the udeb-exclusion list is empty 2023-01-31 15:27:59 +00:00
Roland Clobus 2acfbee5fd installer: Remove the udeb files
Without the quotes, the * inside the exclusion lists will be treated as
a will card, instead of the literal star.
2023-01-31 15:27:59 +00:00
Roland Clobus 196ee7b096 installer: Skip rebuilding the debian installer if it is found in the cache 2023-01-31 15:27:59 +00:00
Roland Clobus 7e7544c446 If the same file exists in multiple locations, take the version from the
first.

The LIVE_BUILD location will only be added if LIVE_BUILD is set.
2023-01-31 15:27:59 +00:00
snip 58f7a9e379 Use same naming scheme for archive keys in chroot and binary stages
Commit 8403487d introduced in the chroot stage a naming scheme for local
archive keys which distinguishes between ASCII-armored keys and binary
ones, and then adds the appropriate extension (either `.asc` or `.gpg`,
respectively) when copying them to `/etc/apt/trusted.gpg.d`.

However, this change was not applied to the binary stage: ASCII-armored
and binary keys are still both copied with the `.asc` extension, which
introduces a discrepancy between the two stages. This, in turn,
may prevent using the same `.list` file for both stages, as entries
such as

    deb [signed-by=/etc/apt/trusted.gpg.d/my-repository.key.asc] ...

will fail in the chroot stage if `config/archives/my-repository.key`
is in binary format (as it will be copied with the `.gpg` extension),
while entries such as

    deb [signed-by=/etc/apt/trusted.gpg.d/my-repository.key.gpg] ...

will fail in the binary stage (as the key will this time be copied
with the `.asc` extension).
2023-01-05 09:52:48 +01:00
Ryan Finnie 5e01a0c09f
Memtest GRUB fixes
Previous commits to support Memtest86+ 6.00+ split the files into
"memtest" (backwards compatible / new BIOS name) and "memtest.efi"
(new EFI name).  However, the 6.00 non-EFI binaries are now
32/64-bit, and will not work with GRUB's linux16 boot when using GRUB
for BIOS boot.

- Legacy Memtest86+ pre-6.00 will continue to be "memtest", linux16
  (continue to support builds on current Debian stable bullseye)
- Change 6.00+ filename to "memtest.bin"
- GRUB memtest.cfg contains logic for legacy / new bios / new EFI
- Change EFI boot from "chainloader" to "linux", which allows for
  passing command line options to Memtest86+
- syslinux @MEMTEST@ will conditionally be memtest.bin or memtest
- @MEMTEST_BIN@ will conditionally be memtest.bin or memtest, but is
  completely legacy at this point (all internal code paths now check
  for @MEMTEST_DIR@/memtest or @MEMTEST_DIR@/memtest.bin)

Getting complicated, but this logic can be simplified again once we
no longer need to support current Debian stable.
2023-01-02 09:40:17 -08:00
Roland Clobus dcbbfed463 installer: fail early
If e.g. the required packages for the git build cannot be installed,
abort early instead of attempting to build the installer.
2022-11-14 10:38:18 +00:00
Ryan Finnie 1d6f6dd178
memtest: Support arch-specific and EFI memtest86+ 6.00
- BIOS: Final filename doesn't change (memtest), but now uses a
  64-bit version on amd64.
- EFI: Now included as memtest.efi; 32-bit on i386, 64-bit on amd64.
  As it's GRUB-only, we can test for the existence of memtest.efi
  (6.00+ only) in GRUB itself.
- Add @MEMTEST_DIR@ to facilitate directory-based testing in GRUB.

This expands upon the previous MVP commit
15e78a3eec .
2022-10-31 21:55:14 -07:00
Ryan Finnie 15e78a3eec Fix build with memtest86+ 6.00
memtest86+ 6.00-1 (in testing as of this date) adds and changes its
available binaries:

  - /boot/memtest86+x32.bin
  - /boot/memtest86+x32.efi
  - /boot/memtest86+x64.bin
  - /boot/memtest86+x64.efi

Future live-build functionality would ideally incorporate these new
binaries (x64 for amd64 builds, efi for grub-efi), but in the meantime,
this is an MVP update which supports either old memtest86.bin or new
memtest86+x32.bin.
2022-10-31 15:19:27 +00:00
Ryan Finnie ec73f2bab1
chroot_hostname: Fix reference to chroot inside chroot
Fixes: d2722e8f (Fix permissions and ownership of chroot_hosts and chroot_hostname copied files)
2022-08-23 10:41:25 -07:00
Roland Clobus 10b968e891 Add more variables for the splash.svg image (Closes: 1015782)
The request asked for 5 additional variables to be resolved for the SVG
images:
Added: LB_ISO_APPLICATION, LB_ISO_PUBLISHER and LB_LINUX_PACKAGES
Not added: LB_ISO_PREPARER: xorriso recommends not changing this
variable
Not added: LB_ISO_VOLUME: is can contain '@ISOVOLUME_TS@' which resolves
to a timestamp and would need additional handling
2022-08-10 08:10:07 +00:00
Nick Brown 4a0350bdaf Allow APT_AUTH.CONF(5) config files to be used with archives during bootstrap.
Currently it's only supported in the chroot/binary phases. Omitting
bootstrap was an oversight.

Note that config/archives/*.conf are assumed to be apt.conf files,
so the apt_auth files are required to end with .auth and will be renamed
to .conf when copied into the chroot.
2022-06-28 21:05:12 +01:00
Olivier BLIN d2722e8f19 Fix permissions and ownership of chroot_hosts and chroot_hostname copied files
Ensure that /etc/hosts and /etc/hostname have safe permissions and the right
ownership when copied from include directory.

Gbp-Dch: Ignore
2022-06-10 12:08:58 +02:00
Roland Clobus 17cb77ab82
Removes 'nomodeset' from fail-safe boot.
After more tests on openQA, it was shown that 'nomodeset' not only for
UEFI makes the image non-bootable (see
8c65231ad1), but for BIOS as well.
2022-06-01 09:12:01 +02:00
Roland Clobus fa8ebd2469
Introduce '--debian-installer-distribution git'.
With this 'distribution', the installer is built from its git
repository, matching the date in SOURCE_DATE_EPOCH.
Additionally the kernel version is matched to the kernel version in the
chroot (to ensure that the installer can be run).
Rationale: The 'daily' installers are not archived, and therefore cannot
be used for a reproducible build.
2022-05-17 08:48:44 +02:00
Roland Clobus 26845abebc
Create a clean chroot for the installer.
The installer stage has a clean chroot for its own usage. The chroot
from the chroot stage is available in chroot/chroot (implemented similar
to the binary stage).
2022-05-17 08:48:35 +02:00
Olivier BLIN 36e019c38d Add support for the new includes.chroot system to /etc/hosts file
The new includes.chroot system implemented in !214 adds the option
to include files in the chroot before and after package installation.

chroot_hostname and chroot_resolv have been updated but not chroot_hosts.

Gbp-Dch: Short
2022-04-22 08:58:06 +00:00
Roland Clobus 5b44eb3bf5
Remove a left-over file when using a package in config/packages.chroot. 2022-04-20 10:26:24 +02:00
Roland Clobus c2263f1748
UEFI doesn't like nomodeset in safe mode 2022-03-25 15:15:29 +01:00
Rob Shearman 3b0d8263d2 config: respect --bootloaders option again on amd64/i386
Persist LB_BOOTLOADERS in lb_binary_* configuration, since
Init_config_data called from lb_binary_* calls Prepare_config which
then overrides LB_BOOTLOADER_BIOS and LB_BOOTLOADER_EFI if
LB_ARCHITECTURE is amd64 or i386, and these can only be restored to
their proper values by the presence of LB_BOOTLOADERS.

This therefore ensures that the value of the "--bootloaders" parameter
to lb_config is respected by the lb_binary_* steps.
2022-02-18 13:00:01 +00:00
Nick Brown f04dc6dc49 Add auth.conf.d support to archives
Allow APT_AUTH.CONF(5) config files to be used with archives.

Note that config/archives/*.conf are assumed to be apt.conf files,
so the apt_auth files are required to end with .auth and will be renamed
to .conf when copied into the chroot.

Closes: #991065
2022-02-18 10:47:45 +00:00
Nick Brown 70994cd304 Echo executing source/binary hooks
The chroot hooks already do this.
2022-02-11 10:51:39 +00:00
Michał Prochera e420c83e4c Unconditional Remove_packages calls in binary_rootfs (Closes: #994982)
That prevents potential errors during future Remove_packages calls without APT indices available. In such cases, APT tries to remove packages with unrecognized names, which results in an error and fails the script execution. An example of this would be installing apt-utils in chroot_archives with --apt-indices option set to false.
2022-01-26 17:55:42 +00:00
Sophie Brun b9b32ad41f
Harmonize menu entries (uefi / bios) and add a variable for the templates 2022-01-26 11:13:30 +01:00
Roland Clobus 43ef78bb34
Reproducible hooks: Regenerate initrd.img in chroot_hacks only when chroot_hooks did not regenerate it already.
Hook 1003 is replaced by 8000, which is more generic and does not need
to modify original files.
2022-01-26 08:14:26 +01:00
Roland Clobus 0183c73aba
Set the timestamp inside hdd images.
Similar to iso images, the timestamp of a file/folder inside the binary
image cannot be newer than SOURCE_DATE_EPOCH.
Also set the timestamp of the hdd image.
2022-01-22 18:16:58 +01:00
Roland Clobus 62f3d7bf55
Set the timestamp of the generated iso image. 2022-01-22 18:16:54 +01:00
Roland Clobus 2e5e565367
When update-initramfs is called, clean up the backup files.
This removes the unnecessary vmlinuz.old and initrd.img.old files in the
root folder of the generated image.
2022-01-22 17:58:09 +01:00
Roland Clobus 06ee64b16a
Reactivate '--chroot-filesystem plain'.
This previously undocumented value for '--chroot-filesystem' creates the
uncompressed folder 'live/filesystem.dir'.
This will speed up the generation of live images a lot, because the
squashfs compression is skipped.

Example command line:
  lb config -b hdd --chroot-filesystem plain --binary-filesystem ext4
2022-01-22 17:53:38 +01:00
Roland Clobus 2bfdb3cb44
Bugfix: The arguments to the 'tr' command must be quoted. 2022-01-08 13:39:48 +01:00
Roland Clobus eed8d293b1
Bugfix: Do not copy the content of e.g. /dev/shm when creating hdd
images

Discovered when building with '--binary-image hdd' on /dev/shm
2022-01-08 10:33:55 +01:00
Roland Clobus 8f763ee8b1
Bugfix: Add missing package when systemd is active
The package might be missing when building with a minimal configuration,
as recommended in the Live Manual, the example 'Base image' scenario:
'lb config --apt-recommends false --debootstrap-options "--variant=minbase"'
2022-01-08 10:27:50 +01:00
Ryan Finnie 5da4ff53be
Add initial riscv64 support
Notes:
- No bootloader is configured; images must be booted via direct kernel
  - Tested via qemu + opensbi fw_jump.elf + kernel/initrd
- As riscv64 is currently in ports, the following options are required:
    --distribution unstable
    --mirror-bootstrap http://ftp.ports.debian.org/debian-ports/
    --security false
    --debootstrap-options --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg
- Normally ports require stacking two dists, unstable and unreleased.
  debootstrap does not support doing this, but as of this writing, there
  is nothing in riscv64 unreleased which is required to bootstrap.
  However, this would not have been possible a year ago.
2021-11-14 09:22:41 -08:00
Roland Clobus d6a5a1f3cf
Simpler handling of http proxies
There are two main scenarios:
1) The host with live-build is configured to use a proxy
   This proxy will automatically be used by live-build
2) The user of live-build explicitly specifies a proxy
2A) With the environment variable 'http_proxy' (preferred)
2B) With the command line option --apt-http-proxy

Any inconsistency in the setting of a proxy results in an error message of 'lb config'
All internal tools (apt/apt-get/aptitude, wget and debootstrap) use the environment variables 'http_proxy' and 'no_proxy', which are passed along to the chroot where needed.

Test scenario:
- A virtual machine with all out-going traffic blocked, except for the proxy.
2021-09-23 13:53:49 +02:00
Roland Clobus 7264a752bb
The support for FTP proxies has ended 2021-09-08 13:40:53 +02:00
David Hewitt bd2a0e971b
binary_grub-efi: Allow removal of protected packages 2021-08-04 16:02:06 +01:00
Thore Sommer 1cd901cfa2 Enable dm-verity support also for ext filesystems
Those need a block size of 4k to work.
2021-07-19 11:52:09 +02:00
Thore Sommer 0f53b8ed20 Adding dm-verity support for rootfs
This adds support for dm-vertiy on the root filesystem.
Currently only squashfs is supported.

Three new flags are introduced.
 * --dm-verity: Enable basic dm-verity support
 * --dm-verity-fec NB_ROOTS: Enable forward error correction. Optional
 * --dm-verity-sign SCRIPT: Specify signing script for the root hash. Optional
2021-07-11 10:33:48 +02:00
Roland Clobus 3cc60e4f64 Removed filesystem.size for squashfs images.
See for more details https://lists.debian.org/debian-live/2021/03/msg00008.html
2021-03-29 09:08:35 +00:00
Roland Clobus 745b2be876
Fixed handling of checksums in combination with the d-i installer.
1) lb config rejected multiple checksum types
2) When using the installer, cdrom-checker requires a md5 checksum file,
   use 'Check the integrity of the installation media' in the installer
3) The comments in the first lines of the checksum files caused
   cdrom-checker to fail the integrity of the image
2021-03-21 12:32:54 +01:00
Ryan Finnie 8a8e11e5d1 No mksquashfs progress bar if stdin is not a terminal
Explicitly documented updated conditional, as "-t" is not a
commonly seen shell test.
2021-02-18 08:48:27 +00:00
Ryan Finnie a0400b2499
Use --apt-http-proxy/--apt-ftp-proxy for debootstrap 2021-02-17 22:02:47 -08:00
Roland Clobus 2c7c90487a
mkfs.msdos needs at most 32 bits for the -i argument.
Use the hexadecimal version of SOURCE_DATE_EPOCH, limited to the lower 32 bits
2021-02-16 21:22:12 +01:00
Luca Boccassi b968e2c0f7 Fix build on architecture without syslinux
Don't run xorriso with -isohybrid-mbr if LB_BOOTLOADER_BIOS is
not set to syslinux

Closes: #982746
2021-02-14 21:38:19 +00:00
Roland Clobus a37cbcb574
lilo is not available any more in Bullseye (and newer), see #973850 2021-02-10 21:47:22 +01:00
Roland Clobus c9cf409e83
The local LIVE_BUILD wins over the system live-build for the list of udeb exclusions 2021-02-10 21:47:22 +01:00
Roland Clobus 01dc99e528
The local LIVE_BUILD wins over the system live-build for the list of udeb inclusions. Only copy when the distribution is known 2021-02-10 21:47:20 +01:00
Ryan Finnie 5c838744d6
binary_syslinux: Do not modify grub theme.txt if grub/splash.png exists
If grub/splash.png exists, assume the configuration editor intends
to have a grub-specific splash.png, and do not modify theme.txt.
But if syslinux has the only known splash.png, use it for both
syslinux and grub.

(This allows for a hybrid image where the grub side can have e.g. a
16:9 1920x1080 splash.png which gets grub is capable of automatically
scaling, while the syslinux side has a 640x480 splash.png which
effectively must be this fixed size.)
2021-01-30 21:58:09 -08:00
Raphaël Hertzog 4111df43bd
Fix a small info message 2021-01-21 08:28:38 +01:00
Roland Clobus d145b0c9ec Bugfix: do not create /dev/lock and /dev/lock-frontend 2021-01-17 14:06:11 +00:00
Marcel Partap fdcdab72dc binary_rootfs stage: slightly lower mksquashfs nice levels (19 -> 17)
.. so its priority is low, but above BOINC grid computing (19).
2021-01-16 17:14:17 +01:00
Marcel Partap 0252065950 binary_rootfs stage: disable mksquashfs progress bar only in quiet mode 2021-01-16 17:09:52 +01:00
Marcel Partap 63c1a5997d binary_rootfs stage: give custom MKSQUASHFS_OPTIONS precedence
courtesy of
sed -i -r '/MKSQUASHFS_OPTIONS/ s/"(\$\{.*\}) ([^"]+)"/"\2 \1"/' scripts/build/binary_rootfs
2021-01-15 22:32:14 +01:00
Roland Clobus 91e1e65c87 Apply SOURCE_DATE_EPOCH to newly generated files and create a log 2021-01-15 09:22:29 +00:00
Roland Clobus 5636820be5 Set timestamp in embedded files of the installer 2021-01-15 09:22:29 +00:00
Roland Clobus 15fab34ea2 Set timestamp embedded in EFI files 2021-01-15 09:22:29 +00:00
Roland Clobus 2b0559fd11 Use SOURCE_DATE_EPOCH for the partition-id of /boot/grub/efi.img 2021-01-15 09:22:29 +00:00
Roland Clobus 760684b1e2 Use SOURCE_DATE_EPOCH for the partition-id of /efi.img 2021-01-15 09:22:29 +00:00
Roland Clobus 9712c46cff Use SOURCE_DATE_EPOCH for 'now' in .disk/info 2021-01-15 09:22:29 +00:00
Roland Clobus 0202f17cad Use SOURCE_DATE_EPOCH for 'now' in the boot splash image 2021-01-15 09:22:29 +00:00
Roland Clobus 9d24051669 SOURCE_DATE_EPOCH is always set 2021-01-15 09:22:29 +00:00
Jan Kot 954d9c7c31 bootstrap_debootstrap: change debootstrap path to /usr/sbin/debootstrap
As we're checking if debootstrap is present on the host machine, we should look for it in /usr/sbin and not ./bin
2021-01-13 12:39:07 +00:00
Raphaël Hertzog f13273368a
Don't fail if one of the package lists expands to an empty list
When a package lists contains only packages protected by a test
that doesn't match for the current run, then Expand_package_list
outputs nothing and the following "grep -v" fails because it
has not filtered anything. Avoid this by protecting the "grep -v"
call with "|| true".
2021-01-12 14:48:27 +01:00
Roland Clobus 831da55c01
Preserve timestamps 2021-01-11 14:34:11 +01:00
Roland Clobus 037e93fe37 Preserve timestamps 2021-01-01 16:51:02 +00:00
Roland Clobus 3f7dd00fcb Delay resolving the timestamp for the ISO volume to the moment the ISO-image is created 2020-12-13 20:33:24 +00:00
Roland Clobus edb12253eb
Bugfix: use minutes instead of month in the time of the modification date field 2020-12-13 11:11:55 +01:00
Roland Clobus 4eae44d13d
Bugfix: use minutes instead of month in the time of the modification date field 2020-12-07 08:36:42 +01:00
Matthijs Kooijman e772dfd6d2 binary_iso: Execute mkdir binary/.disk before writing to it
Before commit 9f3e5fe8d (Fix the way the .disk/mkisofs file is created)
all these commands (`mkdir`, write to `binary/.disk/mkisofs` and
`xorriso`) were in the same `binary.sh` script. Since that commit, the
write was extracted, to prevent issues with quoting, but the related
mkdir was left in `binary.sh`. This means that the write is now executed
first, and the `mkdir` only afterwards, making the `mkdir` quite pointless.

In practice, this did not break becaue binary_disk also does the same
`mkdir` and runs before `binary_iso`, but if one runs commands manually
and skips `binary_iso`, then this does break.

Even though this is not really a supported usecase, just move the mkdir
outside of `binary.sh`, so it runs *before* the write again as intended.
2020-11-24 12:24:14 +01:00
Roland Clobus 6e4e10f071 Bugfix: LB_DERIVATIVE was used the wrong way around 2020-11-18 17:11:59 +01:00
Thore Sommer 7360d50fa6 Added the option to include files before and after package installation
Moved includes.chroot to includes.chroot_after_packages and added
includes.chroot_before_packages. includes.chroot does still work as before.

We also now use rsync for copying files if it is installed.
This improves runtime and space consumption for large includes.

Gbp-Dch: Short
Closes: #927128
2020-10-27 15:07:11 +00:00
Thore Sommer 7b19209aae Option for using systemd-nspawn instead of chroot for hooks.
Installation of flatpaks doesn't work with normal chroots.
This patch enables support for using systemd-nspawn in hooks.

Gbp-Dch: Short
Closes: #965953
2020-10-12 18:26:16 +00:00
Thore Sommer 9a26533a06 Add option to change compression algorithm and level for squashfs. 2020-10-12 13:35:16 +00:00
Marcel Partap ce39f3e507 For 32bit UEFI secure boot, the package name is grub-efi-ia32-signed
avoids spitting out warning
> [2020-06-07 22:30:32] lb binary_grub-efi
> P: Begin preparing Grub based EFI support...
> Reading package lists...
> Building dependency tree...
> Reading state information...
> Package grub-efi-amd64-signed is not available, but is referred to by another package.
> This may mean that the package is missing, has been obsoleted, or
> is only available from another source
>
> E: Package 'grub-efi-amd64-signed' has no installation candidate
> W: UEFI Secure Boot disabled due to missing signed Grub/Shim.
2020-10-12 12:41:58 +00:00
Roland Clobus 9536a37af0 The sed -e ‘d’ commands with ‘#’ will not work, a slash is needed, fix for 7ffd2288d9 (2015-01-15) and 578dbee516 (2015-01-29) 2020-10-08 19:21:33 +00:00
Victor Gavro 990dcf2eed chroot_apt: fixed adding Pin-Priority (broken in da1fab11)
Fixes !201
2020-09-14 11:02:51 +02:00
Ryan Finnie 6b0cc5529b Enable arm64 for binary_grub_cfg
Without modification, this produces a usable config for arm64
grub-efi iso-hybrid. Tested on qemu arm64 + serial console.
2020-06-01 08:02:28 +00:00
Ryan Finnie 13cf0e9ebe
Add initial ppc64el support
Note that this does not include grub-ieee1275 support so the images will
not be bootable, but it's a first step and produces ISOs without error.
2020-05-30 14:11:45 -07:00
Lyndon Brown 263f84fe80 clean: handle all common options
support for options like `--debug` was missing.

Gbp-Dch: Short
2020-05-15 19:36:51 +00:00
Lyndon Brown fca1283147 clean: refactor
this simplifies things to avoid the messy recursion.

it is also a necessary step to implementing handling of common options
like --debug. we need to process all options to decide how to approach
doing things (e.g. with debug messages to be output or not) before actually
performing any work, in order for options like --debug to be reacted to
properly.

also, as things were, options like `--debug` were not being passed along
in the recursive executions, while now that is no longer an issue.

the order of file/folder deletions for `--all`|`--purge`|`--remove`
actions is slightly changed here, but i don't see any issue with that and
it's cleaner to not preserve that.

Gbp-Dch: Short
2020-05-15 19:36:51 +00:00
Lyndon Brown 180207d711 Revert "config: catch and report unexpected arguments"
This reverts commit 665372c19d.

the kali test failed due to their script using a hack of passing along a
custom option after an early terminator through to their auto/config file.
the change implemented here was valuable, but i'll have to look into
revising things to work with what Kali is doing.

Gbp-Dch: Ignore
2020-05-05 21:57:57 +01:00
Lyndon Brown 18eefdd6f3 s/Remove_package/Remove_packages/
it removes one or more, so should be plural for clarity

Gbp-Dch: Short
2020-05-05 19:55:28 +01:00
Lyndon Brown 919a464b64 s/Install_package/Install_packages/
it installs one or more, so should be plural for clarity

Gbp-Dch: Short
2020-05-05 19:55:28 +01:00
Lyndon Brown f27d13de08 make temporary state of installed tools recoverable
some scripts temporarily install packages to accomplish some work before
then removing them. the list of packages installed is kept in memory in a
variable.

a weakness of this design is that if a failure occurs or the user cancels,
and then following this the user re-runs `lb build`, letting it try to
pick up and recover from where it left off, that list of packages that had
been installed is lost, resulting in those packages that were installed
then being a permanent part of the chroot.

here we fix this weakness by backing up the list to a file, which is always
read from on removal. thus in a recovery situation, any packages still
installed from a situation like that just described, will be removed upon
the next use of `Remove_package()`.

this is not perfect, since we are having to wait for opportunistic
execution of the remove function. we need to find a suitable place for the
`Cleanup_temp_packages()` function to be used.

 - doing so in `Init_config_data()` would not be suitable because we don't
   hold the lock when that's run, even if we ignored the hijacking of that
   function for taking such action...
 - doing it in `Exit()` doesn't seem a good fit either.
 - putting it explicitly in every build script just seems a little messy...

perhaps a local exit trap like for removing the lock...?

note that `binary_rootfs` skips running the remove function after installing
tooling, since it just throws the wrapper chroot away, which then leaves the
file around with stale data for the next remove instance to pick up, which
then does not actually remove it because it's not installed. this is not
ideal either... perhaps the optimisation should be removed from that script?

Gbp-Dch: Short
2020-05-05 19:43:15 +01:00
Lyndon Brown 665372c19d config: catch and report unexpected arguments
after handling arguments, catch and report any remaining "non-option"
arguments.

for instance users could make the basic mistake of using
`lb config --bootloaders syslinux grub-efi`, i.e. failing to quote the
multiple bootloaders (i actually encountered a user doing this who swore
that "it just worked"). catching and reporting such mistakes could be
valuable to users.

previous behaviour:
```
$ lb config --bootloaders syslinux grub-efi
P: Updating config tree for a debian/buster/amd64 system
P: Symlinking hooks...
```

new behaviour:
```
$ lb config --bootloaders syslinux grub-efi
[2020-05-05 18:56:07] lb config --bootloaders syslinux grub-efi
E: Unexpected argument found: grub-efi
```

Gbp-Dch: Short
2020-05-05 19:02:35 +01:00
Lyndon Brown d68290058e debootstrap: fix wrong param for Check_package call
debootstrap must obviously exist in the host. we thus must pass 'host'
not 'chroot' such that a warning about needing to install it on your host
system is output, rather than it being added to a list of packages to be
installed, which never occurs in this script.

Gbp-Dch: Ignore
2020-05-05 00:52:13 +01:00