add proot support
This commit is contained in:
parent
83ba112abb
commit
acfcacd78b
11 changed files with 35 additions and 39 deletions
1
TODO
1
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap
|
||||
aptsources=Debian
|
||||
allowrecommends=false
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap
|
||||
aptsources=Debian
|
||||
allowrecommends=false
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
Section "Device"
|
||||
Identifier "Builtin Default fbdev Device 0"
|
||||
Driver "omapfb"
|
||||
Option "fb" "/dev/fb0"
|
||||
Driver "fbdev"
|
||||
EndSection
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap
|
||||
aptsources=Debian
|
||||
allowrecommends=false
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap
|
||||
aptsources=Debian_apt
|
||||
allowrecommends=false
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap Debian_pkgfso
|
||||
aptsources=Debian
|
||||
allowrecommends=false
|
||||
|
|
53
polystrap.sh
53
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 <j.schauer@email.de>
|
||||
#
|
||||
|
@ -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 .
|
||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
|||
directory=$ROOTDIR
|
||||
cleanup=true
|
||||
unpack=true
|
||||
noauth=true
|
||||
bootstrap=Debian_bootstrap
|
||||
aptsources=Debian
|
||||
allowrecommends=false
|
||||
|
|
Loading…
Reference in a new issue