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
|
* if gconf2 is to be installed bug #636083
|
||||||
* have libfakeroot-sysv.so not in the libfakeroot subdirectory (no idea why
|
* 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)
|
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:
|
# Default-Stop:
|
||||||
### END INIT INFO
|
### 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
|
for f in rsa dsa ecdsa; do rm -rf /etc/ssh/ssh_host_\${f}_key; done
|
||||||
echo "generating ssh rsa key..."
|
echo "generating ssh rsa key..."
|
||||||
ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C "" -N ""
|
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 ""
|
ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -C "" -N ""
|
||||||
echo "generating ssh ecdsa key..."
|
echo "generating ssh ecdsa key..."
|
||||||
ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C "" -N ""
|
ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C "" -N ""
|
||||||
|
|
||||||
update-rc.d -f firstboot remove
|
|
||||||
__END__
|
__END__
|
||||||
|
|
||||||
chmod +x $ROOTDIR/etc/init.d/firstboot
|
chmod +x $ROOTDIR/etc/init.d/firstboot
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap
|
bootstrap=Debian_bootstrap
|
||||||
aptsources=Debian
|
aptsources=Debian
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap
|
bootstrap=Debian_bootstrap
|
||||||
aptsources=Debian
|
aptsources=Debian
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Section "Device"
|
Section "Device"
|
||||||
Identifier "Builtin Default fbdev Device 0"
|
Identifier "Builtin Default fbdev Device 0"
|
||||||
Driver "omapfb"
|
Driver "fbdev"
|
||||||
Option "fb" "/dev/fb0"
|
|
||||||
EndSection
|
EndSection
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
Section "InputClass"
|
Section "InputClass"
|
||||||
Identifier "S3C24XX TouchScreen"
|
Identifier "calibration"
|
||||||
MatchProduct "S3C24XX TouchScreen"
|
MatchProduct "TSC2007 Touchscreen"
|
||||||
Option "Calibration" "110 922 924 96"
|
Option "Calibration" "339 3524 3798 225"
|
||||||
Option "SwapAxes" "1"
|
|
||||||
EndSection
|
EndSection
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap
|
bootstrap=Debian_bootstrap
|
||||||
aptsources=Debian
|
aptsources=Debian
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap
|
bootstrap=Debian_bootstrap
|
||||||
aptsources=Debian_apt
|
aptsources=Debian_apt
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap Debian_pkgfso
|
bootstrap=Debian_bootstrap Debian_pkgfso
|
||||||
aptsources=Debian
|
aptsources=Debian
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
53
polystrap.sh
53
polystrap.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# polystrap - create a foreign architecture rootfs using multistrap, fakeroot,
|
# polystrap - create a foreign architecture rootfs using multistrap, proot,
|
||||||
# fakechroot and qemu usermode emulation
|
# and qemu usermode emulation
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011 by Johannes 'josch' Schauer <j.schauer@email.de>
|
# 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
|
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 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C
|
||||||
export PATH=$PATH:/usr/sbin:/sbin
|
export PATH=$PATH:/usr/sbin:/sbin
|
||||||
|
|
||||||
if [ "$FAKEROOTKEY" = "" ]; then
|
#if [ "$FAKEROOTKEY" = "" ]; then
|
||||||
echo "I: re-executing script inside fakeroot"
|
# echo "I: re-executing script inside fakeroot"
|
||||||
fakeroot "$0" "$@";
|
# fakeroot "$0" "$@";
|
||||||
exit
|
# exit
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
FORCE=""
|
FORCE=""
|
||||||
MSTRAP_SIM=
|
MSTRAP_SIM=
|
||||||
|
@ -87,7 +90,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export QEMU_LD_PREFIX="`readlink -m "$ROOTDIR"`"
|
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: --------------------------"
|
||||||
echo "I: suite: $SUITE"
|
echo "I: suite: $SUITE"
|
||||||
|
@ -119,20 +122,20 @@ done < $BOARD/multistrap.conf
|
||||||
|
|
||||||
# download and extract packages
|
# download and extract packages
|
||||||
echo "I: run multistrap" >&2
|
echo "I: run multistrap" >&2
|
||||||
multistrap $MSTRAP_SIM -f "$MULTISTRAPCONF"
|
proot -0 multistrap $MSTRAP_SIM -f "$MULTISTRAPCONF"
|
||||||
[ -z "$MSTRAP_SIM" ] || exit 0
|
[ -z "$MSTRAP_SIM" ] || exit 0
|
||||||
|
|
||||||
rm -f "$MULTISTRAPCONF"
|
rm -f "$MULTISTRAPCONF"
|
||||||
|
|
||||||
# convert absolute symlinks for fakechroot
|
## convert absolute symlinks for fakechroot
|
||||||
for link in `find $ROOTDIR -type l`; do
|
#for link in `find $ROOTDIR -type l`; do
|
||||||
target=`readlink $link`
|
# target=`readlink $link`
|
||||||
if [ "${target%%/*}" = "" ]; then # target begins with slash
|
# if [ "${target%%/*}" = "" ]; then # target begins with slash
|
||||||
echo "I: convert symlink: ${link#$ROOTDIR} -> $target"
|
# echo "I: convert symlink: ${link#$ROOTDIR} -> $target"
|
||||||
rm $link
|
# rm $link
|
||||||
ln -s ${ROOTDIR}$target $link
|
# ln -s ${ROOTDIR}$target $link
|
||||||
fi
|
# fi
|
||||||
done
|
#done
|
||||||
|
|
||||||
# copy initial directory tree - dereference symlinks
|
# copy initial directory tree - dereference symlinks
|
||||||
echo "I: copy initial directory root tree $BOARD/root/ to $ROOTDIR/"
|
echo "I: copy initial directory root tree $BOARD/root/ to $ROOTDIR/"
|
||||||
|
@ -144,7 +147,7 @@ fi
|
||||||
echo "I: preseed debconf"
|
echo "I: preseed debconf"
|
||||||
if [ -r "$BOARD/debconfseed.txt" ]; then
|
if [ -r "$BOARD/debconfseed.txt" ]; then
|
||||||
cp "$BOARD/debconfseed.txt" $ROOTDIR/tmp/
|
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
|
rm $ROOTDIR/tmp/debconfseed.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -154,12 +157,12 @@ for script in $ROOTDIR/var/lib/dpkg/info/*.preinst; do
|
||||||
echo "I: run preinst script ${script##$ROOTDIR}"
|
echo "I: run preinst script ${script##$ROOTDIR}"
|
||||||
DPKG_MAINTSCRIPT_NAME=preinst \
|
DPKG_MAINTSCRIPT_NAME=preinst \
|
||||||
DPKG_MAINTSCRIPT_PACKAGE="`basename $script .preinst`" \
|
DPKG_MAINTSCRIPT_PACKAGE="`basename $script .preinst`" \
|
||||||
fakechroot chroot $ROOTDIR ${script##$ROOTDIR} install
|
$CHROOTQEMUCMD $ROOTDIR ${script##$ROOTDIR} install
|
||||||
done
|
done
|
||||||
|
|
||||||
# run dpkg --configure -a twice because of errors during the first run
|
# run dpkg --configure -a twice because of errors during the first run
|
||||||
echo "I: configure packages"
|
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
|
# source hooks
|
||||||
if [ -r "$BOARD/hooks" ]; then
|
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
|
# 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
|
# tar is clever enough to not try and put the archive inside itself
|
||||||
TARBALL=$(basename $ROOTDIR).tar
|
#TARBALL=$(basename $ROOTDIR).tar
|
||||||
echo "I: create tarball $TARBALL"
|
#echo "I: create tarball $TARBALL"
|
||||||
fakechroot chroot $ROOTDIR tar -cf $TARBALL -C / .
|
#$CHROOTCMD $ROOTDIR tar -cf $TARBALL -C / .
|
||||||
mv $ROOTDIR/$TARBALL .
|
#mv $ROOTDIR/$TARBALL .
|
||||||
|
|
|
@ -3,7 +3,6 @@ arch=$ARCH
|
||||||
directory=$ROOTDIR
|
directory=$ROOTDIR
|
||||||
cleanup=true
|
cleanup=true
|
||||||
unpack=true
|
unpack=true
|
||||||
noauth=true
|
|
||||||
bootstrap=Debian_bootstrap
|
bootstrap=Debian_bootstrap
|
||||||
aptsources=Debian
|
aptsources=Debian
|
||||||
allowrecommends=false
|
allowrecommends=false
|
||||||
|
|
Loading…
Reference in a new issue