From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jun 20 12:50:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0E63DF7 for ; Thu, 20 Jun 2013 12:50:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 96C0A1601 for ; Thu, 20 Jun 2013 12:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5KCo0Pw027591 for ; Thu, 20 Jun 2013 12:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5KCo0xe027590; Thu, 20 Jun 2013 12:50:00 GMT (envelope-from gnats) Resent-Date: Thu, 20 Jun 2013 12:50:00 GMT Resent-Message-Id: <201306201250.r5KCo0xe027590@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Roman Naumann Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5127BDB0 for ; Thu, 20 Jun 2013 12:48:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2B65B15D2 for ; Thu, 20 Jun 2013 12:48:23 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r5KCmM4F087265 for ; Thu, 20 Jun 2013 12:48:22 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r5KCmMds087263; Thu, 20 Jun 2013 12:48:22 GMT (envelope-from nobody) Message-Id: <201306201248.r5KCmMds087263@oldred.freebsd.org> Date: Thu, 20 Jun 2013 12:48:22 GMT From: Roman Naumann To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/179766: [PATCH] debootstrap fails on freebsd with --foreign option X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 12:50:00 -0000 >Number: 179766 >Category: ports >Synopsis: [PATCH] debootstrap fails on freebsd with --foreign option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 20 12:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Roman Naumann >Release: FreeBSD 9.1 >Organization: >Environment: FreeBSD xxxxx 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0 >Description: Using the --foreign option with the debootstrap script should install several architecture specific files into /TARGETDIR/debootstrap, but it does not. The reason is, that the script tries to copy a file called devices.tar.gz from /usr/local/share/debootstrap, which does not exist. Since the script uses "set -e", at this point it silently fails. The next part (chroot into /TARGETDIR and calling /debootstrap/debootstrap --second-stage) FAILS because of missing files. Note that while a broken --foreign/--second-stage installation in a chroot itself does not necessarily qualify as a critical bug, currently and unrelated to this report and patch, the 'normal' installation is broken as well right now, so that --foreign/--second-stage installations are the only way to install a debian chroot... Right now, as is in ports, debootstrap is of little use. Also the fix just removes the line which tries to copy the devices.tar.gz file. This is a freebsd specific patch not made to go upstream. If upstream wants to fix the issue, one would have to find our which architectures besides Linux need devices.tar.gz (hurd?) and wrap the copying in a conditional. >How-To-Repeat: root$ kldload tmpfs root$ mkdir /debian root$ debootstrap --foreign wheezy http://cdn.debian.net/debian root$ echo $? # note the erro code 1 ! root$ mount -t devfs devfs /debian/dev root$ mount -t linprocfs linprocfs /debian/proc root$ mount -t linsysfs linsysfs /debian/sys root$ chroot /debian /bin/bash root$ /debootstrap/debootstrap --second-stage # fails due to missing files >Fix: Apply patch to ports svn checkout (in directory: sysutils/debootstrap). root$ cd /usr/ports/sysutils/debootstrap root$ make deinstall reinstall clean Patch attached with submission follows: Index: files/patch-debootstrap =================================================================== --- files/patch-debootstrap (revision 321370) +++ files/patch-debootstrap (working copy) @@ -1,6 +1,6 @@ ---- debootstrap.orig 2011-08-25 20:19:23.294346076 +0200 -+++ debootstrap 2011-08-25 20:22:42.850735086 +0200 -@@ -419,6 +419,10 @@ +--- debootstrap.orig 2013-05-18 23:39:44.000000000 +0200 ++++ debootstrap 2013-06-20 13:11:32.583440073 +0200 +@@ -423,6 +423,10 @@ esac fi @@ -11,3 +11,11 @@ if [ -z "$ARCH" ]; then ARCH=$HOST_ARCH fi +@@ -619,7 +623,6 @@ + if ! am_doing_phase second_stage; then + cp "$0" "$TARGET/debootstrap/debootstrap" + cp $DEBOOTSTRAP_DIR/functions "$TARGET/debootstrap/functions" +- cp $DEBOOTSTRAP_DIR/devices.tar.gz "$TARGET/debootstrap/devices.tar.gz" + cp $SCRIPT "$TARGET/debootstrap/suite-script" + echo "$ARCH" >"$TARGET/debootstrap/arch" + echo "$SUITE" >"$TARGET/debootstrap/suite" >Release-Note: >Audit-Trail: >Unformatted: