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 [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]