mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
some grub fixes and added md superblock cleaning check
This commit is contained in:
parent
e90d7f3fb8
commit
ea3720082c
1 changed files with 13 additions and 3 deletions
|
@ -461,7 +461,7 @@ remove_grub_dmraid_hack(){
|
||||||
mapdev() {
|
mapdev() {
|
||||||
partition_flag=0
|
partition_flag=0
|
||||||
device_found=0
|
device_found=0
|
||||||
devs=$(cat /tmp/dev.map | grep -v fd | sed 's/ *\t/ /' | sed ':a;$!N;$!ba;s/\n/ /g')
|
devs=$(cat /tmp/dev.map | grep -v /dev/fd | sed 's/ *\t/ /' | sed ':a;$!N;$!ba;s/\n/ /g')
|
||||||
# check if we use hd or sd device
|
# check if we use hd or sd device
|
||||||
if ! [ "$(echo $1 | grep /dev/sd)" -o "$(echo $1 | grep /dev/hd)" ]; then
|
if ! [ "$(echo $1 | grep /dev/sd)" -o "$(echo $1 | grep /dev/hd)" ]; then
|
||||||
linuxdevice=$(echo $1 | sed -e 's#p[0-9].*$##')
|
linuxdevice=$(echo $1 | sed -e 's#p[0-9].*$##')
|
||||||
|
@ -700,6 +700,16 @@ _stopmd()
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
DISABLEMDSB=""
|
||||||
|
if [ "$(blkid -c=/dev/null | grep "TYPE=\"mdraid\"")" ]; then
|
||||||
|
DIALOG --defaultno --yesno "Setup detected superblock of raid devices, do you want to clean the superblock of them?" 0 0 && DISABLEMDSB="1"
|
||||||
|
if [ "$DISABLEMDSB" = "1" ]; then
|
||||||
|
DIALOG --infobox "Cleaning superblocks of all software raid devices..." 0 0
|
||||||
|
for i in $(blkid -c=/dev/null | grep "TYPE=\"mdraid\"" | sed -e 's#:.*##g'); do
|
||||||
|
mdadm --zero-superblock $i > $LOG
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable all lvm devices
|
# Disable all lvm devices
|
||||||
|
@ -2617,9 +2627,9 @@ dogrub() {
|
||||||
subdir="/boot"
|
subdir="/boot"
|
||||||
fi
|
fi
|
||||||
# keep the file from being completely bogus
|
# keep the file from being completely bogus
|
||||||
if [ "$grubdev" = "DEVICE NOT FOUND" ]; then
|
if [ "$_grubdev" = "DEVICE NOT FOUND" ]; then
|
||||||
DIALOG --msgbox "Your root boot device could not be autodetected by setup. Ensure you adjust the 'root (hd0,0)' line in your GRUB config accordingly." 0 0
|
DIALOG --msgbox "Your root boot device could not be autodetected by setup. Ensure you adjust the 'root (hd0,0)' line in your GRUB config accordingly." 0 0
|
||||||
grubdev="(hd0,0)"
|
_grubdev="(hd0,0)"
|
||||||
fi
|
fi
|
||||||
NUMBER=0
|
NUMBER=0
|
||||||
# create default grub entries
|
# create default grub entries
|
||||||
|
|
Loading…
Reference in a new issue