Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2013 12:48:22 GMT
From:      Roman Naumann <namor@hemio.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/179766: [PATCH] debootstrap fails on freebsd with --foreign option
Message-ID:  <201306201248.r5KCmMds087263@oldred.freebsd.org>
Resent-Message-ID: <201306201250.r5KCo0xe027590@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306201248.r5KCmMds087263>