Skip to content
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

Arraybolt3/better grub efi #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

adrelanos
Copy link
Member

For CI testing.

Thanks to @ArrayBolt3!

mika and others added 9 commits November 29, 2024 14:22
When booting Grml from a YUMI device (see https://yumiusb.com/) which
was built with Ventoy, then executing `blkid -s TYPE -o value /dev/dm-0p1` might fail, if ventoy is behind the /dev/dm-0p1:

| root@grml:~# dmsetup ls
| ventoy  (253:0)

Fixes:

++ for i in $AVAILABLE_PARTITIONS
+++ blkid -s TYPE -o value /dev/dm-0p1
++++ error_handler
++++ last_exit_code=2
++++ last_bash_command='blkid -s TYPE -o value "$i" 2> /dev/null'
++++ echo 'Unexpected non-zero exit code 2 in /usr/sbin/grml-debootstrap /usr/sbin/grml-debootstrap /usr/sbin/grml-debootstrap /usr/sbin/grml-debootstrap at line 744 1151 1166 0 detected!
last bash command: blkid -s TYPE -o value "$i" 2> /dev/null'
++++ '[' -r /mnt/debootstrap.5465/debootstrap/debootstrap.log ']'

Thanks to klatls for the bug report
interactive mode: ignore failures when identifying file system fails
if [ -n "${grub_pc_package_name}" ]; then
if ! clean_chroot "${MNTPOINT}" dpkg --list "${grub_pc_package_name}" 2>/dev/null | grep -q '^ii' ; then
echo "Notice: ${grub_pc_package_name} package not present yet, installing it therefore."
clean_chroot "$MNTPOINT" DEBIAN_FRONTEND=$DEBIAN_FRONTEND apt-get -y --no-install-recommends install $DPKG_OPTIONS "${grub_pc_package_name}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

if [ -n "${grub_pc_package_name}" ]; then
if ! clean_chroot "${MNTPOINT}" dpkg --list "${grub_pc_package_name}" 2>/dev/null | grep -q '^ii' ; then
echo "Notice: ${grub_pc_package_name} package not present yet, installing it therefore."
clean_chroot "$MNTPOINT" DEBIAN_FRONTEND=$DEBIAN_FRONTEND apt-get -y --no-install-recommends install $DPKG_OPTIONS "${grub_pc_package_name}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

mkdir -p "${MNTPOINT}"/boot/efi
mount -t vfat "${EFI_TARGET}" "${MNTPOINT}"/boot/efi

if [ -z "${EFI_ID}" ]; then
EFI_ID="$(
source "${MNTPOINT}"/etc/default/grub

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: ./etc/default/grub: openBinaryFile: does not exist (No such file or directory) SC1091

source "${MNTPOINT}"/etc/default/grub
for file in "${MNTPOINT}"/etc/default/grub.d/*.cfg; do
if [ -f "${file}" ]; then
source "${file}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
ShellCheck can't follow non-constant source. Use a directive to specify location. SC1090

if [ -n "${grub_pc_package_name}" ]; then
if ! clean_chroot "${MNTPOINT}" dpkg --list "${grub_pc_package_name}" 2>/dev/null | grep -q '^ii' ; then
echo "Notice: ${grub_pc_package_name} package not present yet, installing it therefore."
clean_chroot "$MNTPOINT" DEBIAN_FRONTEND=$DEBIAN_FRONTEND apt-get -y --no-install-recommends install $DPKG_OPTIONS "${grub_pc_package_name}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shellcheck (suggestion)] reported by reviewdog 🐶

Suggested change
clean_chroot "$MNTPOINT" DEBIAN_FRONTEND=$DEBIAN_FRONTEND apt-get -y --no-install-recommends install $DPKG_OPTIONS "${grub_pc_package_name}"
clean_chroot "$MNTPOINT" DEBIAN_FRONTEND="$DEBIAN_FRONTEND" apt-get -y --no-install-recommends install "$DPKG_OPTIONS" "${grub_pc_package_name}"

@ArrayBolt3
Copy link

It's worth noting that grml-debootstrap is not Shellcheck-compliant. Does this CI use exactly the same settings that grml-debootstrap uses?

@adrelanos
Copy link
Member Author

Yes. Exactly the same setting. I simply forked the repository, fetched your branch and pushed it here.

@ArrayBolt3
Copy link

It looks like the CI used by upstream only ran a small subset of those tests, including not having very strict Shellcheck rules and not testing stretch (the only reason bullseye failed was because of a flaky network connection it appears). So I don't think there are problems here. (Aside from the fact that I'd like all of grml-debootstrap to be Shellcheck-compliant, but... that's an undertaking all of its own.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants