tags 308169 + patch thanks Lex Spoon <[EMAIL PROTECTED]> writes:
> debootstrap fails with the following error: > > I: Installing core packages... > dpkg: can't mmap package info file `/var/lib/dpkg/available': Invalid argument > W: Failure trying to run: chroot /root/woody-chroot dpkg --force-depends > --inst > all /var/cache/apt/archives/base-files_3.0.2_i386.deb > /var/cache/apt/archives/b > ase-passwd_3.4.1_i386.deb > > > The file does exist but has size 0: > > # ls -l woody-chroot/var/lib/dpkg/available > -rw-r--r-- 1 root root 0 May 8 11:02 woody-chroot/var/lib/dpkg/available This is a dpkg bug exposed by kernels >= 2.6.12 and which was fixed in dpkg 1.13.8[0]; however that doesn't help anyone trying to debootstrap chroots of pre-etch versions of Debian. A trivial work around is to have the available file contain just a newline rather than be empty, e.g. as in the attached patch[1] (which is for --variant=buildd, but the same patch should apply to the plain 'woody' script and other distro versions). -- James [0] | dpkg (1.13.8) experimental; urgency=low | | The "In like Flynn" Release. | | * Linux 2.6.12 changed the behaviour of mmap to fail and set EINVAL when | given a zero length, rather than returning NULL. This is POSIXly | correct, so handle zero-length package control files (like available). [1] --- /usr/lib/debootstrap/scripts/woody.buildd.old 2005-04-01 15:40:41.000000000 +0100 +++ /usr/lib/debootstrap/scripts/woody.buildd 2005-10-22 01:29:31.000000000 +0100 @@ -70,7 +70,7 @@ mkdir -p "$TARGET/var/lib/dpkg" : >"$TARGET/var/lib/dpkg/status" - : >"$TARGET/var/lib/dpkg/available" + echo >"$TARGET/var/lib/dpkg/available" setup_etc if [ ! -e "$TARGET/etc/fstab" ]; then -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]