[Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
hello everyone, I'm trying to setup an ARM cross-compiling environment inside of an i386 Xubuntu machine. What I do is: # build scratchbox2 from source # build qemu from source # setup environment in $ROOTFS $ cd $ROOTFS $ sb2-init -n -c $HOME/sbox2/bin/qemu/bin/qemu-arm /path/to/arm-linux-gcc $ fakeroot /usr/sbin/debootstrap --variant=scratchbox --foreign --arch armel wheezy $ROOTFS http://ftp.de.debian.org/debian $ sb2 -eR ./debootstrap/debootstrap --second-stage The last command fails. It doesn't create any output. Instead I get lots of lines like this in $ROOTFS/debootstrap/debootstrap.log: tar: dev/kmem: Cannot mknod: Permission denied tar: dev/mem: Cannot mknod: Permission denied tar: dev/core: Cannot open: File exists tar: dev/null: Cannot utime: Operation not permitted It seems to me like the problem is, that /dev is not remapped: $ sb2 -eR sb2-show path /dev /dev => /dev I tried the "install" mapping, but ended up with this: $ sb2 -m install -R sb2-show path /dev sb2: Error: Failed to find out how /home/tuxor/sbox2/bin/qemu/bin/qemu-arm should be started I couldn't figure out what that means, because in general my qemu-arm ist working properly. What's the problem here? And how can I solve it? - MORE DETAILS: # build scratchbox2 from source $ git clone git://gitorious.org/scratchbox2/scratchbox2.git $ cd scratchbox2 $ ./autogen.sh $ ./configure --prefix=$HOME/sbox2/bin/scratchbox $ make install # build qemu from source $ git clone git://git.savannah.nongnu.org/qemu.git $ cd qemu $ git checkout v0.13.0 -b devel_env $ ./configure --prefix=$HOME/sbox2/bin/qemu $ make $ make install ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
Thanks for your fast response, Lauri. Unfortunately the build process of sb2 fails now completely for me. But I have a new setup of Xubuntu 11.10 i386 - it could also be related to that: This is how I'm trying to build scratchbox2 at the moment: $ git clone git://gitorious.org/scratchbox2/scratchbox2.git $ cd scratchbox2 $ git checkout -b 2.3_development origin/2.3_development $ ./autogen.sh $ ./configure --prefix=$HOME/sbox2/bin/scratchbox $ make install And this is the error message that "make install" produces: [ARCHIVE] luaif/liblua.a [CC] sb2d/libsupport.o [CC] utils/sb2dctl.o [LD] utils/sb2dctl utils/sb2dctl.o: In function `call_sb2__ruletree_rpc__ping__': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:50: undefined reference to `dlsym' utils/sb2dctl.o: In function `main': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:96: undefined reference to `dlopen' utils/sb2dctl.o: In function `call_sb2__ruletree_rpc__init2__': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:45: undefined reference to `dlsym' Looks like a flag "-ldl" is missing somewhere. Any ideas? Shell I use the latest qemu from the 1.0 branch or stick to the "legacy" 0.15 branch? ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
I'm helpless about this as well. gcc is correctly called with -ldl as we can see from the verbose output: gcc -g -O2 -O2 -g -Wall -W -I/home/tuxor/sbox2/src/scratchbox2/include -I/home/tuxor/sbox2/src/scratchbox2/include -I/home/tuxor/sbox2/src/scratchbox2/luaif/lua-5.1.4/src -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Wall -W -Werror -I/home/tuxor/sbox2/src/scratchbox2/preload -Ipreload/ -Wmissing-prototypes -Wstrict-prototypes -I/home/tuxor/sbox2/src/scratchbox2/include -ldl -Wp,-MT,utils/sb2dctl.o -Wp,-MMD,utils/.sb2dctl.o.d -o utils/sb2dctl.o -c utils/sb2dctl.c gcc -g -O2 -O2 -g -Wall -W -I/home/tuxor/sbox2/src/scratchbox2/include -I/home/tuxor/sbox2/src/scratchbox2/include -I/home/tuxor/sbox2/src/scratchbox2/luaif/lua-5.1.4/src -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Wall -W -Werror -I/home/tuxor/sbox2/src/scratchbox2/preload -Ipreload/ -Wmissing-prototypes -Wstrict-prototypes -I/home/tuxor/sbox2/src/scratchbox2/include -ldl -o utils/sb2dctl sb2d/libsupport.o utils/sb2dctl.o rule_tree/rule_tree_rpc_client.o sblib/sb_log.o utils/sb2dctl.o: In function `call_sb2__ruletree_rpc__ping__': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:50: undefined reference to `dlsym' utils/sb2dctl.o: In function `main': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:96: undefined reference to `dlopen' utils/sb2dctl.o: In function `call_sb2__ruletree_rpc__init2__': /home/tuxor/sbox2/src/scratchbox2/utils/sb2dctl.c:45: undefined reference to `dlsym' collect2: ld returned 1 exit status My main machine is a x86_64 Fedora 16 and here it's building fine using the exact same procedure... Would you recommend qemu 0.15 or 1.0? ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
Perfect, thank you! The same applies to ./sb2d/Makefile for "-lm". After that it builds fine. Unfortunately I'm running into a new error now when running sb2-init: sb2-init: Creating Debian build system settings for this target: Can't locate strict.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at /usr/bin/dpkg-architecture line 21. BEGIN failed--compilation aborted at /usr/bin/dpkg-architecture line 21. Can't locate strict.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at /usr/bin/dpkg-architecture line 21. BEGIN failed--compilation aborted at /usr/bin/dpkg-architecture line 21. But strict.pm actually is in my @INC: $ ls -l /usr/share/perl/5.12/strict.pm -rw-r--r-- 1 root root 879 2011-09-06 10:22 /usr/share/perl/5.12/strict.pm How is that possible? Am 17.04.2012 22:24, schrieb lauri.t.aar...@nokia.com: Right, I'd need to remove -ldl from CFLAGS and add it to the end of the line which reads "$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^". About Qemu versions: The general rule is that always take the latest one. I don't know any reasons why you should not use 1.0 (I'm still using something older in my testing environment, but that is a different thing; when developing SB2, I'm trying to minimize changes i.e. SB2 is the only component which gets regular updates, others are frozen currently. That really simplifies regression testing) Lauri ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
I don't know what caused it in the first place. But the perl-errors concerning @INC vanished completely after an update to 2.3.53. Still "sb2 -eR ./debootstrap/debootstrap --second-stage" fails, but there are only three lines left in ./debootstrap/debootstrap.log: tar: dev/null: Cannot mknod: File exists tar: dev: Cannot utime: Operation not permitted tar: Exiting with failure status due to previous errors Before the update I had dozens of lines concerning "mknod". Good work so far. Seems like we're getting somewhere :) Am 18.04.2012 16:37, schrieb Lauri T. Aarnio: Sorry, I couldn't reproduce that problem here. Without knowing more about your configuration it is quite difficult to guess. Please start by verifying that "sb2 sb2-show path /usr/share/perl/5.12/strict.pm" gives sensible results. But 2.3.53 is now in gitorious, please try that one. It has several fixes and even some added consistency checks. Again, as usual, everything seems to work OK for me..please keep sending the bug reports when something doesn't work for you. Lauri ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] Problem with my embedded board
How can I specified the correct path for my library? Interesting question! I was also wondering about how to set LD_LIBRARY_PATH to a certain value. Changing it with sb2-config will break my whole scratchbox environment (unsetenv helps here, of course). This shell script doesn't work either: #!/bin/bash LD_LIBRARY_PATH="/my/own/lib:$LD_LIBRARY_PATH" $@ ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
[Scratchbox-users] sb2rc: xmalloc: ... cannot allocate 40 bytes
When running "sb2 -eR dpkg", I sometimes get error messages of this kind: /tmp/sb2-tuxor-20120419-163915.lxHjXZ/modes/emulate/sb2rc: xmalloc: ../bash/parse.y:6019: cannot allocate 40 bytes (65536 bytes allocated) For example, during installation of "libpcre3:armel" via "sb2 -eR apt-get install libpcre3:armel", the command "sb2 -eR dpkg --configure libpcre3:armel" is executed but fails due to the above error. Another example is "sb2 -eR dpkg --remove libglib2.0-0:armel". This is on an armel wheezy debootstrap inside Xubuntu 11.10 i386 (inside VirtualBox) with qemu 1.0.1 and scratchbox2 ver 2.3.53. I managed to complete the bootstrap despite the problems with "utime" and "/dev/null" (discussed in a different thread) by making some changes to the "debootstrap" script. Please note, that this error is not 100% reproducible. When executing the above command several times in a row, it will always present the same error message. But _sometimes_ the error message doesn't reappear when executing the command later. Strangely enough, I couldn't reproduce it with the same scratchbox2+debootstrap setup inside a Fedora 16 x86_64 machine. If it's entirely enigmatic, what might have caused this error, it's probably related to the VirtualBox setup, though I actually can't think of a connection.. ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
Anyway, .54 seems to run most (if not all?) postinstall steps, but I get some failures to the log. I'm not sure if those are fatal or not, and don't have more time for debugging today, sorry. I'm trying to sum up, what's still missing for the second-stage of debootstrap. ### There are mainly two critical errors: 1. libuuid1 and other packages can't be configured because useradd and groupadd commands are corrupt. They report "failure while writing changes to /etc/passwd" and "[...] /etc/group" respectively. 2. The following problem is with "sysvinit": rm: cannot remove `/dev/initctl': Permission denied ### For the first error there is an obvious workaround: echo "libuuid:*:101:" >> etc/group echo "libuuid:*:101:101:libuuid:/var/lib/libuuid:/bin/sh" >> etc/passwd For now it's only a workaround. In the long term we will need an improved behaviour of the groupadd and useradd commands. The second error is more problematic. Looks like we need a new scratchbox2 mapping rule for this. ### There is a kind of "warning", when "initscripts" tries to link /run/ to /var/run. I'm not entirely sure how to fix this though: guest environment detected: Linking /run to /var/run rmdir: failed to remove `/run': Directory not empty Can't symlink /run to /var/run; please fix manually. This seems to be non-critical though. ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] debootstrap --second-stage fails because of /dev/ mapping
useradd seems to work for me, I have libuuid in /etc/passwd of the debootstrapped thing and I'm also able to run useradd manually. How does it fail for you? The error ouput is not really helpful: $ sb2 -eR groupadd libuuid groupadd: failure while writing changes to /etc/group This is on my Fedora 16 (x86_64) machine, selinux disabled. Please note, that groupadd works on my Xubuntu (i386) in VirtualBox. "sb2-show path /etc/group" and "sb2-show exec /usr/sbin/groupadd" have completely equivalent output on both machines. On the Xubuntu machine, the debootstrap fails simply because of that strange xmalloc/xrealloc error, I mentioned in a different thread on this mailinglist. By the way, I feel like this (second) option is sufficient for the moment. But I'm not at all into this, sorry. The second way would be otherwise similar, but limited to specific file system locations. In practise that would mean that the /dev mapping rules would have an additional flag indicating that unlink() etc shall never return EPERM from there. ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] Problem with my embedded board
Does it help if you export LD_LIBRARY_PATH in that script? As there is no user's LD_LIBRARY_PATH in the environment by default, your assignment in the script does not change the environment. It only sets a local shell variable which doesn't affect anything. Thanks, you are totally right. "export" does the trick: #!/bin/bash export LD_LIBRARY_PATH="/my/own/lib:$LD_LIBRARY_PATH" $@ Yes, that seems to be a bug. "sb2-config setenv LD_LIBRARY_PATH=..." causes problems at startup (the bug is in sb2-monitor, related to option -e) Okay, as long as the above shell script is working properly, I have an appropriate workaround. I'm quite happy with that :) ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users
Re: [Scratchbox-users] SB2: A document about internals and architecture
Great! So far, I only skimmed and scanned it quickly. No time for a closer look. But I will read at least the first few chapters, as soon as I can afford a minute or two :) Why don't you add it to the wiki of the scratchbox2 project home at gitorious, as well? This way it's easier to find and will probably also be included in the google search results. Am 26.04.2012 16:03, schrieb Lauri T. Aarnio: Hi All, A document called "Scratchbox 2: Internals and Architecture" is now available in the source repository; http://gitorious.org/scratchbox2 => check out branch "2.3_development" => pick it up from the "docs" subdirectory. It is a .pdf file, contains 33 pages. The document was originally written for developers of software development kits (SDKs) and for people who maintain SB2, so it wasn't intended to be any kind of user guide. Still the first two or three chapters might be useful for anybody who wants to learn more about Scratchbox 2. Enjoy, Lauri ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users ___ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users