Bug 1654765 - chroot: failed to run command './debootstrap/debootstrap': No such file or directory
Summary: chroot: failed to run command './debootstrap/debootstrap': No such file or di...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: debootstrap
Version: 29
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Sergio Monteiro Basto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-29 15:56 UTC by Laurent Vivier
Modified: 2018-12-27 01:50 UTC (History)
3 users (show)

Fixed In Version: debootstrap-1.0.109-3.fc29 debootstrap-1.0.109-3.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-21 19:39:16 UTC


Attachments (Terms of Use)

Description Laurent Vivier 2018-11-29 15:56:35 UTC
Description of problem:

"debootstrap --second-stage" cannot start because deboostrap shebang "#!/bin/sh" has been changed to "#!/usr/bin/sh" and this path is not valid inside the chroot previously installed by "debootstrap --foreign".

Version-Release number of selected component (if applicable):

debootstrap-1.0.109-2.fc29.noarch

How reproducible:

100%

Steps to Reproduce:
1. sudo debootstrap --arch=i386 --foreign --variant=minbase --no-check-gpg \
                    stretch i386-base
2. sudo chroot i386-base debootstrap/debootstrap --second-stage

Actual results:

chroot: failed to run command 'debootstrap/debootstrap': No such file or directory

Expected results:

I: Installing core packages...
I: Unpacking required packages...
I: Unpacking libacl1:i386...
I: Unpacking libattr1:i386...
I: Unpacking libaudit-common...
I: Unpacking libaudit1:i386...
I: Unpacking base-files...
I: Unpacking base-passwd...
I: Unpacking bash...
I: Unpacking libbz2-1.0:i386...
I: Unpacking libdebconfclient0:i386...
...
I: Configuring the base system...
I: Configuring gpgv...
I: Configuring debian-archive-keyring...
I: Configuring libstdc++6:i386...
I: Configuring adduser...
I: Configuring libapt-pkg5.0:i386...
I: Configuring apt...
I: Configuring libc-bin...
I: Base system installed successfully.

Additional info:

if I edit i386-base/debootstrap/debootstrap to replace "#!/usr/bin/sh" by "#!/bin/sh" it works.

I've checked the content of debootstrap_1.0.109.tar.gz and debootstrap uses the good shebang.

The path is changed during the rpmbuild install phase:

Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.OcJ9Al
...
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
mangling shebang in /usr/sbin/debootstrap from /bin/sh to #!/usr/bin/sh
Processing files: debootstrap-1.0.109-2.fc29.noarch

Comment 1 Laurent Vivier 2018-11-29 16:03:48 UTC
This patch fixes the problem:

diff --git a/debootstrap.spec b/debootstrap.spec
index 3b5ebfd..324a327 100644
--- a/debootstrap.spec
+++ b/debootstrap.spec
@@ -23,6 +23,8 @@ Recommends:     ubu-keyring
 Recommends:     debian-keyring
 %endif

+%global __brp_mangle_shebangs_exclude /bin/sh
+
 %description
 debootstrap is used to create a Debian base system from scratch, without
 requiring the availability of dpkg or apt.  It does this by downloading

Comment 2 Sergio Monteiro Basto 2018-11-29 16:07:44 UTC
(In reply to Laurent Vivier from comment #1)
> This patch fixes the problem:
> 
> diff --git a/debootstrap.spec b/debootstrap.spec
> index 3b5ebfd..324a327 100644
> --- a/debootstrap.spec
> +++ b/debootstrap.spec
> @@ -23,6 +23,8 @@ Recommends:     ubu-keyring
>  Recommends:     debian-keyring
>  %endif
> 
> +%global __brp_mangle_shebangs_exclude /bin/sh
> +
>  %description
>  debootstrap is used to create a Debian base system from scratch, without
>  requiring the availability of dpkg or apt.  It does this by downloading

Thanks for the patch , that is what I need . 
I will apply it soon as possible (maybe this weekend) 

Thanks for the report also :)

Comment 3 Fedora Update System 2018-12-01 22:36:44 UTC
debootstrap-1.0.109-3.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-2dee2f3447

Comment 4 Fedora Update System 2018-12-01 22:37:17 UTC
debootstrap-1.0.109-3.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-6906464d45

Comment 5 Fedora Update System 2018-12-02 07:54:36 UTC
debootstrap-1.0.109-3.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-6906464d45

Comment 6 Fedora Update System 2018-12-02 10:10:27 UTC
debootstrap-1.0.109-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-2dee2f3447

Comment 7 Laurent Vivier 2018-12-02 11:39:19 UTC
I've tested the package from koji and it works fine for me.

https://koji.fedoraproject.org/koji/buildinfo?buildID=1168303

Comment 8 Fedora Update System 2018-12-21 19:39:16 UTC
debootstrap-1.0.109-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2018-12-27 01:50:46 UTC
debootstrap-1.0.109-3.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.