Bug#741964: debootstrap: --variant=fakechroot and --foreign

2018-04-23 Thread Hideki Yamane
On Thu, 19 Apr 2018 09:58:41 +0200
Raphael Hertzog  wrote:
> This is not doing what you want. You probably want:
> if ! doing_variant fakechroot; then

 !

 I'll fix it. Thanks for your review.

-- 
Hideki Yamane 



Bug#741964: debootstrap: --variant=fakechroot and --foreign

2018-04-19 Thread Raphael Hertzog
Hello Hideki,

it seems to me that you should test and review your commits more often.

On Tue, 17 Apr 2018, Hideki Yamane wrote:
> -   if doing_variant fakechroot; then
> -   setup_proc_fakechroot
> -   else
> +   if doing_variant ! fakechroot; then

This is not doing what you want. You probably want:
  if ! doing_variant fakechroot; then

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/



Bug#741964: debootstrap: --variant=fakechroot and --foreign

2018-04-17 Thread Hideki Yamane
control: tags -1 +pending

On Wed, 17 Feb 2016 15:44:53 + jhcha54008  wrote:
> Here is an updated patch for debootstrap 1.0.78+nmu1.

 Adjust it for current git.


diff --git a/scripts/debian-common b/scripts/debian-common
index 4ab1fe8..9b313fc 100644
--- a/scripts/debian-common
+++ b/scripts/debian-common
@@ -56,6 +56,10 @@ first_stage_install () {
fi
 
setup_devices
+
+   if doing_variant fakechroot; then
+   setup_proc_fakechroot
+   fi
 }
 
 second_stage_install () {
@@ -89,9 +93,7 @@ Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
baseprog="$(($baseprog + ${1:-1}))"
}
 
-   if doing_variant fakechroot; then
-   setup_proc_fakechroot
-   else
+   if doing_variant ! fakechroot; then
setup_proc
in_target /sbin/ldconfig
fi



Bug#741964: debootstrap: --variant=fakechroot and --foreign

2016-02-17 Thread jhcha54008
Hi,

Here is an updated patch for debootstrap 1.0.78+nmu1.

Regards,
JH Chatenet

diff -Naur a/usr/share/debootstrap/scripts/sid 
b/usr/share/debootstrap/scripts/sid
--- a/usr/share/debootstrap/scripts/sid
+++ b/usr/share/debootstrap/scripts/sid
@@ -72,6 +72,10 @@
}
 
x_feign_install dpkg
+
+   if doing_variant fakechroot; then
+   setup_proc_fakechroot
+   fi
 }
 
 second_stage_install () {
@@ -86,7 +90,7 @@
}
 
if doing_variant fakechroot; then
-   setup_proc_fakechroot
+   true
elif doing_variant scratchbox; then
true
else



Bug#741964: debootstrap: --variant=fakechroot and --foreign

2014-03-17 Thread jhcha54008
Package: debootstrap
Version: 1.0.59
Severity: minor
Tags: patch

Dear Maintainer,

Using option foreign with the variant fakechroot fails at the second stage with 
an error :
$ fakechroot fakeroot -s .fakeroot.state debootstrap --variant=fakechroot 
--foreign jessie my_chroot
$ fakechroot fakeroot -i .fakeroot.state -s .fakeroot.state chroot my_chroot 
/debootstrap/debootstrap --second-stage
$ echo $?
1
$ cat my_chroot/debootstrap/debootstrap.log
gpgv: Signature made Sat Mar 15 08:55:54 2014 UTC using RSA key ID 46925553
gpgv: Good signature from Debian Archive Automatic Signing Key (7.0/wheezy) 
ftpmas...@debian.org
ln: failed to create symbolic link '/dev': File exists

From the error message : the unpriviledged user is not allowed to replace 
/proc or /dev. After a chroot
command, fakechroot diverts access to /dev, /proc or /sys to the corresponding 
directories under the real root
(ie /dev, /sys and /proc on the host). The error occurs at second_stage_install 
in functions setup_devices and
setup_proc_fakechroot (file /usr/share/debootstrap/scripts/sid lines 61 and 69, 
and file
/usr/share/debootstrap/functions lines 913 and 949)

In this case, it would be better to set up proc and the devices before invoking 
chroot ie at the first stage.

The following patch partially revert commit 
d3518b9c7e4f693562d99ec4c15bb009b456603b in version 1.0.34 (see also [1]). Then
fakechroot fakeroot -s .fakeroot.state debootstrap --variant=fakechroot 
--foreign jessie my_chroot
fakechroot fakeroot -i .fakeroot.state -s .fakeroot.state chroot my_chroot 
/debootstrap/debootstrap --second-stage
...
I: Base system installed successfully.
moi@debirf-dominicain:~$ echo $?
0

Thank you for your comments or corrections !

Regards,
JH Chatenet

[1] : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498731#25

*** rustine-second-stage.patch
diff -Naur a/usr/share/debootstrap/scripts/sid 
b/usr/share/debootstrap/scripts/sid
--- a/usr/share/debootstrap/scripts/sid 2014-03-13 20:30:32.0 +0100
+++ b/usr/share/debootstrap/scripts/sid 2014-03-13 21:19:21.0 +0100
@@ -70,10 +70,17 @@
}
 
x_feign_install dpkg
+
+   if doing_variant fakechroot; then
+   setup_proc_fakechroot
+   setup_devices_fakechroot
+   fi
 }
 
 second_stage_install () {
-   setup_devices
+   if ! doing_variant fakechroot; then
+   setup_devices
+   fi
 
x_core_install () {
smallyes '' | in_target dpkg --force-depends --install $(debfor 
$@)
@@ -84,7 +91,7 @@
}
 
if doing_variant fakechroot; then
-   setup_proc_fakechroot
+   true
elif doing_variant scratchbox; then
true
else

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages debootstrap depends on:
ii  wget  1.15-1

Versions of packages debootstrap recommends:
ii  debian-archive-keyring  2012.4
ii  gnupg   1.4.16-1.1

debootstrap suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140317183916.GA1616@debirf-dominicain