Bug#637298: broken cross-debootstraps (--foreign) with host=kfreebsd and target=linux
Package: debootstrap
Version: 1.0.34
Severity: normal
Tags: patch
User: debian-bsd@lists.debian.org
While cross-deboostraping a linux-i386 chroot using kfreebsd-amd64 host:
$ sudo debootstrap --foreign --arch=i386 squeeze /tmp/test
/usr/sbin/debootstrap: 425: cannot create /tmp/test/test-dev-null: Invalid argument
E: Cannot install into target '/tmp/test' mounted with noexec or nodev
the problem here is that $ARCH stores the target architecture, but it is used
for tests where only the host architecture is relevant.
Please consider attached patch to fix the problem by adding a new variable,
$HOST_ARCH, for the host architecture.
-- System Information:
Debian Release: 6.0.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 8.1-1-amd64
Locale: LANG=ca_AD.utf8, LC_CTYPE=ca_AD.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages debootstrap depends on:
ii wget 1.12-2.1 retrieves files from the web
Versions of packages debootstrap recommends:
ii debian-archive-keyring 2010.08.28 GnuPG archive keys of the Debian a
ii gnupg 1.4.10-4 GNU privacy guard - a free PGP rep
debootstrap suggests no packages.
-- no debconf information
=== modified file 'debootstrap'
--- debootstrap 2011-08-10 10:28:36 +0000
+++ debootstrap 2011-08-10 10:48:04 +0000
@@ -28,6 +28,7 @@ KEYRING=""
DISABLE_KEYRING=""
VARIANT=""
ARCH=""
+HOST_ARCH=""
KEEP_DEBOOTSTRAP_DIR=""
USE_DEBIANINSTALLER_INTERACTION=""
SECOND_STAGE_ONLY=""
@@ -389,20 +390,24 @@ fi
###########################################################################
-if [ "$ARCH" != "" ]; then
- true
-elif [ -x /usr/bin/dpkg ] && \
+if [ -x /usr/bin/dpkg ] && \
/usr/bin/dpkg --print-architecture >/dev/null 2>&1; then
- ARCH=`/usr/bin/dpkg --print-architecture`
+ HOST_ARCH=`/usr/bin/dpkg --print-architecture`
elif type udpkg >/dev/null 2>&1 && \
udpkg --print-architecture >/dev/null 2>&1; then
- ARCH=`/usr/bin/udpkg --print-architecture`
+ HOST_ARCH=`/usr/bin/udpkg --print-architecture`
elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
- ARCH=`cat $DEBOOTSTRAP_DIR/arch`
+ HOST_ARCH=`cat $DEBOOTSTRAP_DIR/arch`
else
error 1 WHATARCH "Couldn't work out current architecture"
fi
+if [ "$ARCH" != "" ]; then
+ true
+else
+ ARCH=$HOST_ARCH
+fi
+
if [ "$TARGET" = "/" ]; then
CHROOT_CMD=""
elif doing_variant scratchbox; then
=== modified file 'functions'
--- functions 2011-08-10 10:28:36 +0000
+++ functions 2011-08-10 10:47:04 +0000
@@ -938,7 +938,7 @@ clear_mtab () {
}
setup_proc () {
- case "$ARCH" in
+ case "$HOST_ARCH" in
kfreebsd-*)
umount_on_exit /dev
umount_on_exit /proc
@@ -977,7 +977,7 @@ setup_devices () {
return 0
fi
- case "$ARCH" in
+ case "$HOST_ARCH" in
kfreebsd-*)
in_target mount -t devfs devfs /dev ;;
hurd-*)
@@ -1198,7 +1198,7 @@ get_next_predep () {
check_sane_mount () {
mkdir -p "$1"
- case "$ARCH" in
+ case "$HOST_ARCH" in
kfreebsd-*|hurd-*)
;;
*)
Reply to: