Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31184 - baselayout-1.8.6.11 has MAKEDEV and chown problems
Summary: baselayout-1.8.6.11 has MAKEDEV and chown problems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-15 02:37 UTC by Andreas Simon
Modified: 2003-11-03 15:11 UTC (History)
0 users

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


Attachments
baselayout-1.8.6.11-MAKEDEV.patch (baselayout-1.8.6.11-MAKEDEV.patch,1.60 KB, patch)
2003-10-15 21:36 UTC, Martin Schlemmer (RETIRED)
Details | Diff
Patch to eliminate dashes in device names (MAKEDEV.patch,682 bytes, patch)
2003-10-28 01:14 UTC, Andreas Simon
Details | Diff
Patch to eliminate dashes in device names (MAKEFILE.patch,898 bytes, patch)
2003-10-30 02:42 UTC, Andreas Simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Simon 2003-10-15 02:37:30 UTC
During the installation phase of baselayout-1.8.6.11 the ebuild produces many occurances of the following two errors:

//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
chown: `root.root': invalid user

The second one has evidently a wrong syntax. It should be root:root.


Here the interesting part of emerge's output:

>>> Install baselayout-1.8.6.11 into /var/tmp/portage/baselayout-1.8.6.11/image/ category sys-apps
chown: `root.uucp': invalid user
 * Installing utilities...
install -m 0755 -d /var/tmp/portage/baselayout-1.8.6.11/image//bin
install -m 0755 -d /var/tmp/portage/baselayout-1.8.6.11/image//sbin
install -m 0755 consoletype runscript start-stop-daemon /var/tmp/portage/baselayout-1.8.6.11/image//sbin
 * Installing sysvinit...

 * Making device nodes (this could take a minute or so...)
 * Using generic-i386 to make device nodes...
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
chown: `root.root': invalid user
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
chown: `root.root': invalid user
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
chown: `root.root': invalid user
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
chown: `root.root': invalid user
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
man:
gzipping man page: .keep
gzipping man page: .keep
info:
gzipping GNU info page: .keep
prepallstrip:
strip:
strip:
   bin/last
   bin/mesg
   bin/wall
   bin/utmpdump



# emerge --info
Portage 2.0.49-r13 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r6, 2.6.0-test7-bk5)
=================================================================
System uname: 2.6.0-test7-bk5 i686 AMD Athlon(tm) XP 1800+
Gentoo Base System version 1.4.3.11
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -fstack-protector -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -fstack-protector -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox fixpackages"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/opt/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="x86 oss apm avi encode foomaticdb kde libg++ mikmod mpeg ncurses nls pdflib spell xmms xv gdbm berkdb slang readline tcltk java sdl gpm libwww perl python imlib motif cdr 3dnow alsa arts artswrappersuid crypt cups dvb dvd gif gnome gtk gtk2 imap ipv6 jpeg lcms mad maildir mmx mozilla mule nptl oggvorbis offensive opengl pam pic png qt quicktime sasl sse ssl -svga tcpd tetex threads tiff truetype X xml2 zlib esd"

# chown --version
chown (coreutils) 5.0.91

# qpkg -I -v coreutils
sys-apps/coreutils-5.0.91 *

# MAKEDEV
/sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-15 11:21:10 UTC
coreutils-5.0.91 have chown problems - could you try with coreutils-5.0 and
try to remerge baselayout again ?
Comment 2 Andreas Simon 2003-10-15 12:04:07 UTC
I replaced coreutils-5.0.91 with coreutils-5.0-r4. That fixed the chown problem
but the MAKEDEV problem is still there:

...
>>> Install baselayout-1.8.6.11 into /var/tmp/portage/baselayout-1.8.6.11/image/
category sys-apps
 * Installing utilities...
install -m 0755 -d /var/tmp/portage/baselayout-1.8.6.11/image//bin
install -m 0755 -d /var/tmp/portage/baselayout-1.8.6.11/image//sbin
install -m 0755 consoletype runscript start-stop-daemon /var/tmp/portage/baselayout-1.8.6.11/image//sbin
 * Installing sysvinit...

 * Making device nodes (this could take a minute or so...)
 * Using generic-i386 to make device nodes...
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found
man:
gzipping man page: .keep
gzipping man page: .keep
info:
gzipping GNU info page: .keep
prepallstrip:
strip:
strip:
   bin/last
   bin/mesg
...


Regarding that "major_device-mapper=254"-error:
Could it have to do with the fact that my partitions are LVM volumes which
are mounted though device-mapper/lvm2? They have major number 254. But even
with the above MAKEDEV calls failing everything seems to work.
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-15 21:36:17 UTC
Created attachment 19290 [details, diff]
baselayout-1.8.6.11-MAKEDEV.patch

Might be a quoting problem, or it could be the same as another bug.  Could
you try to apply this to the ebuild, and try again ?
Comment 4 Harm Geerts 2003-10-16 16:37:33 UTC
Without the patch I get this:

 * Using generic-i386 to make device nodes...
//sbin/MAKEDEV: line 1: major_ircomm%d=161: command not found
etc...

With the patch I get:

 * Using generic-i386 to make device nodes...
/var/tmp/portage/baselayout-1.8.6.11/image//sbin/MAKEDEV: line 1: major_ircomm%d=161:
command not found


I don't have lvm and the error is different but I suppose it's related to
this bug :)

# emerge info
Portage 2.0.49-r13 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r1, 2.4.22)
=================================================================
System uname: 2.4.22 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.4.3.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config
/usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs fixpackages"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp.skynet.be/mirror/gentoo/
http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/overlay"
SYNC="rsync://rsync4.nl.gentoo.org/gentoo-portage"
USE="apm foomaticdb gif libg++ mikmod nls pdflib quicktime xml2 gdbm berkdb
slang aalib tcltk gpm pam ssl esd imlib motif 3dnow acpi alsa -apache2 arts
avi cdr crypt cups dga directfb dvd dvdr encode fbcon gd -gnome gtk gtk2
-gtkhtml icc icc-pgo imap java jpeg kde libwww mad maildir matroska mmx mpeg
mysql ncurses oggvorbis opengl oss perl png python qt readline samba scanner
sdl spell sse svga tcpd tiff truetype usb X xinerama xmms xv zlib x86"

# MAKEDEV
/sbin/MAKEDEV: line 1: major_ircomm%d=161: command not found
Comment 5 Andreas Simon 2003-10-17 01:11:02 UTC
I applied the patch. The outcome is similar to that of Hagar. With the patch
the error message changed from

//sbin/MAKEDEV: line 1: major_device-mapper=254: command not found

to

/var/tmp/portage/baselayout-1.8.6.11/image//sbin/MAKEDEV: line 1: major_device-mapper=254:
command not found

The error message seems to be generated by line 169 in MAKEDEV:
eval "major_$device=$major"
If I comment this line out, the error message vanishes.
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-26 09:19:04 UTC
Ok, and if you change the interpreter for MAKEDEV to /bin/bash ? (#!/bin/sh
to
#!/bin/bash) ?
Comment 7 Andreas Simon 2003-10-26 10:26:27 UTC
Changing the interpreter changed nothing.

But it seems to be some nasty shell syntax thing:

Typing the following into a sh/bash does result in the same error:
# device=device-mapper
# major=254
# eval major_$device=$major
-bash: major_device-mapper=254: command not found

But
# echo major_$device=$major
major_device-mapper=254

The problem here seems to be the "-" in the variable name:
# foo-bar=123
-bash: foo-bar=123: command not found


I have no idea how to fix this.
Comment 8 Andreas Simon 2003-10-26 10:34:40 UTC
Does this seem to be related to bug 78018 in Debian's bugzilla?
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=78018

The error message there looks exactly like the one from Hagar and similar
to the one I have.


 
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-27 11:01:25 UTC
So does below patch fixes it?

----
Index: sbin/MAKEDEV
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/sbin/MAKEDEV,v
retrieving revision 1.5
diff -u -r1.5 MAKEDEV
--- sbin/MAKEDEV        16 Oct 2003 22:39:16 -0000      1.5
+++ sbin/MAKEDEV        27 Oct 2003 19:00:57 -0000
@@ -180,7 +180,7 @@
        then
                echo -1 # don't care
        else
-               eval echo \${major_$1:-\${device:?\"unknown major number
for $1\"}}
+               eval echo \${major_${1}:-\${device:?\"unknown major number
for ${1}\"}}
        fi
 }
  

Comment 10 Andreas Simon 2003-10-28 01:12:40 UTC
Unfortunately your patch did not changed anything.

I found a discussion on the web where there was once a built error for glibc
because the build script used somewhere dashes in variable names. The fix
was to not use any dash in bash variables (I looks like dashes were allowed
in older bash versions).

So it looks like the dash ("-") is no valid character for a bash variable.
See the definition of `name' in POSIX.2, section 2.2.2.105.

This a fix would be to replace the dash with something else or just to cut
it.

I wrote a small patch for MAKEDEV which replaces dashes with underscores
in all 3 occurences of major_$device. It silenses those errors but I am not
sure if it doesn't break anything. It works here, but that means nothing.

I also looked at MAKEDEV from Fedora/Rawhide but they don't use a shell script
for MAKEDEV so I suppose they don't have this problem at all.
Comment 11 Andreas Simon 2003-10-28 01:14:04 UTC
Created attachment 19881 [details, diff]
Patch to eliminate dashes in device names

Added a patch to replace "-" with "_" in device-names to have valid bash
variable names.
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-29 12:13:08 UTC
What about this one:

--
Major () {
        device=$2
        if [ "$opt_d" ]
        then
                echo -1 # don't care
        else
                eval echo \${major_$1:-\${device:?\"unknown major number
for $1\"}}
        fi
}
--

otherwise it looks good ...
Comment 13 Andreas Simon 2003-10-30 02:42:30 UTC
Created attachment 19964 [details, diff]
Patch to eliminate dashes in device names

Yes, you're right. I've forgotten the one in Major().
I updated the patch to include this occurence too.
Comment 14 Martin Schlemmer (RETIRED) gentoo-dev 2003-11-03 15:11:07 UTC
Ok, fixed in CVS already, thanks.

-- ChangeLog --
  29 Oct 2003; Martin Schlemmer <azarah@gentoo.org>:

    We should not use '-' in variable names for bash, bug #31184, thanks
    to Andreas Simon <yuipx@gmx.net>.  Updated /sbin/MAKEDEV.
--

--
Index: sbin/MAKEDEV
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/sbin/MAKEDEV,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sbin/MAKEDEV        16 Oct 2003 22:39:16 -0000      1.5
+++ sbin/MAKEDEV        29 Oct 2003 20:20:50 -0000      1.6
@@ -1,6 +1,6 @@
 #! /bin/sh -
  
-RCSID='$Id: MAKEDEV,v 1.5 2003/10/16 22:39:16 azarah Exp $'
+RCSID='$Id: MAKEDEV,v 1.6 2003/10/29 20:20:50 azarah Exp $'
  

#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
 # Customisation:
@@ -166,7 +166,7 @@
                        Character|Block|'')
                                ;;
                        *)
-                               eval "major_$device=$major"
+                               eval "major_${device/-/_}=$major"
                                devices="$devices $device"
                                ;;
                esac
@@ -180,7 +180,7 @@
        then
                echo -1 # don't care
        else
-               eval echo \${major_$1:-\${device:?\"unknown major number
for $1\"}}
+               eval echo \${major_${1/-/_}:-\${device:?\"unknown major number
for $1\"}}
        fi
 }
  
@@ -1859,7 +1859,7 @@
                        exec 3<DEVICES
                        while read device major <&3
                        do
-                               eval now=\$major_$device
+                               eval now=\$major_${device/-/_}
                                if [ "$now" = "" ]
                                then
                                        delete="$delete `cvt $device`"
@@ -1880,7 +1880,7 @@
                do
                        if [ "`cvt $device`" ]
                        then
-                           eval echo $device \$major_$device
+                           eval echo $device \$major_${device/-/_}
                        fi
                done > DEVICES
                ;;