summaryrefslogtreecommitdiff
path: root/functions/exit.sh
AgeCommit message (Collapse)Author
2020-03-17exit: fix missing local scopeLyndon Brown
missed in c55eb8a0c3ca5b8ed1081e7eb8a423563288fb58 Gbp-Dch: Ignore
2020-03-13exit: don't convert numeric exit code to stringLyndon Brown
2020-03-13exit: ensure an appropriate message is printed on unexpected exitLyndon Brown
if a script exits due to a failure and `set -e`, we should ensure that an error message is printed to be clear to the user that something actually went wrong. similarly it would be good to print a suitable message should the user cancel with ctrl+c for instance. Gbp-Dch: Short
2020-03-11amend copyright & licensing blocksLyndon Brown
Current versions of the project files are built upon versions published and licensed by Daniel Baumann, but are modified copies of those files and thus need to be marked as such per licensing requirements (afaik he did not pass along ownership / licensing rights to anyone when he left the project). We should also be careful to not be misrepresenting such modified copies as being attributed to Daniel. Adding a new copyright line referring to "The Debian Live team" should suffice for this. The authorship block in man pages has also similarly been updated. Notes: - tweaked a copy of daniel copyright lines stating 2014 instead of 2015. both of these cases were in files that i had personally introduced in some of my past merged commits that moved some code around. i don't know why they stated 2014. - binary_onie was introduced in 2018, so that has a 2018 date instead of 2016 unlike the rest. - 'efi-image' is a 3rd-party (Canonical Ltd) work that we bundle, but it has been modified by 674794a8f4d61a729d2dbd6d99385d2826138694 and 36a3ba76347ef72df1c316312ed3a26aa4b0c816 so I similarly added a debian live copyright line. - 'grub-cpmodules' is similar. it was only changed by the indentation fix of 36a3ba76347ef72df1c316312ed3a26aa4b0c816 but modification is modification, and this does help cover any possible future changes that might be made.
2020-03-11exit: fix no /usr/bin/env errorLyndon Brown
if you execute the bootstrap stage with no internet connection, you get the following output: ``` [2020-03-10 19:18:46] lb bootstrap P: Setting up clean exit handler [2020-03-10 19:18:46] lb bootstrap_cache restore [2020-03-10 19:18:46] lb bootstrap_debootstrap P: Begin bootstrapping system... P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy. P: Running debootstrap (download-only)... I: Retrieving InRelease I: Retrieving Release E: Failed getting release file http://deb.debian.org/debian/dists/buster/Release P: Begin unmounting filesystems... P: Saving caches... chroot: failed to run command ‘/usr/bin/env’: No such file or directory ``` the last line looked suspicious. investigating it turns out that there was a deficiency in the exit handler. when debootstrap fails to download what it needs due to lack of a connection, that failure due to `set -e` causes the Exit() handler to kick in. Part of this includes outputting the "Saving caches..." line, before then making a call to Save_package_cache(). That in turn runs the following command: ``` Chroot chroot "apt-get autoclean" || true ``` The Chroot() function includes a line starting with: ``` ${_LINUX32} chroot "${CHROOT}" /usr/bin/env ``` which is the source of the last output line. the reason we see this unexpected output is that with bootstrapping having failed, there is no /usr/bin/env within the chroot so it is bound to fail. the fact is, the exit handler has no business trying to pretty much anything that it does if the bootstrap_debootstrap stage has not completed. this implements such a restriction and thus resolves the problem of this unexpected and confusing output in the described situation. we will now see: ``` [2020-03-10 19:18:46] lb bootstrap P: Setting up clean exit handler [2020-03-10 19:18:46] lb bootstrap_cache restore [2020-03-10 19:18:46] lb bootstrap_debootstrap P: Begin bootstrapping system... P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy. P: Running debootstrap (download-only)... I: Retrieving InRelease I: Retrieving Release E: Failed getting release file http://deb.debian.org/debian/dists/buster/Release ```
2020-03-10tidy script init (2/4) - build stage scriptsjnqnfe
Partial fix for #952919 Gbp-Dch: Short
2020-03-05cache: clarify and simplify package cache save/restorejnqnfe
These functions are specific to handling packages stored in the cache, not other files. They are also always used with the same `cache/packages.` prefix to the path. Gbp-Dch: Short Closes: #952916
2020-03-05don't unnecessarily convert exit codes to stringsLyndon Brown
Closes: #952861
2015-01-04Updating year in copyright notices to 2015.Daniel Baumann
2014-02-08Updating copyright notices for 2014.Daniel Baumann
2013-05-06Removing all references to my old email address.Daniel Baumann
2013-05-06Updating year in all copyright notices.Daniel Baumann
2013-05-06Adding debian version 4.0~a1-1.debian/4.0_a1-1Daniel Baumann
2013-01-01Updating year in all copyright notices.Daniel Baumann
2012-11-14Fixing typo in cache directory names, thanks to Thanatermesis ↵Ben Armstrong
<thanatermesis@gmail.com>.
2012-07-30Updating GPL standard header in all files.Daniel Baumann
2012-06-03Renaming internal .stage to .build for consistency within the configuration ↵Daniel Baumann
tree.
2012-02-06Updating year in copyright notices for 2012.Daniel Baumann
2012-02-06Applying patch from Ivailo Monev to remove stage files for ↵Daniel Baumann
pseudo-filesystems helpers in exit function.
2012-01-10Unmount /root/config in case of error.Matthijs Kooijman
When there is an error, the Exit() handler unmounts filesystems within the chroot. This adds /root/config to the list used when /proc/mounts is not available.
2011-09-07Correcting wrong spelling of cache in exit function, thanks to David Endler ↵Daniel Baumann
for spotting it.
2011-07-19Saving packages in cache even when failing or interrupting a build (Closes: ↵Daniel Baumann
#586929).
2011-03-09Updating year in hooks and script files.Daniel Baumann
2011-03-09Removing last live-helper remains in internal variables.Daniel Baumann
2011-03-09Adding debian version 3.0~a1-1.Daniel Baumann
2011-03-09Updating year in manpage, hooks, script and template files.Daniel Baumann
2011-03-09Removing last live-helper remains in internal variables.Daniel Baumann
2011-03-09Updating copyright headers for live-build.Daniel Baumann
2011-03-09Also (try) unmounting /dev/shm in exit function.Daniel Baumann
2011-03-09Updating year to 2010 in copyright notices.Daniel Baumann
2011-03-09Making unmount routines a bit more robust.Daniel Baumann
2011-03-09For consistency, using true|false instead of enabled|disabled in ↵Daniel Baumann
configuration options.
2011-03-09Returning error value of the last process before exiting (Closes: #527331).Daniel Baumann
2011-03-09Unmounting all mounts in chroot.Cody A.W. Somerville
2011-03-09Updating year in copyright notices for 2009.Daniel Baumann
2011-03-09Generalizing internal LH_DEBUG variable.Daniel Baumann
2011-03-09Updating signals in exit and lockfile traps.Daniel Baumann
2011-03-09Don't use set -e in sourced functions, this is the job of the actual ↵Daniel Baumann
executed script.
2011-03-09Print message when Exit is called.Chris Lamb
2011-03-09Add utility function to call 'Exit' when script exits.Chris Lamb
2011-03-09Adding unmount calls for pseudo-filesystems in Exit();.Daniel Baumann
2011-03-09Removing LIVE_* grep from Exit(); as we have switched to LH_* variables long ↵Daniel Baumann
time ago.
2011-03-09Updating copyright years to 2008.Daniel Baumann
2011-03-09Adding live-helper 1.0~a7-1.Daniel Baumann
2011-03-09Adding live-helper 1.0~a6-1.Daniel Baumann