Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 232823

Summary: error compiling stage1 using baselayout-2.0.0
Product: Gentoo Hosted Projects Reporter: Markus Rothe (RETIRED) <corsair>
Component: CatalystAssignee: Gentoo Catalyst Developers <catalyst>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, binki, kyron, mattst88, redhatter, rwmailing, siarhei.siamashka, ssuominen
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://sources.gentoo.org/baselayout/trunk/Makefile?r1=3171&r2=3172
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: script to create stage1 (and more)

Description Markus Rothe (RETIRED) gentoo-dev 2008-07-24 09:42:59 UTC
trying to build a stage1 using baselayout 2.0.0 and catalyst-9999 (checked out today 2008-07-24) I am running into the following problem:


>>> Emerging (51 of 63) sys-apps/baselayout-2.0.0 to /
make: Nothing to be done for `all'.
# These dirs may not exist from prior versions
for x in  ; do \
                install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.0/image/$x || exit $? ; \
                touch /var/tmp/portage/sys-apps/baselayout-2.0.0/image/$x/.keep || exit $? ; \
        done
install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.0/image//etc
cp -pPR etc/* etc.Linux/* /var/tmp/portage/sys-apps/baselayout-2.0.0/image//etc/
install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.0/image//usr/share/baselayout
cp -pPR share.Linux/* /var/tmp/portage/sys-apps/baselayout-2.0.0/image//usr/share/baselayout/
make: Entering directory `/var/tmp/portage/sys-apps/baselayout-2.0.0/image/usr/share/baselayout'
# Create base filesytem layout
for x in /dev /sys /boot /home /mnt /root /proc /etc/profile.d /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man /var/lock /var/run /var/empty ; do \
                install -m 0755 -d /$x || exit $? ; \
                touch /$x/.keep || exit $? ; \
        done
touch: cannot touch `//proc/.keep': No such file or directory
make: *** [layout] Error 1
make: Leaving directory `/var/tmp/portage/sys-apps/baselayout-2.0.0/image/usr/share/baselayout'
 * 
 * ERROR: sys-apps/baselayout-2.0.0 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_preinst
 *             environment, line  678:  Called die
 * The specific snippet of code:
 *           emake -C "${D}/usr/share/${PN}" DESTDIR="${ROOT}" layout || die "failed to layout filesystem";
 *  The die message:
 *   failed to layout filesystem
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/sys-apps/baselayout-2.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/baselayout-2.0.0/temp/environment'.
 * 
!!! FAILED preinst: 1
Comment 1 Markus Rothe (RETIRED) gentoo-dev 2008-07-24 09:46:03 UTC
Created attachment 161244 [details]
script to create stage1 (and more)

this shows how I build the stage. I use the command line options instead of a spec file, so I have no spec file to show you.
Comment 2 Markus Rothe (RETIRED) gentoo-dev 2008-07-24 09:48:45 UTC
this is the stage1root layout after the failure: /proc is definetly *there* and empty, so the ebuild should be able to "touch /proc/.keep"...

# ls /var/tmp/catalyst/tmp/default/stage1-ppc64-64ul-2008.07.24/tmp/stage1root/ -l   
total 36
drwxr-xr-x  2 root root 4096 Jul 24 09:25 bin
drwxr-xr-x 12 root root 4096 Jul 24 09:25 etc
drwxr-xr-x  3 root root 4096 Jul 24 09:23 lib
drwxr-xr-x  3 root root 4096 Jul 24 09:23 lib64
drwxr-xr-x  2 root root 4096 Jul 24 06:33 proc
drwxr-xr-x  2 root root 4096 Jul 24 09:25 sbin
drwxrwxrwt  2 root root 4096 Jul 24 06:33 tmp
drwxr-xr-x 10 root root 4096 Jul 24 09:23 usr
drwxr-xr-x  7 root root 4096 Jul 24 06:48 var


# ls /var/tmp/catalyst/tmp/default/stage1-ppc64-64ul-2008.07.24/tmp/stage1root/proc/ -al
total 8
drwxr-xr-x  2 root root 4096 Jul 24 06:33 .
drwxr-xr-x 11 root root 4096 Jul 24 09:23 ..
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2008-07-28 15:38:17 UTC
Except that /proc is bind-mounted from outside the chroot.  Honestly, the ebuild should take into account not being able to write to /proc...  at least, the older baselayout 1.x ebuilds do.
Comment 4 Eric Thibodeau 2008-10-15 14:45:48 UTC
My current workaround to get it to build (simply eliminate /proc from the list in the Makefile):

kyron clustering-livecd # diff -ru /usr/portage/sys-apps/baselayout/baselayout-2.0.0.ebuild overlay/sys-apps/baselayout/baselayout-2.0.0-r1.ebuild
--- /usr/portage/sys-apps/baselayout/baselayout-2.0.0.ebuild    2008-08-19 14:07:06.000000000 -0400
+++ overlay/sys-apps/baselayout/baselayout-2.0.0-r1.ebuild      2008-10-15 10:44:09.000000000 -0400
@@ -127,6 +127,14 @@
        rm -f "${D}"/usr/share/${PN}/Makefile
 }

+src_unpack(){
+       unpack ${A}
+       cd "${S}"
+       if use build; then
+               sed -e's:/boot /home /mnt /root /proc /etc/profile.d:/boot /home /mnt /root /etc/profile.d:' Makefile
+       fi
+}
+
 src_install() {
        local libdir="lib"
        [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
Comment 5 Kola Bernard 2010-02-04 13:04:32 UTC
(In reply to comment #4)
> My current workaround to get it to build (simply eliminate /proc from the list in the Makefile):

*bump*
Same problem with 2.0.1, but /proc and /sys.
Patch do not work, because Makefile was modificated.

KEEP_DIRS-Linux += /dev /sys
KEEP_DIRS = $(KEEP_DIRS-$(OS)) \
        /boot /home /mnt /root /proc /etc/profile.d \
        /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \
        /var/lock /var/run /var/empty

More when I'm home. ;-)
Comment 6 SpanKY gentoo-dev 2010-02-06 01:32:22 UTC
probably fixed by:
http://sources.gentoo.org/baselayout/trunk/Makefile?r1=3171&r2=3172
Comment 7 Stuart Longland (RETIRED) gentoo-dev 2010-08-11 06:03:26 UTC
Is it possible to produce an updated baselayout package with this fix in it?  I've just been boned by this bug too.

One wonders why /tmp/stage1root/proc needs to be mounted, since we're not chrooting into /tmp/stage1root... I dare say it's done for good reason, just haven't figured out why that is.

I managed to work around it by umounting the offending bind-mount at the appropriate time, that has got me past this blocker, but an updated baselayout would be greatly appreciated.
Comment 8 SpanKY gentoo-dev 2010-08-11 16:57:10 UTC
no one reported back that the proposed change worked.  until that happens, i dont plan on rolling a new version.
Comment 9 Rolf 2010-08-30 19:50:09 UTC
(In reply to comment #8)
> no one reported back that the proposed change worked.  until that happens, i
> dont plan on rolling a new version.
> 

I can confirm the fix from comment #6 works. I roll it into a patch and use an overlay to get catalyst to build the stages.
Comment 10 Stuart Longland (RETIRED) gentoo-dev 2010-08-31 02:38:00 UTC
Well, as I say, it'd be nice to have the fix rolled into baselayout formally... as without it, I get:

!!! Directory does not exist: '/usr/lib/ccache/bin'
!!! Disabled FEATURES='ccache'
>>> Installing (49 of 66) sys-devel/gcc-4.4.4-r1 to /tmp/stage1root/
>>> Emerging (50 of 66) sys-apps/baselayout-2.0.1 for /tmp/stage1root/

!!! Directory does not exist: '/usr/lib/ccache/bin'
!!! Disabled FEATURES='ccache'

!!! Directory does not exist: '/usr/lib/ccache/bin'
!!! Disabled FEATURES='ccache'
>>> Installing (50 of 66) sys-apps/baselayout-2.0.1 to /tmp/stage1root/
>>> Failed to install sys-apps/baselayout-2.0.1 to /tmp/stage1root/, Log file:
>>>  '/var/tmp/portage/sys-apps/baselayout-2.0.1/temp/build.log'
 * CPV:  sys-apps/baselayout-2.0.1
 * REPO: gentoo 
 * USE:  build elibc_glibc kernel_linux mips userland_GNU
make: Nothing to be done for `all'.
# These dirs may not exist from prior versions
for x in  ; do \
                install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.1/image/$x || exit $? ; \
                touch /var/tmp/portage/sys-apps/baselayout-2.0.1/image/$x/.keep || exit $? ; \
        done
install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.1/image//etc
cp -pPR etc/* etc.Linux/* /var/tmp/portage/sys-apps/baselayout-2.0.1/image//etc/
install -m 0755 -d /var/tmp/portage/sys-apps/baselayout-2.0.1/image//usr/share/baselayout
cp -pPR share.Linux/* /var/tmp/portage/sys-apps/baselayout-2.0.1/image//usr/share/baselayout/
make: Entering directory `/var/tmp/portage/sys-apps/baselayout-2.0.1/image/usr/share/baselayout'
# Create base filesytem layout
for x in /dev /sys /boot /home /mnt /root /proc /etc/profile.d /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man /var/lock /var/run /var/empty ; do \
                install -m 0755 -d /tmp/stage1root/$x || exit $? ; \
                touch /tmp/stage1root/$x/.keep || exit $? ; \
        done
touch: cannot touch `/tmp/stage1root//proc/.keep': No such file or directory
make: *** [layout] Error 1
make: Leaving directory `/var/tmp/portage/sys-apps/baselayout-2.0.1/image/usr/share/baselayout'
 * ERROR: sys-apps/baselayout-2.0.1 failed:
 *   failed to layout filesystem
 *
 * Call stack:  
 *     ebuild.sh, line  54:  Called pkg_preinst
 *   environment, line 928:  Called die
 * The specific snippet of code:
 *           emake -C "${D}/usr/share/${PN}" DESTDIR="${ROOT}" layout || die "failed to layout filesystem";
 *
 * If you need support, post the output of 'emerge --info =sys-apps/baselayout-2.0.1',
 * the complete build log and the output of 'emerge -pqv =sys-apps/baselayout-2.0.1'.
 * The complete build log is located at '/var/tmp/portage/sys-apps/baselayout-2.0.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/baselayout-2.0.1/temp/environment'.
 * S: '/var/tmp/portage/sys-apps/baselayout-2.0.1/work/baselayout-2.0.1'
!!! FAILED preinst: 1

I still wonder why /tmp/stage1root needs a /proc mounted though, since we're not chrooted into it AFAIK (or am I mistaken?... everything works fine without it mounted.)
Comment 11 Siarhei Siamashka 2010-10-02 13:40:00 UTC
(In reply to comment #8)
> no one reported back that the proposed change worked.  until that happens, i
> dont plan on rolling a new version.

The proposed change works, and building stage1 fails without having it (on mips). Is there anything that that prevents rolling out a new version now with all the feedback available? Thanks.
Comment 12 Matt Turner gentoo-dev 2010-11-03 05:15:11 UTC
Ugh. Just ran into this tonight as well.
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2010-11-04 00:34:24 UTC
+*baselayout-2.0.1-r1 (04 Nov 2010)
+
+  04 Nov 2010; Samuli Suominen <ssuominen@gentoo.org>
+  +baselayout-2.0.1-r1.ebuild, +files/baselayout-2.0.1-proc_touch.patch:
+  Fix Stage1 building wrt #232823.