Index: head/sysutils/debootstrap/Makefile =================================================================== --- head/sysutils/debootstrap/Makefile (revision 561562) +++ head/sysutils/debootstrap/Makefile (revision 561563) @@ -1,41 +1,41 @@ # Created by: Martin Matuska # $FreeBSD$ PORTNAME= debootstrap PORTVERSION= 1.0.123 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= DEBIAN/pool/main/d/${PORTNAME} DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= trasz@FreeBSD.org COMMENT= Install Debian or Ubuntu base system into a directory LICENSE= MIT LICENSE_FILE= ${WRKSRC}/debian/copyright RUN_DEPENDS= wget:ftp/wget \ bash:shells/bash WRKSRC= ${WRKDIR}/${PORTNAME} NO_BUILD= yes NO_ARCH= yes USES= gmake perl5 USE_PERL5= run post-patch: @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \ ${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 post-install: ${INSTALL_MAN} ${WRKSRC}/debootstrap.8 \ ${STAGEDIR}${MAN8PREFIX}/man/man8/debootstrap.8 .include Index: head/sysutils/debootstrap/files/patch-scripts-gutsy =================================================================== --- head/sysutils/debootstrap/files/patch-scripts-gutsy (revision 561562) +++ head/sysutils/debootstrap/files/patch-scripts-gutsy (revision 561563) @@ -1,38 +1,51 @@ --- scripts/gutsy.orig 2020-03-13 02:04:21 UTC +++ scripts/gutsy @@ -242,10 +242,21 @@ echo \"Warning: Fake initctl called, doing nothing\"" predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") # XXX: progress is tricky due to how dpkg_progress works # -- cjwatson 2009-07-29 + # This step sometimes fails due to some missing functionality in Linuxulator. Just ignore it. + set +e p; smallyes '' | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) + rc=$? base=$(without "$base" "$predep") done_predeps="$done_predeps $predep" + + if [ $rc != 0 ]; then + warning FREEBSD_00 "Applying FreeBSD-specific workaround..." + # ... for "Failed to mount /etc/machine-id: Bad address" with Focal. + in_target truncate -s0 /var/lib/dpkg/info/systemd.postinst + in_target dpkg --configure systemd + fi + set -e done if [ -n "$base" ]; then @@ -256,10 +267,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 +@@ -267,6 +281,12 @@ echo \"Warning: Fake initctl called, doing nothing\"" + fi + mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" + rm -f "$TARGET/usr/sbin/policy-rc.d" ++ ++ echo \ ++"# Workaround for Linuxulator missing mremap(2) support; without it, ++# apt(8) fails like this: ++# E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. ++APT::Cache-Start 251658240;" >> "$TARGET/etc/apt/apt.conf.d/00freebsd" + + progress $bases $bases CONFBASE "Configuring base system" + info BASESUCCESS "Base system installed successfully." Index: head/sysutils/debootstrap/files/patch-scripts_debian-common =================================================================== --- head/sysutils/debootstrap/files/patch-scripts_debian-common (revision 561562) +++ head/sysutils/debootstrap/files/patch-scripts_debian-common (revision 561563) @@ -1,24 +1,37 @@ ---- scripts/debian-common.orig 2021-01-12 21:19:09 UTC +--- scripts/debian-common.orig 2020-03-13 02:04:21 UTC +++ scripts/debian-common @@ -200,10 +200,21 @@ echo \"Warning: Fake start-stop-daemon called, doing n predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") # XXX: progress is tricky due to how dpkg_progress works # -- cjwatson 2009-07-29 + # This step sometimes fails due to some missing functionality in Linuxulator. Just ignore it. + set +e p; smallyes '' | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) + rc=$? base=$(without "$base" "$predep") done_predeps="$done_predeps $predep" + + if [ $rc != 0 ]; then + warning FREEBSD_00 "Applying FreeBSD-specific workaround..." + # ... for "Failed to mount /etc/machine-id: Bad address" with Focal. + in_target truncate -s0 /var/lib/dpkg/info/systemd.postinst + in_target dpkg --configure systemd + fi + set -e done if [ -n "$base" ]; then +@@ -222,6 +233,12 @@ echo \"Warning: Fake start-stop-daemon called, doing n + + mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" + rm -f "$TARGET/usr/sbin/policy-rc.d" ++ ++ echo \ ++"# Workaround for Linuxulator missing mremap(2) support; without it, ++# apt(8) fails like this: ++# E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. ++APT::Cache-Start 251658240;" >> "$TARGET/etc/apt/apt.conf.d/00freebsd" + + progress $bases $bases CONFBASE "Configuring base system" + info BASESUCCESS "Base system installed successfully."