Re: Some troubles with grub with buster point release 10.8

Carsten Aulbert <[email protected]>
Newsgroups gmane.linux.debian.fai
Message-ID <[email protected]>

On 08.02.21 11:21, Thomas Lange wrote:
> I also have some machines that are stuck because of this. I wonder why
> not all machines are affected.
> 

so far - as almost all our machine use gpt or gpt-bios disk labels, we 
use the attach script to fix the issue (obviously not 100% fail-save) 
but should be close enough (for us).

Please use at your own risk :)

Cheers

Carsten
grub_debconf.sh (application/x-shellscript, 924 B)
#!/bin/bash

join() {
  local _sep="$1"
  shift
  local _f="$1"
  shift
  printf "%s" "$_f" "${@/#/$_sep}"
}

declare -a GRUB_LIST

# do not act, if debconf value is already set
if debconf-show grub-pc| grep -q '* grub-pc/install_devices:'
then
    echo "grub-pc/install_devices already set, not acting"
    exit 1
fi

# loop over all ATA devices
# hopefully, this will capture all of the vital disks
for i in $(ls /dev/disk/by-id/ata*|grep -v part)
do
    if parted "$i" print | grep -q bios_grub
    then
        GRUB_LIST+=("$i")
    fi
done

# bail out if nothing was found
if (( "${#GRUB_LIST[@]}" < 1 ))
then
    echo "No disks with bios_grub partition found"
    exit 1
fi


# set grup-pc debconf and try fixing the package upgrade
echo "grub-pc grub-pc/install_devices multiselect $(join ', ' "${GRUB_LIST[@]}")" | debconf-set-selections

for d in "${GRUB_LIST[@]}"
do
    ls -l "$d"
done

apt-get -f install
exit 0
smime.p7s (application/pkcs7-signature, 5.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.