mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
'added more raid checks'
This commit is contained in:
parent
c7a4c2ae6f
commit
8a4a388dca
2 changed files with 37 additions and 12 deletions
|
@ -93,9 +93,9 @@ if [ $? -gt 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
### HACK to fix infofiles in bash and texinfo!
|
### HACK to fix infofiles in bash and texinfo!
|
||||||
echo "Workaround for fixing bash and texinfo infofiles..."
|
#echo "Workaround for fixing bash and texinfo infofiles..."
|
||||||
$PACMAN -S texinfo 2>&1 >> /tmp/pacman.log
|
#$PACMAN -S texinfo 2>&1 >> /tmp/pacman.log
|
||||||
$PACMAN -S bash 2>&1 >> /tmp/pacman.log
|
#$PACMAN -S bash 2>&1 >> /tmp/pacman.log
|
||||||
|
|
||||||
umount $DESTDIR/proc $DESTDIR/sys $DESTDIR/dev
|
umount $DESTDIR/proc $DESTDIR/sys $DESTDIR/dev
|
||||||
|
|
||||||
|
|
|
@ -987,8 +987,8 @@ installpkg() {
|
||||||
echo -e "\nPackage Installation Complete." >>/tmp/pacman.log
|
echo -e "\nPackage Installation Complete." >>/tmp/pacman.log
|
||||||
fi
|
fi
|
||||||
### HACK to fix infofiles in bash and texinfo!
|
### HACK to fix infofiles in bash and texinfo!
|
||||||
[ "$(echo $PACKAGES | grep texinfo)" ] && $PACMAN -S texinfo 2>&1 >> /tmp/pacman.log
|
#[ "$(echo $PACKAGES | grep texinfo)" ] && $PACMAN -S texinfo 2>&1 >> /tmp/pacman.log
|
||||||
[ "$(echo $PACKAGES | grep bash)" ] && $PACMAN -S bash 2>&1 >> /tmp/pacman.log
|
#[ "$(echo $PACKAGES | grep bash)" ] && $PACMAN -S bash 2>&1 >> /tmp/pacman.log
|
||||||
rm /tmp/setup-pacman-running
|
rm /tmp/setup-pacman-running
|
||||||
) &
|
) &
|
||||||
|
|
||||||
|
@ -1289,6 +1289,7 @@ dogrub() {
|
||||||
_grubdev=""
|
_grubdev=""
|
||||||
bootdev=""
|
bootdev=""
|
||||||
grubdev=""
|
grubdev=""
|
||||||
|
redundant=""
|
||||||
getrootfs
|
getrootfs
|
||||||
getraidarrays
|
getraidarrays
|
||||||
get_grub_map
|
get_grub_map
|
||||||
|
@ -1298,20 +1299,40 @@ dogrub() {
|
||||||
fi
|
fi
|
||||||
# try to auto-configure GRUB...
|
# try to auto-configure GRUB...
|
||||||
if [ "$PART_ROOT" != "" -a "$S_GRUB" != "1" ]; then
|
if [ "$PART_ROOT" != "" -a "$S_GRUB" != "1" ]; then
|
||||||
|
# check if raid device is used
|
||||||
if [ "$(echo $PART_ROOT | grep md)" ]; then
|
if [ "$(echo $PART_ROOT | grep md)" ]; then
|
||||||
|
if ! [ "$(mdadm --detail $PART_ROOT | grep Level | sed -e 's#.*:\ ##g')" = "raid0" -o "$(mdadm --detail $PART_ROOT | grep Level | sed -e 's#.*:\ ##g')" = "linear" ]; then
|
||||||
|
# redundant devices
|
||||||
for i in $(mdadm --detail $PART_ROOT | grep "\ /dev/" | sed -e 's#.* /#/#g'); do
|
for i in $(mdadm --detail $PART_ROOT | grep "\ /dev/" | sed -e 's#.* /#/#g'); do
|
||||||
_grubdev="$_grubdev $(mapdev $i)"
|
_grubdev="$_grubdev $(mapdev $i)"
|
||||||
done
|
done
|
||||||
|
redundant="1"
|
||||||
else
|
else
|
||||||
|
# in raid0,linear devices are not redundant, only one device needed!
|
||||||
|
_grubdev=$(mapdev $(mdadm --detail $PART_ROOT | grep "\ /dev/" -m 1| sed -e 's#.* /#/#g'))
|
||||||
|
redundant=""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# use normal device
|
||||||
_grubdev=$(mapdev $PART_ROOT)
|
_grubdev=$(mapdev $PART_ROOT)
|
||||||
fi
|
fi
|
||||||
# look for a separately-mounted /boot partition
|
# look for a separately-mounted /boot partition
|
||||||
bootdev=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1)
|
bootdev=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1)
|
||||||
|
# check if raid device is used on /boot partition
|
||||||
if [ "$(echo $bootdev | grep md)" ]; then
|
if [ "$(echo $bootdev | grep md)" ]; then
|
||||||
|
if ! [ "$(mdadm --detail $bootdev | grep Level | sed -e 's#.*:\ ##g')" = "raid0" -o "$(mdadm --detail $bootdev | grep Level | sed -e 's#.*:\ ##g')" = "linear" ]; then
|
||||||
|
# redundant devices
|
||||||
for i in $(mdadm --detail $_bootdev | grep "\ /dev/" | sed -e 's#.* /#/#g'); do
|
for i in $(mdadm --detail $_bootdev | grep "\ /dev/" | sed -e 's#.* /#/#g'); do
|
||||||
_bootdev="$_bootdev $i"
|
_bootdev="$_bootdev $i"
|
||||||
done
|
done
|
||||||
|
redundant="1"
|
||||||
else
|
else
|
||||||
|
# in raid0,linear devices are not redundant, only one device needed!
|
||||||
|
_bootdev=$(mdadm --detail $_bootdev | grep "\ /dev/" -m 1| sed -e 's#.* /#/#g')
|
||||||
|
redundant=""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# use normal device
|
||||||
_bootdev=$bootdev
|
_bootdev=$bootdev
|
||||||
fi
|
fi
|
||||||
if [ "$UUIDPARAMETER" = "yes" ]; then
|
if [ "$UUIDPARAMETER" = "yes" ]; then
|
||||||
|
@ -1327,6 +1348,7 @@ dogrub() {
|
||||||
head -n $(cat /tmp/.menu.lst | grep -n '#-\*' | cut -d: -f 1) /tmp/.menu.lst >$DESTDIR/boot/grub/menu.lst
|
head -n $(cat /tmp/.menu.lst | grep -n '#-\*' | cut -d: -f 1) /tmp/.menu.lst >$DESTDIR/boot/grub/menu.lst
|
||||||
rm -f /tmp/.menu.lst
|
rm -f /tmp/.menu.lst
|
||||||
subdir=
|
subdir=
|
||||||
|
# create correct entry array
|
||||||
if [ "$_bootdev" != "" ]; then
|
if [ "$_bootdev" != "" ]; then
|
||||||
for bootdev in $_bootdev; do
|
for bootdev in $_bootdev; do
|
||||||
_grubdev="$_grubdev $(mapdev $bootdev)"
|
_grubdev="$_grubdev $(mapdev $bootdev)"
|
||||||
|
@ -1340,6 +1362,7 @@ dogrub() {
|
||||||
grubdev="(hd0,0)"
|
grubdev="(hd0,0)"
|
||||||
fi
|
fi
|
||||||
NUMBER=0
|
NUMBER=0
|
||||||
|
# create default grub entries
|
||||||
for grubdev in $_grubdev; do
|
for grubdev in $_grubdev; do
|
||||||
echo "" >>$DESTDIR/boot/grub/menu.lst
|
echo "" >>$DESTDIR/boot/grub/menu.lst
|
||||||
echo "# ($NUMBER) Arch Linux" >>$DESTDIR/boot/grub/menu.lst
|
echo "# ($NUMBER) Arch Linux" >>$DESTDIR/boot/grub/menu.lst
|
||||||
|
@ -1445,7 +1468,9 @@ EOF
|
||||||
DIALOG --msgbox "GRUB was successfully installed." 0 0
|
DIALOG --msgbox "GRUB was successfully installed." 0 0
|
||||||
S_GRUB=1
|
S_GRUB=1
|
||||||
if [ "$(blkid -c /dev/null | grep TYPE=\"mdraid\")" ]; then
|
if [ "$(blkid -c /dev/null | grep TYPE=\"mdraid\")" ]; then
|
||||||
DIALOG --defaultno --yesno "Setup detected a software raid partition.\nDo you want to install grub additionally to an other hard disk?" 0 0 && S_GRUB=""
|
if ! [ "$redundant" = "1" ]; then
|
||||||
|
DIALOG --defaultno --yesno "Setup detected a redundant software raid partition.\nDo you want to install grub additionally to an other hard disk?" 0 0 && S_GRUB=""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue