############# This is OLD ANCIENT STUFF Ignore it. It's lying around waiting for me to be satisfied that I no longer require any of the information contained within ################################################################ #Follow the instructions to untar it onto the new system. groupadd sbox adduser build # Enter 'sbox' as its additional group tar -zxvf scratchbox-version.tar.gz -C/ /scratchbox/run_me_first.sh # Install Slackware package utilities into the scratchbox # In Slackware these live in /sbin but it should be OK to put # them in scratchbox's /usr/bin, although there are a few things # that will break because of it (my program, slacktrack, for example # is one of them), but it'll do for now. cp -a /sbin/*pkg* /scratchbox/tools/bin # Fix up the location of tar-1.13 (we build tar-1.13 later) perl -pi -e 's?TAR=.*?TAR=/scratchbox/tools/bin/tar-1.13?;' /scratchbox/tools/bin/*pkg* # Fix up installpkg so that it deletes the contents of /install # after installing a package. It can't delete the /install # dir from within the scratchbox because it's owned by root. # Deleting just the contents is fine. perl -pi -e 's?rm -rf install?rm -rf install/* install?;' /scratchbox/tools/bin/installpkg adduser build Add 'sbox' as one of its supplementary groups. /scratchbox/sbin/sbox_adduser build # Login/su as 'build' /scratchbox/users/build/run.sh sbox-config -lc | grep "arm-linux-glibc$" | awk -F: '{print $1}' sbox-config --create-target=ARM --compiler-name=arm-gcc-3.3_3.3.2ds5 sbox-config --select-target=ARM sbox-config --copy-clibrary # NOW, as root on the HOST SYSTEM (OUTSIDE scratchbox): # # ## Prepare our clean Slackware system ## # # Install Slackware's group so that makepkg can do chown root.bin # Yes, this has the additional sbox group but this will get removed # eventually when we re-do aaa_base package. cp -f /etc/group /scratchbox/users/build/targets/ARM/etc/ # Install the Slackware /var/ directories required for package management ( cd /scratchbox/users/build/targets/ARM/var mkdir log mkdir -p log/scripts log/packages log/setup/tmp chown -R build.users . ) # Install altertrack into the tools dir: cp -fa /usr/bin/altertrack /scratchbox/tools/bin/ # Fix it up so it looks for makepkg in the scratchbox: perl -pi -e 's?MAKEPKG=.*?MAKEPKG=/scratchbox/tools/bin/makepkg?;' /scratchbox/tools/bin/altertrack # Create a '/install' for makepkg to use # As root of the box (outside scratchbox) mkdir -p /scratchbox/users/build/targets/ARM/install chown build.users /scratchbox/users/build/targets/ARM/install ( cd /scratchbox/users/build/targets/links ln -s /targets/ARM/install . chown build.users install cd /scratchbox/users/build ln -s /targets/links/install . ) ################################################################ # Build some Slackware tools ################################################################ # Slackware's pkgtools require tar-1.13, no other version works # properly. cd slackware-current/source/a/tar tar zxf tar-1.13.tar.gz -C/tmp CWD="$( pwd )" cd /tmp/tar-1.13 zcat $CWD/bzip2-tar.diff.gz | patch -p1 CC=host-gcc CFLAGS=-02 ./configure && make mv tar /scratchbox/tools/bin/tar-1.13 # Now, as root (not within scratchbox) mv -f /tmp/tar-1.13/src/tar /scratchbox/tools/bin/tar-1.13 # On x86 Slackware build box: # The uids should be the uid of the user 'build' and the gid of the # group 'sbox'. # I couldn't give a monkeys about security - it's my secure development LAN. cat << EOF > /etc/exports / 192.168.1.0/255.255.255.0(rw,no_root_squash,sync) /scratchbox/users/build/targets/ARM 192.168.1.0/255.255.255.0(sync,rw,all_squash,anonuid=1001,anongid=100) /scratchbox/users/build/home 192.168.1.0/255.255.255.0(sync,rw,all_squash,anonuid=1001,anongid=100) EOF # Restart the services: /etc/rc.d/rc.portmap restart /etc/rc.d/rc.nfsd restart # Now move onto stokely, the ARM box: # stokely is the brute force installed Debian box that barely works ;) portmap rpc.lockd cd /mnt mkdir sorbet mount sorbet:/ sorbet # Install the glibc-2.2.4 version of the sbrshd client as # this is what I found to work with Debian-ARM v3.0r1 install -m755 sorbet/scratchbox/device_tools/arm/sbrshd-*2.2.4* /bin/sbrshd echo "sbox:x:102:build" >> /etc/group cat << EOF >> /etc/passwd build:x:1001:100::/home/build:/bin/bash EOF cat << EOF >> /etc/shadow build:$1$6rW0oap/$9iSpdaUW7xZExpJF8LOaK0:12432:0:99999:7::: EOF cd /home mkdir build chown -R build.users build # Launch the sbrshd server on stokely (ARM box/device): sbrshd -S/usr/bin/bash # This IP is the IP of sorbet (the scratchbox system server) # Leave the password as password. cat << EOF > /home/build/.sbrshd 192.168.1.2 password EOF # Otherwise the sbrsh server responds with "No space left on device" # which is nonsense. mkdir -p /home/build/192.168.1.2-ARM chown -R build.users /home/build/ # Back on sorbet (scratchbox): cd /scratchbox/users/build/home/build cat << EOF > .sbrsh ARM 192.168.1.13 password nfs 192.168.1.2:/scratchbox/users/build/targets/ARM / rw,nolock,noac nfs 192.168.1.2:/scratchbox/users/build/home /home rw,nolock,noac bind /dev /dev bind /proc /proc bind /tmp /tmp EOF # bash won't build if sbrsh is being chatty: cat << EOF >> .bashrc unset SBOX_CPUTRANSPARENCY_VERBOSE export SBOX_UNAME_MACHINE=arm # make uname return 'arm' EOF chown -R build.users . Restarting scratchbox --------------------- On your x86 Slackware system: cat << EOF >> /etc/rc.d/rc.local # Start scratchbox: /scratchbox/sbin/sbox_ctl start EOF Error building bash ------------------- SBOX_DISABLE_CPUTRANSPARENCY=1 disables the whole thing unsetting SBOX_CPUTRANSPARENCY_VERBOSE just disables the messages it prints to stderr unset SBOX_CPUTRANSPARENCY_VERBOSE Building nano into the scratchbox ---------------------------------- host-gcc 00:04 <@lle> use it to build it 00:04 <@lle> CC=host-gcc 00:05 <@lle> then install it into /host_usr/bin You _can_ create new compilers for scratchbox that way as well You just need to install them under /scratchbox/compiler/your-compiler-di ADDITIONAL REQUIREMENTS ----------------------- Within the scratchbox: ( cd armedslack-current/source/scratchbox tar zxf nano*gz -C/tmp cd /tmp/nano* CC=host-gcc \ ./configure \ --prefix=/host_usr \ --enable-multibuffer \ --enable-extra \ --enable-nanorc \ --enable-undo \ --enable-color && \ make && make install ( cd /host_usr/bin ln -fs nano pico ) ) # Build texinfo (makeinfo is required to build info files) ( cd armedslack-current/source/ap/texinfo tar jxf texinfo*bz2 -C/tmp cd /tmp/texinfo* CC=host-cc ./configure --prefix=/host_usr && make && make install ) Building -------- CFLAGS="-02 -march=strongarm" ./configure I build under fakeroot so that the Slackware .tgz packages can inherit the correct ownerships. fakeroot source /sb_etc/profile Making a new toolchain for use with SB -------------------------------------- Just compile it inside scratchbox using host-gcc 19:03 <@lle> Install it under /scratchbox/compilers/your-compiler 19:04 <@lle> of course you need to change permissions there to be able to write there 19:04 <@lle> Then look for sample gcc.specs, compiler-name and target_setup.sh files 19:04 <@lle> They go into /scratchbox/compilers/your-compiler directory After that you can select your new toolchain with sbox-config Just to see how our toolchain is built, download the sources for 0.9.7 and look under compilers/toolchain_glibc directory 19:06 <@lle> This is how I now do the uclibc toolchains Disabling misc_runner --------------------- This is causing a problem building glibc outside of SB: look at /scratchbox/sbin/register_arm 13:43 <@lle> You need to unregister the ARM elf format from the binfmt_misc 13:43 <@lle> That's why it complains about misc_runner when you build outside scratchbox 13:43 <@lle> Of course that means that it tries to run an ARM binary 13:44 <@lle> Which might mean that the build fails if you disable cpu-trans Redirecting Scratchbox binaries ------------------------------- SBOX_REDIRECT_BINARIES can have multiple pairs of paths, the pairs must be separated with ',' 13:46 <@lle> for example: =/usr/bin/make:/scratchbox/tools/bin/make,/usr/bin/env:/scratchbox/tools/bin/env Using this prevents that particular box from going to the ARM box in the first place. But if the binary is already running on the ARM box and the binary calls something else, how does this work? eg. in sunrpc/rpcgen, glibc calls this and it executes on the ARM box rpcgen is called with rpcgen -Y ../scripts in ../scripts is a shell script called 'cpp'. This executes the contents of the predefined (somewhere) variable CPP. How does the cpu transparency work? Because the rpcgen binary is already running on the ARM, will it then try to execute ../scripts/cpp as well? Making netkit-bootparmd work ---------------------------- With scratchbox 0.9.7, rpcgen hasn't been built correctly and it will not run without some fiddling. As root, cd /scratchbox/alien_tools/bin cp /scratchbox/compilers/i386-linux-glibc/usr/bin/rpcgen . /scratchbox/tools/bin/alien_tool_links