Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 260547 - sys-apps/memtest86+-2.01 fails to install with syntax error in expression
Summary: sys-apps/memtest86+-2.01 fails to install with syntax error in expression
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Michal Januszewski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-27 19:48 UTC by Denilson Sá Maia
Modified: 2009-03-22 21:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info,4.32 KB, text/plain)
2009-03-05 15:21 UTC, Denilson Sá Maia
Details
environment (environment,87.11 KB, text/plain)
2009-03-05 15:22 UTC, Denilson Sá Maia
Details
fstab (fstab,1.24 KB, text/plain)
2009-03-05 23:41 UTC, Denilson Sá Maia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denilson Sá Maia 2009-02-27 19:48:18 UTC
My system: brand-new, recently installed, stable amd64.

# emerge -av memtest86+
[...]
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/memtest86+-2.01/
>>> /usr/share/doc/memtest86+-2.01/README.build-process.bz2
>>> /usr/share/doc/memtest86+-2.01/README.bz2
--- /boot/
>>> /boot/memtest86plus/
>>> /boot/memtest86plus/memtest.bin
 * 
 * memtest.bin has been installed in /boot/memtest86plus/
 * You may wish to update your bootloader configs
 * by adding these lines:
/var/tmp/portage/sys-apps/memtest86+-2.01/temp/environment: line 2100: 6
0-1: syntax error in expression (error token is "0-1")
!!! FAILED postinst: 1

This is the line 2100 of that file:
        root="(hd${root:0:1},$((${root:1:3}-1)))";
Which is one of the pkg_postinst lines.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2009-03-05 14:42:35 UTC
Please post your `emerge --info' and attach the environment file.
Comment 2 Denilson Sá Maia 2009-03-05 15:21:52 UTC
Created attachment 184020 [details]
emerge --info
Comment 3 Denilson Sá Maia 2009-03-05 15:22:39 UTC
Created attachment 184022 [details]
environment

/var/tmp/portage/sys-apps/memtest86+-2.01/temp/environment
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2009-03-05 23:34:51 UTC
It's probably a good idea to attach /etc/fstab as well.
Comment 5 Denilson Sá Maia 2009-03-05 23:41:04 UTC
Created attachment 184069 [details]
fstab
Comment 6 Denilson Sá Maia 2009-03-05 23:53:11 UTC
Now I understand it. Using UUID= or LABEL= in /etc/fstab breaks the postinst script.

I wonder if looking at /proc/mounts, or /etc/mtab, or at the output of "mount" command could be better. But, also, if someone had a line like this:
#/dev/bootdevice    /boot   ext2  noatime  1 2
It would still break current script logic.

Since memtest86+ is installed at /boot, which is the same place as the kernel, I bet the user already has the required lines to boot the kernel, and thus already knows the correct (hd?,?) string. Maybe the entire logic could be dropped and a simple message printed instead, forcing the user to fix the '?' characters.

Or maybe that message could be just a fallback.

If you still want to fix that logic for UUID/LABEL, look at /dev/disk/by-uuid/ or 'blkid' command.

But personally I still think that logic can fail in some cases, because I'm not sure that Linux device name ([sh]d[a-z][0-9]) can be translated correctly to grub devices (hd[0-9],[0-9]) for all systems using that simple substitution.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-03-06 00:07:59 UTC
There's a lot of valid block devices beyond [sh]d[a-z]+[0-9]+. Maybe better to look at the grub device.map cache? Or better, since we require that /boot is mounted, we could just look at it for the current kernel and hence find the current root argument.

But as you say, putting some placeholder in, and just letting the user update grub.conf is probably fine.

What I don't follow, is why the entire postinst block bailed out. The rc value at the end should have been already.
Comment 8 Denilson Sá Maia 2009-03-06 00:14:36 UTC
(In reply to comment #7)
> Maybe better to look at the grub device.map cache?

Maybe not everyone might be using grub (the postinst message explains how to configure grub and lilo), so this would only be a bonus feature if the user had grub, but shouldn't do anything if the user doesn't.

But, still, the simple generic and dumb placeholder would probably be fine.
Comment 9 Michal Januszewski (RETIRED) gentoo-dev 2009-03-22 08:43:01 UTC
I completely agree that removing this code should be OK from the users' POV.  

I thus removed the code in CVS and replaced it with a generic einfo line with placeholders.
Comment 10 Denilson Sá Maia 2009-03-22 15:44:55 UTC
Hey, I just checked... sys-apps/memtest86 is also affected by this bug.

Sorry to reopen this bug, I should have checked this before, to save you time. On the other hand, I think there is no need for a new bug.
Comment 11 Michal Januszewski (RETIRED) gentoo-dev 2009-03-22 21:31:17 UTC
(In reply to comment #10)
> Hey, I just checked... sys-apps/memtest86 is also affected by this bug.

Right, fixed that one too.  Thanks!