wok-current rev 7806

grub4dos-linux: apply grub legacy patches
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Dec 24 17:06:42 2010 +0100 (2010-12-24)
parents c753c126a746
children c3596312e06a
files grub/stuff/dev_partition.diff grub4dos/receipt grub4dos/stuff/dev_partition.diff grub4dos/stuff/xfs_freeze.diff
line diff
     1.1 --- a/grub/stuff/dev_partition.diff	Fri Dec 24 16:38:35 2010 +0100
     1.2 +++ b/grub/stuff/dev_partition.diff	Fri Dec 24 17:06:42 2010 +0100
     1.3 @@ -1,12 +1,13 @@
     1.4  Partition can be ${dev}$num or ${dev}p$num
     1.5  --- grub-0.97/lib/device.c
     1.6  +++ grub-0.97/lib/device.c
     1.7 -@@ -867,6 +867,12 @@
     1.8 +@@ -867,6 +867,13 @@
     1.9     fd = open (dev, O_RDWR);
    1.10     if (fd < 0)
    1.11       {
    1.12  +      strcpy (dev, map[drive]);
    1.13  +      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
    1.14 ++      fd = open (dev, O_RDWR);
    1.15  +    }
    1.16  +  
    1.17  +  if (fd < 0)
     2.1 --- a/grub4dos/receipt	Fri Dec 24 16:38:35 2010 +0100
     2.2 +++ b/grub4dos/receipt	Fri Dec 24 17:06:42 2010 +0100
     2.3 @@ -14,6 +14,11 @@
     2.4  compile_rules()
     2.5  {
     2.6  	cd $src
     2.7 +	for i in ../stuff/*.diff ; do
     2.8 +		[ -f $(basename $i) ] && continue
     2.9 +		patch -p1 < $i
    2.10 +		touch $(basename $i)
    2.11 +	done
    2.12  	sh ./configure --prefix=/usr --infodir=/usr/share/info \
    2.13  	--without-curses --mandir=/usr/share/man \
    2.14  	$CONFIGURE_ARGS &&
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/grub4dos/stuff/dev_partition.diff	Fri Dec 24 17:06:42 2010 +0100
     3.3 @@ -0,0 +1,17 @@
     3.4 +Partition can be ${dev}$num or ${dev}p$num
     3.5 +--- grub-0.97/lib/device.c
     3.6 ++++ grub-0.97/lib/device.c
     3.7 +@@ -867,6 +867,13 @@
     3.8 +   fd = open (dev, O_RDWR);
     3.9 +   if (fd < 0)
    3.10 +     {
    3.11 ++      strcpy (dev, map[drive]);
    3.12 ++      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
    3.13 ++      fd = open (dev, O_RDWR);
    3.14 ++    }
    3.15 ++  
    3.16 ++  if (fd < 0)
    3.17 ++    {
    3.18 +       errnum = ERR_NO_PART;
    3.19 +       return 0;
    3.20 +     }
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/grub4dos/stuff/xfs_freeze.diff	Fri Dec 24 17:06:42 2010 +0100
     4.3 @@ -0,0 +1,21 @@
     4.4 +diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
     4.5 +--- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
     4.6 ++++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
     4.7 +@@ -422,6 +422,17 @@
     4.8 + test -n "$mkimg" && img_file=`$mkimg`
     4.9 + test -n "$mklog" && log_file=`$mklog`
    4.10 + 
    4.11 ++# GRUB will try to verify that stage2 is accessible using its own
    4.12 ++# filesystem drivers.  Make sure it's committed to disk.
    4.13 ++sync
    4.14 ++
    4.15 ++# On XFS, sync() is not enough.
    4.16 ++if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
    4.17 ++  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
    4.18 ++  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
    4.19 ++  # maybe we're lucky.
    4.20 ++fi
    4.21 ++
    4.22 + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
    4.23 +     count=5
    4.24 +     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`