From e217253ac21ec1bfe0f1073fc7ea7ccee7932ede Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 28 Oct 2017 13:55:52 +0200 Subject: scripts/gutsy: Fix debootstrap --variant=fakechroot failure because initscripts is no longer part of the base system Signed-off-by: Mattia Rizzolo --- scripts/gutsy | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/gutsy b/scripts/gutsy index 36a2f50..3e53e13 100644 --- a/scripts/gutsy +++ b/scripts/gutsy @@ -172,6 +172,12 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status" info CONFREQ "Configuring required packages..." + if doing_variant fakechroot && [ -e "$TARGET/var/lib/dpkg/info/initscripts.postinst" ] + then + # fix initscripts postinst (no mounting possible, and wrong if condition) + sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst" + fi + echo \ "#!/bin/sh exit 101" > "$TARGET/usr/sbin/policy-rc.d" @@ -184,6 +190,16 @@ echo echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon" chmod 755 "$TARGET/sbin/start-stop-daemon" + if [ -x "$TARGET/sbin/initctl" ]; then + mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL" + echo \ +"#!/bin/sh +if [ \"\$1\" = version ]; then exec /sbin/initctl.REAL \"\$@\"; fi +echo +echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl" + chmod 755 "$TARGET/sbin/initctl" + fi + setup_dselect_method apt smallyes '' | @@ -224,6 +240,9 @@ echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/ dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING fi + if [ -x "$TARGET/sbin/initctl.REAL" ]; then + mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl" + fi mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" rm -f "$TARGET/usr/sbin/policy-rc.d" -- cgit v0.12