live-build/scripts/build
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
..
binary rename binary_loopback_cfg to binary_grub_cfg 2020-05-04 22:15:09 +01:00
binary_checksums config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/ 2020-04-23 16:54:31 +00:00
binary_chroot stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
binary_disk disk_info: obey new UTC timestamp control 2020-05-03 23:20:39 +01:00
binary_grub_cfg rename binary_loopback_cfg to binary_grub_cfg 2020-05-04 22:15:09 +01:00
binary_grub-efi rename binary_loopback_cfg to binary_grub_cfg 2020-05-04 22:15:09 +01:00
binary_grub-legacy config: improve BIOS/EFI bootloader selection handling 2020-05-04 21:40:13 +01:00
binary_grub-pc rename binary_loopback_cfg to binary_grub_cfg 2020-05-04 22:15:09 +01:00
binary_hdd config: improve BIOS/EFI bootloader selection handling 2020-05-04 21:40:13 +01:00
binary_hooks stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
binary_includes config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
binary_iso binary_iso: properly handle multiple bootloaders 2020-05-04 21:48:03 +01:00
binary_linux-image rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_loadlin rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_manifest config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/ 2020-04-23 16:54:31 +00:00
binary_memtest rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_netboot config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
binary_onie config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
binary_package-lists rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_rootfs rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_syslinux config: improve BIOS/EFI bootloader selection handling 2020-05-04 21:40:13 +01:00
binary_tar config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
binary_win32-loader rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
binary_zsync config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
bootstrap bootstrap_archives: remove useless param 2020-04-23 09:38:02 +00:00
bootstrap_archives bootstrap_archives: remove useless param 2020-04-23 09:38:02 +00:00
bootstrap_cache adjust action arg consumption order 2020-05-03 01:31:47 +01:00
bootstrap_debootstrap debootstrap: fix wrong param for Check_package call 2020-05-05 00:52:13 +01:00
build extend config validation to all build components 2020-05-04 13:26:19 +01:00
chroot chroot_prep: expand coverage 2020-04-23 09:38:02 +00:00
chroot_apt adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_archives archives: output actual error for bad pass param 2020-05-03 01:31:47 +01:00
chroot_cache adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_debianchroot adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_devpts adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_dpkg adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_firmware firmware: robustify and simplify archive area checking 2020-04-23 15:46:43 +02:00
chroot_hacks config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
chroot_hooks stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_hostname adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_hosts adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_includes stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_install-packages stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_interactive stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_linux-image stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_package-lists rename LB_ARCHITECTURES to LB_ARCHITECTURE 2020-04-23 15:54:19 +02:00
chroot_prep improve stagefiles encapsulation 2020-05-02 14:49:45 +01:00
chroot_preseed stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
chroot_proc adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_resolv adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_selinuxfs adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_sysfs adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_sysv-rc adjust action arg consumption order 2020-05-03 01:31:47 +01:00
chroot_tmpfs adjust action arg consumption order 2020-05-03 01:31:47 +01:00
clean make temporary state of installed tools recoverable 2020-05-05 19:43:15 +01:00
config config: catch and report unexpected arguments 2020-05-05 19:02:35 +01:00
efi-image amend copyright & licensing blocks 2020-03-11 13:51:19 +00:00
grub-cpmodules amend copyright & licensing blocks 2020-03-11 13:51:19 +00:00
installer chroot_prep: expand coverage 2020-04-23 09:38:02 +00:00
installer_debian-installer config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ 2020-04-23 16:54:31 +00:00
installer_preseed strip progress-linux distro hacks 2020-03-20 10:19:33 +00:00
source chroot_prep: expand coverage 2020-04-23 09:38:02 +00:00
source_checksums config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/ 2020-04-23 16:54:31 +00:00
source_debian config: improve BIOS/EFI bootloader selection handling 2020-05-04 21:40:13 +01:00
source_disk disk_info: obey new UTC timestamp control 2020-05-03 23:20:39 +01:00
source_hdd config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/ 2020-04-23 16:54:31 +00:00
source_hooks stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
source_iso config: fix stale live-build version in iso-preparer 2020-05-03 23:20:39 +01:00
source_live stagefiles: s/Require_stagefile/Require_stagefiles/ 2020-03-17 22:59:37 +00:00
source_tar config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/ 2020-04-23 16:54:31 +00:00