From acfcacd78bc5cca4a2cf02495659fc9d70dc5835 Mon Sep 17 00:00:00 2001 From: josch Date: Sat, 21 Jun 2014 15:18:34 +0200 Subject: [PATCH] add proot support --- TODO | 1 + default/hooks/firstboot | 4 +- default/multistrap.conf | 1 - goldel-gta04/multistrap.conf | 1 - goldel-gta04/root/etc/X11/xorg.conf | 3 +- .../root/etc/X11/xorg.conf.d/s3c2410.conf | 7 ++- kirkwood/multistrap.conf | 1 - notioninkadam/multistrap.conf | 1 - om-gta02/multistrap.conf | 1 - polystrap.sh | 53 ++++++++++--------- touchbook/multistrap.conf | 1 - 11 files changed, 35 insertions(+), 39 deletions(-) diff --git a/TODO b/TODO index ff64638..828d935 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,4 @@ * if gconf2 is to be installed bug #636083 * have libfakeroot-sysv.so not in the libfakeroot subdirectory (no idea why the linker doesnt find it otherwise - it works for fakechroot.so in subdir) + * initrd cannot be created diff --git a/default/hooks/firstboot b/default/hooks/firstboot index 7f1119e..ca784d1 100644 --- a/default/hooks/firstboot +++ b/default/hooks/firstboot @@ -8,6 +8,8 @@ cat > $ROOTDIR/etc/init.d/firstboot << __END__ # Default-Stop: ### END INIT INFO +update-rc.d -f firstboot remove + for f in rsa dsa ecdsa; do rm -rf /etc/ssh/ssh_host_\${f}_key; done echo "generating ssh rsa key..." ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C "" -N "" @@ -15,8 +17,6 @@ echo "generating ssh dsa key..." ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -C "" -N "" echo "generating ssh ecdsa key..." ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C "" -N "" - -update-rc.d -f firstboot remove __END__ chmod +x $ROOTDIR/etc/init.d/firstboot diff --git a/default/multistrap.conf b/default/multistrap.conf index e914a7b..f257743 100644 --- a/default/multistrap.conf +++ b/default/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap aptsources=Debian allowrecommends=false diff --git a/goldel-gta04/multistrap.conf b/goldel-gta04/multistrap.conf index e914a7b..f257743 100644 --- a/goldel-gta04/multistrap.conf +++ b/goldel-gta04/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap aptsources=Debian allowrecommends=false diff --git a/goldel-gta04/root/etc/X11/xorg.conf b/goldel-gta04/root/etc/X11/xorg.conf index 6506fca..9e5d69a 100644 --- a/goldel-gta04/root/etc/X11/xorg.conf +++ b/goldel-gta04/root/etc/X11/xorg.conf @@ -1,5 +1,4 @@ Section "Device" Identifier "Builtin Default fbdev Device 0" - Driver "omapfb" - Option "fb" "/dev/fb0" + Driver "fbdev" EndSection diff --git a/goldel-gta04/root/etc/X11/xorg.conf.d/s3c2410.conf b/goldel-gta04/root/etc/X11/xorg.conf.d/s3c2410.conf index e022f5b..8a9d085 100644 --- a/goldel-gta04/root/etc/X11/xorg.conf.d/s3c2410.conf +++ b/goldel-gta04/root/etc/X11/xorg.conf.d/s3c2410.conf @@ -1,6 +1,5 @@ Section "InputClass" - Identifier "S3C24XX TouchScreen" - MatchProduct "S3C24XX TouchScreen" - Option "Calibration" "110 922 924 96" - Option "SwapAxes" "1" + Identifier "calibration" + MatchProduct "TSC2007 Touchscreen" + Option "Calibration" "339 3524 3798 225" EndSection diff --git a/kirkwood/multistrap.conf b/kirkwood/multistrap.conf index e914a7b..f257743 100644 --- a/kirkwood/multistrap.conf +++ b/kirkwood/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap aptsources=Debian allowrecommends=false diff --git a/notioninkadam/multistrap.conf b/notioninkadam/multistrap.conf index fd42c53..c4663cc 100644 --- a/notioninkadam/multistrap.conf +++ b/notioninkadam/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap aptsources=Debian_apt allowrecommends=false diff --git a/om-gta02/multistrap.conf b/om-gta02/multistrap.conf index 015c657..1dc9304 100644 --- a/om-gta02/multistrap.conf +++ b/om-gta02/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap Debian_pkgfso aptsources=Debian allowrecommends=false diff --git a/polystrap.sh b/polystrap.sh index 2f1f091..9c68724 100755 --- a/polystrap.sh +++ b/polystrap.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# polystrap - create a foreign architecture rootfs using multistrap, fakeroot, -# fakechroot and qemu usermode emulation +# polystrap - create a foreign architecture rootfs using multistrap, proot, +# and qemu usermode emulation # # Copyright (C) 2011 by Johannes 'josch' Schauer # @@ -27,14 +27,17 @@ usage() { echo "Usage: $0: [-f] [-v] [-n] [-s suite] [-a arch] [-d directory] [-m mirror] [-p packages] platform\n" >&2 } +CHROOTQEMUCMD="proot -q qemu-arm -v -1 -0 -b /dev -b /sys -b /proc" +CHROOTCMD="proot -v -1 -0" + export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C export PATH=$PATH:/usr/sbin:/sbin -if [ "$FAKEROOTKEY" = "" ]; then - echo "I: re-executing script inside fakeroot" - fakeroot "$0" "$@"; - exit -fi +#if [ "$FAKEROOTKEY" = "" ]; then +# echo "I: re-executing script inside fakeroot" +# fakeroot "$0" "$@"; +# exit +#fi FORCE="" MSTRAP_SIM= @@ -87,7 +90,7 @@ else fi export QEMU_LD_PREFIX="`readlink -m "$ROOTDIR"`" -export FAKECHROOT_CMD_SUBST=/usr/bin/ldd=/usr/bin/ldd.fakechroot:/sbin/ldconfig=/bin/true +#export FAKECHROOT_CMD_SUBST=/usr/bin/ldd=/usr/bin/ldd.fakechroot:/sbin/ldconfig=/bin/true echo "I: --------------------------" echo "I: suite: $SUITE" @@ -119,20 +122,20 @@ done < $BOARD/multistrap.conf # download and extract packages echo "I: run multistrap" >&2 -multistrap $MSTRAP_SIM -f "$MULTISTRAPCONF" +proot -0 multistrap $MSTRAP_SIM -f "$MULTISTRAPCONF" [ -z "$MSTRAP_SIM" ] || exit 0 rm -f "$MULTISTRAPCONF" -# convert absolute symlinks for fakechroot -for link in `find $ROOTDIR -type l`; do - target=`readlink $link` - if [ "${target%%/*}" = "" ]; then # target begins with slash - echo "I: convert symlink: ${link#$ROOTDIR} -> $target" - rm $link - ln -s ${ROOTDIR}$target $link - fi -done +## convert absolute symlinks for fakechroot +#for link in `find $ROOTDIR -type l`; do +# target=`readlink $link` +# if [ "${target%%/*}" = "" ]; then # target begins with slash +# echo "I: convert symlink: ${link#$ROOTDIR} -> $target" +# rm $link +# ln -s ${ROOTDIR}$target $link +# fi +#done # copy initial directory tree - dereference symlinks echo "I: copy initial directory root tree $BOARD/root/ to $ROOTDIR/" @@ -144,7 +147,7 @@ fi echo "I: preseed debconf" if [ -r "$BOARD/debconfseed.txt" ]; then cp "$BOARD/debconfseed.txt" $ROOTDIR/tmp/ - fakechroot chroot $ROOTDIR debconf-set-selections /tmp/debconfseed.txt + $CHROOTQEMUCMD $ROOTDIR debconf-set-selections /tmp/debconfseed.txt rm $ROOTDIR/tmp/debconfseed.txt fi @@ -154,12 +157,12 @@ for script in $ROOTDIR/var/lib/dpkg/info/*.preinst; do echo "I: run preinst script ${script##$ROOTDIR}" DPKG_MAINTSCRIPT_NAME=preinst \ DPKG_MAINTSCRIPT_PACKAGE="`basename $script .preinst`" \ - fakechroot chroot $ROOTDIR ${script##$ROOTDIR} install + $CHROOTQEMUCMD $ROOTDIR ${script##$ROOTDIR} install done # run dpkg --configure -a twice because of errors during the first run echo "I: configure packages" -fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a || fakechroot chroot $ROOTDIR /usr/bin/dpkg --configure -a +$CHROOTQEMUCMD $ROOTDIR /usr/bin/dpkg --configure -a || $CHROOTCMD $ROOTDIR /usr/bin/dpkg --configure -a # source hooks if [ -r "$BOARD/hooks" ]; then @@ -175,7 +178,7 @@ rm $ROOTDIR/usr/sbin/policy-rc.d # need to generate tar inside fakechroot so that absolute symlinks are correct # tar is clever enough to not try and put the archive inside itself -TARBALL=$(basename $ROOTDIR).tar -echo "I: create tarball $TARBALL" -fakechroot chroot $ROOTDIR tar -cf $TARBALL -C / . -mv $ROOTDIR/$TARBALL . +#TARBALL=$(basename $ROOTDIR).tar +#echo "I: create tarball $TARBALL" +#$CHROOTCMD $ROOTDIR tar -cf $TARBALL -C / . +#mv $ROOTDIR/$TARBALL . diff --git a/touchbook/multistrap.conf b/touchbook/multistrap.conf index e914a7b..f257743 100644 --- a/touchbook/multistrap.conf +++ b/touchbook/multistrap.conf @@ -3,7 +3,6 @@ arch=$ARCH directory=$ROOTDIR cleanup=true unpack=true -noauth=true bootstrap=Debian_bootstrap aptsources=Debian allowrecommends=false