Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-05 Thread Iustin Pop
On Sat, Dec 05, 2009 at 07:15:55PM +0400, Stepan Golosunov wrote:
> 05.12.2009 в 13:33:13 +0100 Iustin Pop написал(а):
> > Yes, but you're tying here together the grub-mkconfig_lib change and the
> > linux/linux16 change, and these were not done together. These two should
> > be split, and the linux16 tested via the presence of
> > /usr/lib/grub/i386-pc/linux16.mod.
> > 
> > But here we get very deep into details of grub, which is not really
> > recommended - what if grub changes its internal paths tomorrow?
> 
> I think that for the purpose of upgrading from lenny it is enough to
> check for presence of grub-mkconfig_lib (if both changes are already
> in squeeze).

Yep, they both are. As long as this is done indeed for supporting
upgrades from lenny, and it doesn't matter that partial package sets
from unstable won't be handled properly, seems like a good option.

Then the latest version I propose is attached (and I'll try to see if my
AM accepts it and sponsors a NMU). Tested and works (in a virtual
machine) for both lenny and sid.

iustin
diff -urN /tmp/memtest86+-4.00/debian/grub memtest86+-4.00/debian/grub
--- /tmp/memtest86+-4.00/debian/grub	2009-12-05 18:11:46.0 +0100
+++ memtest86+-4.00/debian/grub	2009-12-05 18:14:43.655898161 +0100
@@ -1,8 +1,20 @@
 #!/bin/sh
 set -e
 
-. /usr/lib/grub/grub-mkconfig_lib
+
 if test -e /boot/memtest86+.bin ; then
+  if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
+. /usr/lib/grub/grub-mkconfig_lib
+LX=linux16
+  elif [ -f /usr/lib/grub/update-grub_lib ]; then
+. /usr/lib/grub/update-grub_lib
+LX=linux
+  else
+# no grub file, so we notify and exit gracefully
+echo "Cannot find grub config file, exiting." >&2
+exit 0
+  fi
+
   MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" )
   echo "Found memtest86+ image: $MEMTESTPATH" >&2
   cat << EOF
@@ -10,13 +22,13 @@
 EOF
   prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
   cat << EOF
-	linux16	$MEMTESTPATH
+	$LX	$MEMTESTPATH
 }
 menuentry "Memory test (memtest86+, serial console 115200)" {
 EOF
   prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
   cat << EOF
-	linux16	$MEMTESTPATH console=ttyS0,115200n8
+	$LX	$MEMTESTPATH console=ttyS0,115200n8
 }
 EOF
 fi


Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-05 Thread Stepan Golosunov
05.12.2009 в 13:33:13 +0100 Iustin Pop написал(а):
> Yes, but you're tying here together the grub-mkconfig_lib change and the
> linux/linux16 change, and these were not done together. These two should
> be split, and the linux16 tested via the presence of
> /usr/lib/grub/i386-pc/linux16.mod.
> 
> But here we get very deep into details of grub, which is not really
> recommended - what if grub changes its internal paths tomorrow?

I think that for the purpose of upgrading from lenny it is enough to
check for presence of grub-mkconfig_lib (if both changes are already
in squeeze).



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-05 Thread Iustin Pop
On Sat, Dec 05, 2009 at 11:13:52AM +0400, Stepan Golosunov wrote:
> 04.12.2009 в 22:07:56 +0100 Iustin Pop написал(а):
> > On Fri, Dec 04, 2009 at 10:09:02PM +0400, Stepan Golosunov wrote:
> > > 04.12.2009 в 16:27:03 +0100 Iustin Pop написал(а):
> > > > On Wed, Oct 07, 2009 at 08:44:39PM +0500, Stepan Golosunov wrote:
> > > > > Package: memtest86+
> > > > > Version: 4.00-2
> > > > > Severity: serious
> > > > > 
> > > > > Upgrade to memtest86+ 4.00-2 fails:
> > > > > 
> > > > > .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
> > > > 
> > > > This is because you memtest86+ doesn't declare conflicts as it should,
> > > > and you have an older grub-pc:
> > > > 
> > > > > ii  grub-pc [grub]  1.96+20080724-16 GRand Unified 
> > > > > Bootloader, version 
> > > > 
> > > > Basically the new file has been introduced into a newer version of
> > > > grub-pc. Patch adding conflicts attached.
> > > 
> > > > +Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 
> > > > 1.96+20090523-1)
> > > 
> > > Won't it lead to accidental removal of bootloader?
> > > That would be a critical bug.
> > 
> > This is the only possibilty that I see if we want to just modify package
> > relationships; the other option would be to modify the grub script
> > provided by memtest86+ to not do anything if we don't find the required
> > files (which works for /usr/lib/grub/grub-mkconfig_lib, but it's harder
> > to do for the linux16 support).
> > 
> > So, I don't see a clear way to make this all work nicely. Any
> > suggestions?
> 
> Something like
> 
> #!/bin/sh
> set -e
> if test -e /boot/memtest86+.bin ; then
>   if test -r /usr/lib/grub/grub-mkconfig_lib ; then
> . /usr/lib/grub/grub-mkconfig_lib
> MEMTESTPATH=$( make_system_path_relative_to_its_root 
> "/boot/memtest86+.bin" )
> echo "Found memtest86+ image: $MEMTESTPATH" >&2
> cat << EOF
> menuentry "Memory test (memtest86+)" {
> EOF
> prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
> cat << EOF
> linux16 $MEMTESTPATH
> }
> menuentry "Memory test (memtest86+, serial console 115200)" {
> EOF
> prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
> cat << EOF
> linux16 $MEMTESTPATH console=ttyS0,115200n8
> }
> EOF
>   else
> . /usr/lib/grub/update-grub_lib
> MEMTESTPATH=$( make_system_path_relative_to_its_root 
> "/boot/memtest86+.bin" )
> echo "Found memtest86+ image: $MEMTESTPATH" >&2
> cat << EOF
> menuentry "Memory test (memtest86+)" {
> linux   $MEMTESTPATH
> }
> menuentry "Memory test (memtest86+, serial console 115200)" {
> linux   $MEMTESTPATH console=ttyS0,115200n8
> }
> EOF
>   fi
> fi

Yes, but you're tying here together the grub-mkconfig_lib change and the
linux/linux16 change, and these were not done together. These two should
be split, and the linux16 tested via the presence of
/usr/lib/grub/i386-pc/linux16.mod.

But here we get very deep into details of grub, which is not really
recommended - what if grub changes its internal paths tomorrow?

And note the above shell script can be simplified :)

This could be just:

#!/bin/sh
set -e
if test -e /boot/memtest86+.bin ; then
  if test -r /usr/lib/grub/grub-mkconfig_lib ; then
. /usr/lib/grub/grub-mkconfig_lib
  elif test -r /usr/lib/grub/update-grub_lib ; then
. /usr/lib/grub/update-grub_lib
  else # no grub config file found
exit 0
  fi

  if test -f /usr/lib/grub/i386-pc/linux16.mod; then
LX=linux16
  else
LX=linux
  fi

  MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" )
  echo "Found memtest86+ image: $MEMTESTPATH" >&2
  cat << EOF
menuentry "Memory test (memtest86+)" {
EOF
  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
  cat << EOF
  $LX $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
EOF
  prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
  cat << EOF
  $LX $MEMTESTPATH console=ttyS0,115200n8
}
EOF
fi

But again, I'm not sure which is best - conflicting with old grub
versions, or going and depending on grub internal paths.

iustin



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-04 Thread Stepan Golosunov
04.12.2009 в 22:07:56 +0100 Iustin Pop написал(а):
> On Fri, Dec 04, 2009 at 10:09:02PM +0400, Stepan Golosunov wrote:
> > 04.12.2009 в 16:27:03 +0100 Iustin Pop написал(а):
> > > On Wed, Oct 07, 2009 at 08:44:39PM +0500, Stepan Golosunov wrote:
> > > > Package: memtest86+
> > > > Version: 4.00-2
> > > > Severity: serious
> > > > 
> > > > Upgrade to memtest86+ 4.00-2 fails:
> > > > 
> > > > .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
> > > 
> > > This is because you memtest86+ doesn't declare conflicts as it should,
> > > and you have an older grub-pc:
> > > 
> > > > ii  grub-pc [grub]  1.96+20080724-16 GRand Unified Bootloader, 
> > > > version 
> > > 
> > > Basically the new file has been introduced into a newer version of
> > > grub-pc. Patch adding conflicts attached.
> > 
> > > +Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 1.96+20090523-1)
> > 
> > Won't it lead to accidental removal of bootloader?
> > That would be a critical bug.
> 
> This is the only possibilty that I see if we want to just modify package
> relationships; the other option would be to modify the grub script
> provided by memtest86+ to not do anything if we don't find the required
> files (which works for /usr/lib/grub/grub-mkconfig_lib, but it's harder
> to do for the linux16 support).
> 
> So, I don't see a clear way to make this all work nicely. Any
> suggestions?

Something like

#!/bin/sh
set -e
if test -e /boot/memtest86+.bin ; then
  if test -r /usr/lib/grub/grub-mkconfig_lib ; then
. /usr/lib/grub/grub-mkconfig_lib
MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" 
)
echo "Found memtest86+ image: $MEMTESTPATH" >&2
cat << EOF
menuentry "Memory test (memtest86+)" {
EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
linux16 $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
linux16 $MEMTESTPATH console=ttyS0,115200n8
}
EOF
  else
. /usr/lib/grub/update-grub_lib
MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+.bin" 
)
echo "Found memtest86+ image: $MEMTESTPATH" >&2
cat << EOF
menuentry "Memory test (memtest86+)" {
linux   $MEMTESTPATH
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux   $MEMTESTPATH console=ttyS0,115200n8
}
EOF
  fi
fi


?
(Totally untested.) At least, the second part works in memtest86+
2.11-3 with grub-pc 1.96+20080724-16.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-04 Thread Iustin Pop
On Fri, Dec 04, 2009 at 10:09:02PM +0400, Stepan Golosunov wrote:
> 04.12.2009 в 16:27:03 +0100 Iustin Pop написал(а):
> > On Wed, Oct 07, 2009 at 08:44:39PM +0500, Stepan Golosunov wrote:
> > > Package: memtest86+
> > > Version: 4.00-2
> > > Severity: serious
> > > 
> > > Upgrade to memtest86+ 4.00-2 fails:
> > > 
> > > Preparing to replace memtest86+ 2.11-3 (using 
> > > .../memtest86+_4.00-2_i386.deb) ...
> > > Unpacking replacement memtest86+ ...
> > > Updating /boot/grub/grub.cfg ...
> > > Found Debian background: moreblue-orbit-grub.png
> > > Found linux image: /boot/vmlinuz-2.6.26-2-amd64
> > > Found initrd image: /boot/initrd.img-2.6.26-2-amd64
> > > Found linux image: /boot/vmlinuz-2.6.26-1-amd64
> > > Found initrd image: /boot/initrd.img-2.6.26-1-amd64
> > > Found memtest86 image: /boot/memtest86.bin
> > > Found memtest86+ image: /boot/memtest86+.bin
> > > .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
> > 
> > This is because you memtest86+ doesn't declare conflicts as it should,
> > and you have an older grub-pc:
> > 
> > > ii  grub-pc [grub]  1.96+20080724-16 GRand Unified Bootloader, 
> > > version 
> > 
> > Basically the new file has been introduced into a newer version of
> > grub-pc. Patch adding conflicts attached.
> 
> > +Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 1.96+20090523-1)
> 
> Won't it lead to accidental removal of bootloader?
> That would be a critical bug.

Since it doesn't "Replace" the grub-pc/grub-common packages, I won't
remove the package without confirmation - but it indeed will prompt the
user for removal. In other words:
 - apt-get upgrade/dist-upgrade won't select the new memtest86+ version
 - but an explicit "apt-get install memtest86+" will prompt for removal
   of grub-pc

The policy says that “A Conflicts entry should almost never have an
"earlier than" version clause”, and recommends ‘Breaks’ instead, but
breaks doesn't work here properly. And we can't depend either on a newer
grub version, since memtest86+ technically doesn't "depend" on grub.

This is the only possibilty that I see if we want to just modify package
relationships; the other option would be to modify the grub script
provided by memtest86+ to not do anything if we don't find the required
files (which works for /usr/lib/grub/grub-mkconfig_lib, but it's harder
to do for the linux16 support).

So, I don't see a clear way to make this all work nicely. Any
suggestions?

thanks!
iustin



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-04 Thread Stepan Golosunov
04.12.2009 в 16:27:03 +0100 Iustin Pop написал(а):
> On Wed, Oct 07, 2009 at 08:44:39PM +0500, Stepan Golosunov wrote:
> > Package: memtest86+
> > Version: 4.00-2
> > Severity: serious
> > 
> > Upgrade to memtest86+ 4.00-2 fails:
> > 
> > Preparing to replace memtest86+ 2.11-3 (using 
> > .../memtest86+_4.00-2_i386.deb) ...
> > Unpacking replacement memtest86+ ...
> > Updating /boot/grub/grub.cfg ...
> > Found Debian background: moreblue-orbit-grub.png
> > Found linux image: /boot/vmlinuz-2.6.26-2-amd64
> > Found initrd image: /boot/initrd.img-2.6.26-2-amd64
> > Found linux image: /boot/vmlinuz-2.6.26-1-amd64
> > Found initrd image: /boot/initrd.img-2.6.26-1-amd64
> > Found memtest86 image: /boot/memtest86.bin
> > Found memtest86+ image: /boot/memtest86+.bin
> > .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
> 
> This is because you memtest86+ doesn't declare conflicts as it should,
> and you have an older grub-pc:
> 
> > ii  grub-pc [grub]  1.96+20080724-16 GRand Unified Bootloader, 
> > version 
> 
> Basically the new file has been introduced into a newer version of
> grub-pc. Patch adding conflicts attached.

> +Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 1.96+20090523-1)

Won't it lead to accidental removal of bootloader?
That would be a critical bug.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-12-04 Thread Iustin Pop
On Wed, Oct 07, 2009 at 08:44:39PM +0500, Stepan Golosunov wrote:
> Package: memtest86+
> Version: 4.00-2
> Severity: serious
> 
> Upgrade to memtest86+ 4.00-2 fails:
> 
> Preparing to replace memtest86+ 2.11-3 (using .../memtest86+_4.00-2_i386.deb) 
> ...
> Unpacking replacement memtest86+ ...
> Updating /boot/grub/grub.cfg ...
> Found Debian background: moreblue-orbit-grub.png
> Found linux image: /boot/vmlinuz-2.6.26-2-amd64
> Found initrd image: /boot/initrd.img-2.6.26-2-amd64
> Found linux image: /boot/vmlinuz-2.6.26-1-amd64
> Found initrd image: /boot/initrd.img-2.6.26-1-amd64
> Found memtest86 image: /boot/memtest86.bin
> Found memtest86+ image: /boot/memtest86+.bin
> .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

This is because you memtest86+ doesn't declare conflicts as it should,
and you have an older grub-pc:

> ii  grub-pc [grub]  1.96+20080724-16 GRand Unified Bootloader, 
> version 

Basically the new file has been introduced into a newer version of
grub-pc. Patch adding conflicts attached.

iustin
diff -urN memtest86+-4.00.old/debian/control memtest86+-4.00/debian/control
--- memtest86+-4.00.old/debian/control	2009-12-04 16:22:11.0 +0100
+++ memtest86+-4.00/debian/control	2009-12-04 16:22:59.330820451 +0100
@@ -9,7 +9,8 @@
 Package: memtest86+
 Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 lpia hurd-i386
 Depends: ${misc:Depends}
-Suggests: hwtools, memtester, kernel-patch-badram, memtest86, grub2 (>=1.95+20070515-1) | grub (>= 0.95+cvs20040624), mtools
+Suggests: hwtools, memtester, kernel-patch-badram, memtest86, grub2 (>=1.96+20090523-1) | grub (>= 0.95+cvs20040624), mtools
+Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 1.96+20090523-1)
 Description: thorough real-mode memory tester
  Memtest86+ scans your RAM for errors.
  .


Bug#550096: .: 4: Can't open /usr/lib/grub/grub-mkconfig_lib

2009-10-07 Thread Stepan Golosunov
Package: memtest86+
Version: 4.00-2
Severity: serious

Upgrade to memtest86+ 4.00-2 fails:

Preparing to replace memtest86+ 2.11-3 (using .../memtest86+_4.00-2_i386.deb) 
...
Unpacking replacement memtest86+ ...
Updating /boot/grub/grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
Found memtest86 image: /boot/memtest86.bin
Found memtest86+ image: /boot/memtest86+.bin
.: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
dpkg: warning - old post-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
Updating /boot/grub/grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
Found memtest86 image: /boot/memtest86.bin
Found memtest86+ image: /boot/memtest86+.bin
.: 4: Can't open /usr/lib/grub/grub-mkconfig_lib
dpkg: error processing /var/cache/apt/archives/memtest86+_4.00-2_i386.deb 
(--unpack):
 subprocess new post-removal script returned error exit status 2
Updating /boot/grub/grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
Found memtest86 image: /boot/memtest86.bin
Found memtest86+ image: /boot/memtest86+.bin
done
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/memtest86+_4.00-2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:



-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (900, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

memtest86+ depends on no packages.

memtest86+ recommends no packages.

Versions of packages memtest86+ suggests:
ii  grub-pc [grub]  1.96+20080724-16 GRand Unified Bootloader, version 
pn  hwtools(no description available)
pn  kernel-patch-badram(no description available)
ii  memtest86   3.5-2thorough real-mode memory tester
ii  memtester   4.0.8-1  A utility for testing the memory s
ii  mtools  3.9.11-1 Tools for manipulating MSDOS files

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org