Skip to content

Arraybolt3/better grub efi#1

Open
adrelanos wants to merge 9 commits into
masterfrom
arraybolt3/better-grub-efi
Open

Arraybolt3/better grub efi#1
adrelanos wants to merge 9 commits into
masterfrom
arraybolt3/better-grub-efi

Conversation

@adrelanos

Copy link
Copy Markdown

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
Comment thread grml-debootstrap
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}"

Copy link
Copy Markdown

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

Comment thread grml-debootstrap
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}"

Copy link
Copy Markdown

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

Comment thread grml-debootstrap

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

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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

Comment thread grml-debootstrap
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}"

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Author

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

@ArrayBolt3

Copy link
Copy Markdown

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