[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

A couple of polystrap patches, and more problems to be solved



[PATCH 1/3] Use cdn.debian.net as default mirror.

 Although most people doing heavy use of polystrap/multistrap will use
 local mirrors, providing a sane official mirror in default/config seems
 a good idea to me.

[PATCH 2/3] Support -n flag to run multistrap --simulate instead.

 At least that helped me to go forward, could be useful to others

[PATCH 3/3] Documentation improvements.

 That one is probably just a start: although those steps were
 necessary to make progress, I still could not run the postinsts.

It looks like fakeroot and fakechroot are both required in the rootfs:

+ fakechroot chroot qtmoko-rootfs /var/lib/dpkg/info/apt.preinst install
ERROR: ld.so: object 'libfakechroot.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.

Adding fakechroot to the list of packages is sufficient to stop the
complaints, but just adding fakeroot is not sufficient (on an amd64
machine) for some reason.  The following hack gets rid of the second
complaint, which seems to indicate that someone messes with
LD_LIBRARY_PATH, which is apparently properly set by fakeroot:

$ fakeroot env|grep LD
LD_PRELOAD=libfakeroot-sysv.so
LD_LIBRARY_PATH=/usr/lib/libfakeroot:/usr/lib64/libfakeroot:/usr/lib32/libfakeroot

diff --git a/polystrap.sh b/polystrap.sh
index 36cfd5b..f17a0cb 100755
--- a/polystrap.sh
+++ b/polystrap.sh
@@ -129,6 +129,9 @@ if [ $ARCH != "`dpkg --print-architecture`" ]; then
        esac
 fi
 
+# fakeroot hack
+ln -s libfakeroot/libfakeroot-sysv.so $ROOTDIR/usr/lib/
+
 # preseed debconf
 if [ -r "$PLATFORM/debconfseed.txt" ]; then
        cp "$PLATFORM/debconfseed.txt" $ROOTDIR/tmp/


Has anyone encountered this problem ?


Nevertheless, even with that hack, polystrap later fails with:

+ fakechroot chroot qtmoko-rootfs /var/lib/dpkg/info/bluez-alsa.preinst install
[...]/qtmoko-rootfs/bin/sh: Can't open /var/lib/dpkg/info/bluez-alsa.preinst

... although that preinst script does exist in the rootfs.  However,
it does not exist in my /, whereas the ones which were successfully
launched do exist.

For some reason, the armel package for fakechroot does contain an
/usr/lib/libfakechroot.so file, which is not a symlink, and does not
appear to work as intended in my case - looks like it just prevents
the complaint.  Replacing it with a symlink allows to go further, but
it is still an awful hack:

diff --git a/polystrap.sh b/polystrap.sh
index 36cfd5b..9c2fd3e 100755
--- a/polystrap.sh
+++ b/polystrap.sh
@@ -129,6 +129,11 @@ if [ $ARCH != "`dpkg --print-architecture`" ]; then
        esac
 fi
 
+# fake*root hack
+ln -s libfakeroot/libfakeroot-sysv.so $ROOTDIR/usr/lib/
+rm -f $ROOTDIR/usr/lib/libfakechroot.so
+ln -s fakechroot/libfakechroot.so $ROOTDIR/usr/lib/
+
 # preseed debconf
 if [ -r "$PLATFORM/debconfseed.txt" ]; then
        cp "$PLATFORM/debconfseed.txt" $ROOTDIR/tmp/

It then fails the known insserv error, /sbin not being in the user's PATH

BTW, multistrap being in /usr/sbin/ for some reason, I already had to
add /usr/sbin to my PATH.  Now if I invoke polystrap as follows, at
least the preinst step completes (with uninitialized values in
debconf, which will probably have to be hunted down later):

PATH=$PATH:/sbin:/usr/sbin ./polystrap.sh ../qtmoko/emdebian


Hm, not so true: x11-common still spits an anoying error:

+ fakechroot chroot qtmoko-rootfs /var/lib/dpkg/info/x11-common.preinst install
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Debconf/Config.pm line 22.
/var/lib/dpkg/info/x11-common.config: 127: awk: not found
/var/lib/dpkg/info/x11-common.preinst: 134: awk: not found

...although I have gawk installed, the alternative has not been
created at that time.

<digression>
Looks like a sign that a step-by-step process would be needed, much
like apt is capable to finish configuration of some packages before
unpacking others.  In that case, it could be sufficient to first
install and configure the base system, and then call multistrap a
second time for extra packages - or make it just generic and let the
user define as many successive multistrap runs as he may need.

This also brings me to another question: the run of *.preinst _after_
having unpacked the deb.  While it is probably necessary (and maybe
even safe ?  I have not looked at how d-i does) for essential
packages, for installation of later packages, it would surely be safer
to run the preinst first, as they are intended.  That also seems to
hint for multiple steps, with "unpack-before-preinst" being a per-step
option.
</digression>

Afterwards, both configure attempts fail because of lack of ldconfig -
I'm not sure to understand what is supposed to provide them:

+ fakechroot chroot qtmoko-rootfs /usr/bin/dpkg --configure -a
dpkg: warning: 'ldconfig' not found in PATH or not executable.
dpkg: 1 expected program not found in PATH or not executable.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
+ fakechroot chroot qtmoko-rootfs /usr/bin/dpkg --configure -a
dpkg: warning: 'ldconfig' not found in PATH or not executable.
dpkg: 1 expected program not found in PATH or not executable.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.


For the record, here is my current multistrap.conf and a suitable
config:

---->8----
ROOTDIR=qtmoko-rootfs
MIRROR=http://cdn.debian.net/debian
QTMOKO_MIRROR=http://qtmoko.sourceforge.net/debian/
---->8----
[General]
arch=armel
debootstrap=Debian Qtmoko
aptsources=Debian Qtmoko
omitrequired=true
#hookdir=hooks
#configscript=config.sh
directory=$ROOTDIR
#tarballname=qtmoko-rootfs.tgz
cleanup=true

# because of qtmoko repo
noauth=true

# something like an override of "components"
[Debian]
packages=ifupdown procps netbase nano module-init-tools wget openssh-server screen mc alsa-utils ppp udhcpc wpasupplicant wireless-tools iputils-ping iproute bluez bluez-alsa dosfstools fbset klogd psmisc iptables dash ttf-dejavu
# libs that are probably redundant
packages=libpng12-0 libjpeg62 libxtst6 libts-0.0-0 libasound2
# essential packages not here by default ?!
packages=bash grep gzip mount tar login hostname e2fsprogs sysvinit apt base-passwd makedev diffutils findutils bsdutils
packages=wpasupplicant busybox
# to complete install
packages=fakeroot fakechroot

source=$MIRROR
keyring=debian-archive-keyring
suite=squeeze
components=main contrib non-free
omitdebsrc=true

[Qtmoko]
packages=qtmoko linux-image-2.6.34-qtmoko-gta02
source=$QTMOKO_MIRROR ./
keyring=
omitdebsrc=true
---->8----


Reply to: