Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2020 12:55:00 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r542573 - in head/sysutils/debootstrap: . files
Message-ID:  <202007191255.06JCt07R069574@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Jul 19 12:54:59 2020
New Revision: 542573
URL: https://svnweb.freebsd.org/changeset/ports/542573

Log:
  sysutils/deboostrap: make it use bash, mount fdescfs,
  ignore --configure errors
  
  For some reason, when run with stock sh(1) the script aborts just
  after 'Unpacking the base system'.
  
  The fdescfs mount fixes 'dpkg --configure' for rsyslog. Note that
  there are also some kernel patches required to make it work completely.
  
  The fdescfs is not enough to fix everything, though, so just ignore
  'dpkg --configure' errors for Bionic; they don't break anything important.
  
  PR:		ports/247698
  Reviewed by:	0mp (earlier version)
  Approved by:	maintainer timeout (2 weeks)
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D25594

Added:
  head/sysutils/debootstrap/files/patch-functions   (contents, props changed)
  head/sysutils/debootstrap/files/patch-scripts-bionic   (contents, props changed)
Modified:
  head/sysutils/debootstrap/Makefile
  head/sysutils/debootstrap/files/patch-Makefile
  head/sysutils/debootstrap/files/patch-debootstrap

Modified: head/sysutils/debootstrap/Makefile
==============================================================================
--- head/sysutils/debootstrap/Makefile	Sun Jul 19 12:53:12 2020	(r542572)
+++ head/sysutils/debootstrap/Makefile	Sun Jul 19 12:54:59 2020	(r542573)
@@ -3,6 +3,7 @@
 
 PORTNAME=	debootstrap
 PORTVERSION=	1.0.115
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	DEBIAN/pool/main/d/${PORTNAME}
 DISTNAME=	${PORTNAME}_${PORTVERSION}
@@ -13,7 +14,8 @@ COMMENT=	Install Debian base system into a directory
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/debian/copyright
 
-RUN_DEPENDS=	wget:ftp/wget
+RUN_DEPENDS=	wget:ftp/wget \
+		bash:shells/bash
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
 NO_BUILD=	yes
@@ -29,6 +31,9 @@ post-patch:
 		${WRKSRC}/Makefile \
 		${WRKSRC}/debootstrap
 	@${REINPLACE_CMD} -e 's,%%DATADIR%%,${DATADIR},g' \
+		${WRKSRC}/Makefile \
+		${WRKSRC}/debootstrap
+	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},g' \
 		${WRKSRC}/Makefile \
 		${WRKSRC}/debootstrap
 

Modified: head/sysutils/debootstrap/files/patch-Makefile
==============================================================================
--- head/sysutils/debootstrap/files/patch-Makefile	Sun Jul 19 12:53:12 2020	(r542572)
+++ head/sysutils/debootstrap/files/patch-Makefile	Sun Jul 19 12:54:59 2020	(r542573)
@@ -1,6 +1,6 @@
---- Makefile.orig	2016-09-09 12:30:20 UTC
+--- Makefile.orig	2019-07-06 11:22:30 UTC
 +++ Makefile
-@@ -6,14 +6,12 @@ all:
+@@ -5,14 +5,12 @@ all:
  
  clean:
  

Modified: head/sysutils/debootstrap/files/patch-debootstrap
==============================================================================
--- head/sysutils/debootstrap/files/patch-debootstrap	Sun Jul 19 12:53:12 2020	(r542572)
+++ head/sysutils/debootstrap/files/patch-debootstrap	Sun Jul 19 12:54:59 2020	(r542573)
@@ -1,5 +1,11 @@
---- debootstrap.orig	2018-06-13 13:00:11 UTC
+--- debootstrap.orig	2019-07-06 11:22:30 UTC
 +++ debootstrap
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!%%LOCALBASE%%/bin/bash
+ set -e
+ 
+ VERSION='@VERSION@'
 @@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then
  	if [ -x /debootstrap/debootstrap ]; then
  		DEBOOTSTRAP_DIR=/debootstrap
@@ -9,7 +15,7 @@
  	fi
  fi
  
-@@ -474,13 +474,7 @@ fi
+@@ -498,13 +498,7 @@ fi
  
  ###########################################################################
  
@@ -24,15 +30,15 @@
  	HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch")
  fi
  HOST_OS="$HOST_ARCH"
-@@ -502,6 +496,11 @@ if [ -z "$HOST_OS" ]; then
+@@ -524,6 +518,11 @@ if [ -z "$HOST_OS" ]; then
+ 			HOST_OS=freebsd
+ 		;;
  	esac
- fi
- 
++fi
++
 +if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then
 +	HOST_ARCH=kfreebsd-`/sbin/sysctl -n hw.machine_arch`
 +	EXTRACTOR_OVERRIDE=ar
-+fi
-+
- if [ -z "$ARCH" ]; then
- 	ARCH="$HOST_ARCH"
  fi
+ 
+ if [ -z "$ARCH" ]; then

Added: head/sysutils/debootstrap/files/patch-functions
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/debootstrap/files/patch-functions	Sun Jul 19 12:54:59 2020	(r542573)
@@ -0,0 +1,20 @@
+--- functions.orig	2019-07-06 11:22:30 UTC
++++ functions
+@@ -1139,6 +1139,7 @@ setup_proc () {
+ 	case "$HOST_OS" in
+ 	    *freebsd*)
+ 		umount_on_exit /dev
++		umount_on_exit /dev/fd
+ 		umount_on_exit /proc
+ 		umount "$TARGET/proc" 2>/dev/null || true
+ 		if [ "$HOST_OS" = kfreebsd ]; then
+@@ -1224,7 +1225,8 @@ setup_dynamic_devices () {
+ 	    kfreebsd*)
+ 		in_target mount -t devfs devfs /dev ;;
+ 	    freebsd)
+-		mount -t devfs devfs "$TARGET/dev" ;;
++		mount -t devfs devfs "$TARGET/dev"
++		mount -t fdescfs -o linrdlnk fdescfs "$TARGET/dev/fd" ;;
+ 	    hurd*)
+ 	        # Use the setup-translators of the hurd package
+ 	        in_target /usr/lib/hurd/setup-translators -k ;;

Added: head/sysutils/debootstrap/files/patch-scripts-bionic
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/debootstrap/files/patch-scripts-bionic	Sun Jul 19 12:54:59 2020	(r542573)
@@ -0,0 +1,16 @@
+--- scripts/bionic.orig	2020-07-08 20:51:17.590645000 +0100
++++ scripts/bionic	2020-07-08 20:51:28.786509000 +0100
+@@ -249,10 +249,13 @@ echo \"Warning: Fake initctl called, doing nothing\"" 
+ 
+ 		info CONFBASE "Configuring the base system..."
+ 
++		# This step sometimes fails due to some missing functionality in Linuxulator.  Just ignore it.
++		set +e
+ 		smallyes '' |
+ 			(repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages.  This will be re-attempted up to five times." "" \
+ 			dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
+ 			dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
++		set -e
+ 	fi
+ 
+ 	if [ -x "$TARGET/sbin/initctl.REAL" ]; then



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