-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve error handling 3 #255
Changes from all commits
1a229d0
0ad48de
2cf99e2
e0dc8d8
601c99c
d2be7fb
792af79
bee27f0
105ae6f
53ed3b4
fcaea6e
ed17c95
c59878b
6db61f4
406f1e4
521689a
4812ce4
d39c8df
cc96e88
08f75f2
016c466
65e45e5
e11f706
7a3f1d9
14e8a82
cc891df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,16 @@ | |
# shellcheck disable=SC2317 # shellcheck has trouble understanding the code flow in this file | ||
|
||
# error_handler {{{ | ||
if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then | ||
set -e | ||
set -E | ||
set -o pipefail | ||
trap "error_handler" ERR | ||
fi | ||
set -e | ||
set -E | ||
set -o pipefail | ||
trap "error_handler" ERR | ||
# }}} | ||
|
||
bash -n /etc/debootstrap/config | ||
# shellcheck source=config | ||
. /etc/debootstrap/config || exit 1 | ||
bash -n /etc/debootstrap/variables | ||
# shellcheck source=tests/shellcheck-stub-debootstrap-variables | ||
. /etc/debootstrap/variables || exit 1 | ||
|
||
|
@@ -104,8 +104,8 @@ | |
|
||
# add security.debian.org: | ||
case "$RELEASE" in | ||
unstable|sid) ;; # no security pool available | ||
jessie|stretch|buster) | ||
unstable|sid|stretch) ;; # no security pool available | ||
jessie|buster) | ||
echo "Adding security.debian.org to sources.list." | ||
echo "deb http://security.debian.org ${RELEASE}/updates $COMPONENTS" >> /etc/apt/sources.list | ||
;; | ||
|
@@ -260,7 +260,7 @@ | |
debconf-set-selections < /etc/debootstrap/debconf-selections | ||
} | ||
|
||
if [ "$PACKAGES" = 'yes' ] ; then | ||
Check warning on line 263 in chroot-script GitHub Actions / shellcheck grml-debootstrap
|
||
PACKAGES_FILE="/etc/debootstrap/packages" | ||
|
||
if [ "$ARCH" = 'arm64' ]; then | ||
|
@@ -479,7 +479,7 @@ | |
local rootfs_mount_options="" | ||
|
||
if [ -z "${FILESYSTEM}" ] ; then | ||
FILESYSTEM="$(blkid -o value -s TYPE /dev/disk/by-uuid/"${TARGET_UUID}")" | ||
FILESYSTEM="$(blkid -o value -s TYPE /dev/disk/by-uuid/"${TARGET_UUID}")" || true | ||
fi | ||
|
||
case "${FILESYSTEM}" in | ||
|
@@ -495,8 +495,8 @@ | |
fi | ||
|
||
if [ -n "$EFI" ] ; then | ||
# shellcheck disable=SC2086 | ||
echo "UUID=$(blkid -o value -s UUID $EFI) /boot/efi vfat umask=0077 0 1" >> /etc/fstab | ||
UUID_EFI="$(blkid -o value -s UUID "$EFI")" | ||
echo "UUID=$UUID_EFI /boot/efi vfat umask=0077 0 1" >> /etc/fstab | ||
fi | ||
|
||
cat >> /etc/fstab << EOF | ||
|
@@ -621,7 +621,7 @@ | |
|
||
mkdir -p /boot/efi | ||
echo "Mounting $EFI on /boot/efi" | ||
mount "$EFI" /boot/efi || return 1 | ||
mount "$EFI" /boot/efi | ||
|
||
# if efivarfs kernel module is loaded, but efivars isn't, | ||
# then we need to mount efivarfs for efibootmgr usage | ||
|
@@ -631,7 +631,7 @@ | |
fi | ||
|
||
echo "Invoking efibootmgr" | ||
efibootmgr || return 1 | ||
efibootmgr | ||
} | ||
|
||
# grub configuration/installation {{{ | ||
|
@@ -678,7 +678,7 @@ | |
return 0 | ||
fi | ||
|
||
efi_setup || return 1 | ||
efi_setup | ||
|
||
if [ -n "$EFI" ] ; then | ||
GRUB_PACKAGE=grub-efi-amd64 | ||
|
@@ -805,8 +805,9 @@ | |
initrd grub_install passwords \ | ||
custom_scripts upgrade_system remove_apt_cache services \ | ||
remove_chrootmirror; do | ||
if stage $i ; then | ||
$i && stage $i 'done' || exit 1 | ||
if stage "$i" ; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leaving the comment here, since on GitHub one sadly can't seem to comment on the commit message itself, AFAICS: the change itself LGTM, though please use something like "chroot-script: properly quote stage execution code" in the commit message There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means I should leave most commit messages as is but modify this specific commit message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be more than happy to get nice commit messages! This one only clearly jumped into my eye :) So please feel free and invited to the reword your commit messages (and also squash logically related commits!), so they tell a nice story when going through them, but also have a (somewhat) nice state/story for debian/changelog (the first line of each commit message message shows up there by default when I release a new version, see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was about to suggest, I was hoping, all of these commits could be squashed into 1. These changes aren't really interesting for users. Just "improved error handling". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I rewrote this commit message, grouped together and also improved other commit messages. |
||
"$i" | ||
stage "$i" 'done' | ||
fi | ||
done | ||
# always execute the finalize stage: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this change makes sense? stretch is in between jessie and buster (see https://wiki.debian.org/DebianReleases)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I am sure. The repository is defunct but not worth reporting upstream to Debian because that suite is end of life.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but then at least jessie should be affected as well, nor? :)
Also see http://archive.debian.org/debian-security/dists/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, I agree. It should also be affected. But in practice, it's not as I could see from the CI tests. I don't have an explanation why it is as is. I just noticed that oddly 1 Debian security repository for an EOL suite is broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Porting to
archive.debian.org
might fix this issue but lets consider that a separate issue that is not worth doing for an EOL suite? :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that not enabling security repository for stretch didn't reduce the security or change installed packages.
archive.debian.org
might be required.