wok-6.x rev 17929
syslinux/taziso: install grub
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 11 18:26:44 2015 +0200 (2015-04-11) |
parents | 7034b53ca07c |
children | 4c62635505df |
files | syslinux/stuff/iso2exe/taziso |
line diff
1.1 --- a/syslinux/stuff/iso2exe/taziso Sat Apr 11 17:40:38 2015 +0200 1.2 +++ b/syslinux/stuff/iso2exe/taziso Sat Apr 11 18:26:44 2015 +0200 1.3 @@ -249,6 +249,37 @@ 1.4 $mnt/slitaz/boot/README 1.5 [ -d $mnt/slitaz/usr/sbin -a ! -x $mnt/slitaz/usr/sbin/mount.posixovl ] && 1.6 cp $(which mount.posixovl) $mnt/slitaz/usr/sbin 1.7 + if grep -qs " $mnt " /proc/mounts && [ ! -d $mnt/boot/grub ]; then 1.8 + mkdir -p $mnt/boot/grub 1.9 + cp -a /usr/lib/grub/*/* $mnt/boot/grub 1.10 + cat > $mnt/boot/grub/menu.lst <<EOT 1.11 +# /boot/grub/menu.lst: GRUB boot loader configuration. 1.12 + 1.13 +# By default, boot the first entry. 1.14 +default 0 1.15 + 1.16 +# Boot automatically after 8 secs. 1.17 +timeout 8 1.18 + 1.19 +title Microsoft Windows 1.20 + chainloader +1 1.21 + 1.22 +title SliTaz GNU/Linux $(cat $mnt/slitaz/etc/slitaz-release) 1.23 + kernel /slitaz/boot/bzimage rw root=/dev/null $extraargs autologin 1.24 + initrd /slitaz/boot/$initrd 1.25 + 1.26 +EOT 1.27 + dev=$(grep " $mnt " /proc/mounts | awk '{ print $1 }') 1.28 + base=${dev//[0-9]/} 1.29 + dd if=$base bs=32k count=1 of=$mnt/boot/grub/$(basename $base) 1.30 + cat > $mnt/boot/grub/uninstall-grub.sh <<EOT 1.31 +#!/bin/sh 1.32 + 1.33 +[ -s /boot/grub/$(basename $base) ] && 1.34 +dd if=/boot/grub/$(basename $base) of=$base 1.35 +EOT 1.36 + grub-install --no-floppy --root-directory=$mnt $base 1.37 + fi 1.38 rm -f /tmp/wait 1.39 umount $mnt/slitaz 1.40 return 0