reopen 826361
thanks

So here's an alternate patch which allows fakechroot to be handled
transparently.  Either patch will work for me.  (Or I can continue to
use my own forked script, if neither is deemed worthy of merging into
the debootstrap upstream.)

Thanks,

                                                - Ted

>From f2fde5120a3159556c9fab3f90a4e9dba75fdd84 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <[email protected]>
Date: Sat, 4 Jun 2016 23:47:48 -0400
Subject: [PATCH] Handle support for fakechroot automatially

Add transparent support for fakechroot, so that --variant=fakechroot
doesn't have to be specified explicitly.

More importantly, this allows commands like "fakechroot fakeroot
debootstrap --variant=minbase ..." to work correctly.

Signed-off-by: Theodore Ts'o <[email protected]>
---
 scripts/sid | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/scripts/sid b/scripts/sid
index 7b32ac2..75e06b3 100644
--- a/scripts/sid
+++ b/scripts/sid
@@ -28,7 +28,7 @@ work_out_debs () {
                base="apt"
        fi
 
-       if doing_variant fakechroot; then
+       if doing_variant fakechroot || test "$FAKECHROOT" = "true"; then
                # ldd.fake needs binutils
                required="$required binutils"
        fi
@@ -53,7 +53,11 @@ first_stage_install () {
                chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
        fi
 
-       setup_devices
+       if test "$FAKECHROOT" = "true"; then
+               setup_devices_fakechroot
+       else
+               setup_devices
+       fi
 
        x_feign_install () {
                local pkg="$1"
@@ -75,7 +79,9 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
 }
 
 second_stage_install () {
-       setup_dynamic_devices
+       if test "$FAKECHROOT" != "true"; then
+               setup_dynamic_devices
+       fi
 
        x_core_install () {
                smallyes '' | in_target dpkg --force-depends --install $(debfor 
"$@")
@@ -85,7 +91,7 @@ second_stage_install () {
                baseprog="$(($baseprog + ${1:-1}))"
        }
 
-       if doing_variant fakechroot; then
+       if doing_variant fakechroot || test "$FAKECHROOT" = "true"; then
                setup_proc_fakechroot
        elif doing_variant scratchbox; then
                true
@@ -115,7 +121,8 @@ second_stage_install () {
                ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
        fi
 
-       if doing_variant fakechroot; then
+       if doing_variant fakechroot || test "$FAKECHROOT" = "true"; then
+               export PATH=/usr/sbin:/sbin:$PATH
                install_fakechroot_tools
        fi
 
-- 
2.5.0

Reply via email to