Wed Jul 18, 2012 6:27 pm
Wed Jul 18, 2012 9:14 pm
still need to work in the code for putting the bootloader into a partition
chroot /target /bin/bash grub-install --recheck --no-floppy --force $INSTALLPARTITION
# grub-install fails to a partition! gives "error 22: No such partition"
# this will probable give error 22 but gets the files in /boot (grub shell might not)
chroot /target /bin/bash grub-install $INSTALLPARTITION
# isolate the device (sdx) letter then use tr like this to translate to the right number for grub
GRUBDEVICENUM=$(echo $INSTALLPARTITION |sed 's:/dev/sd::' |sed 's:[0-9]::'g |tr '[a-j]' '[0-9]')
# isolate the partition number
INSTALLPARTNUM=$(echo $INSTALLPARTITION |sed 's:/dev/sd::'|sed 's:[a-z]::')
# and reduce it by 1 for grub
GRUBPARTNUM=$(expr $INSTALLPARTNUM - 1)
# finally get the finished grub root syntax
GRUBROOT="(hd$GRUBDEVICENUM,$GRUBPARTNUM)"
# now use grub shell in batch mode (grub-install fails to a partition)
grub --batch <<EOF
root $GRUBROOT
setup $GRUBROOT
quit
EOF
GRUBINST=$($DIALOG --width=400 --height=400 --title=$"$TITLE" --list --separator="" --column="" --text="$TEXT" "MBR of first hard disk" "MBR of installation disk" "Installation partition" "Do not install Grub")
Fri Jul 20, 2012 7:35 pm
Sun Jul 22, 2012 4:12 pm
Is there an easy way to tell if grub-legacy or grub-pc is installed?
GRUBVERSION=$(dpkg -l |grep ii|grep grub|grep -v "grub-common"|grep -v theme|awk '{print $2}')
Mon Jul 23, 2012 4:08 am
grubversion=$(dpkg -l | awk '$2 ~ "grub-[lp]" { print $2}')
Mon Jul 23, 2012 10:29 am
Unable parse command line: Unknown option --info
grubversion=$(dpkg -l | grep ii | grep -v doc | awk '$2 ~ "grub-[glp]" { print $2}')
Mon Jul 23, 2012 11:58 am
Mon Jul 23, 2012 1:15 pm
Mon Jul 23, 2012 3:03 pm
Mon Jul 23, 2012 4:54 pm