From patchwork Sun Jun 2 18:52:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 14201 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8C4FD17087; Sun, 2 Jun 2019 19:53:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C0E0517086 for ; Sun, 2 Jun 2019 19:53:11 +0100 (BST) Received: from localhost ([127.0.0.1]:51862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXVbO-0005gE-7r for patchwork@mira.cbaines.net; Sun, 02 Jun 2019 14:53:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXVbL-0005g8-Hz for guix-patches@gnu.org; Sun, 02 Jun 2019 14:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXVbK-0006Mh-4Z for guix-patches@gnu.org; Sun, 02 Jun 2019 14:53:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXVbK-0006MO-12 for guix-patches@gnu.org; Sun, 02 Jun 2019 14:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXVbJ-0001NF-U6 for guix-patches@gnu.org; Sun, 02 Jun 2019 14:53:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36057] Fix for debootstrap Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Jun 2019 18:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36057 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36057@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15595015705261 (code B ref -1); Sun, 02 Jun 2019 18:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jun 2019 18:52:50 +0000 Received: from localhost ([127.0.0.1]:40873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXVb8-0001Mn-1d for submit@debbugs.gnu.org; Sun, 02 Jun 2019 14:52:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXVb5-0001MX-2b for submit@debbugs.gnu.org; Sun, 02 Jun 2019 14:52:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:45409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hXVaz-00066d-T4 for submit@debbugs.gnu.org; Sun, 02 Jun 2019 14:52:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXVay-0005fw-E9 for guix-patches@gnu.org; Sun, 02 Jun 2019 14:52:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXVax-00065J-0r for guix-patches@gnu.org; Sun, 02 Jun 2019 14:52:40 -0400 Received: from cascadia.aikidev.net ([2600:3c01:e000:267:0:a171:de7:c]:57506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXVaw-00064B-OY for guix-patches@gnu.org; Sun, 02 Jun 2019 14:52:38 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 7503A1AA54 for ; Sun, 2 Jun 2019 11:52:32 -0700 (PDT) From: Vagrant Cascadian Date: Sun, 02 Jun 2019 11:52:27 -0700 Message-ID: <87zhmz251w.fsf@yucca> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The attached patch includes a fix so that debootstrap can be run in a single patch. Currently, this fails: debootstrap --arch=amd64 buster $(mktemp -d) http://deb.debian.org/debian With this in the log: /gnu/store/ah0rr88xmn28f32whhpbdcxwind0c74z-debootstrap-1.0.114/share/debootstrap/functions: line 1056: chroot: command not found /gnu/store/ah0rr88xmn28f32whhpbdcxwind0c74z-debootstrap-1.0.114/share/debootstrap/functions: line 1062: grep: command not found /gnu/store/ah0rr88xmn28f32whhpbdcxwind0c74z-debootstrap-1.0.114/share/debootstrap/functions: line 1062: head: command not found /gnu/store/ah0rr88xmn28f32whhpbdcxwind0c74z-debootstrap-1.0.114/share/debootstrap/functions: line 1062: cut: command not found /gnu/store/ah0rr88xmn28f32whhpbdcxwind0c74z-debootstrap-1.0.114/share/debootstrap/functions: line 1062: sed: command not found The workaround documented in the package description is to use --foreign-arch and then follow up with a chroot call into to the newly created chroot and finish up running /debootstrap/debootstrap, but this fails for other reasons as well (/bin/sh in /debootstrap/debootstrap is set to /gnu/store.../bin/sh which isn't present in the Debian chroot)... and is a bit cumbersome for the end-user. I *think* the best fix for this is to fix the hard-coded PATH in several places places to also include $PATH, which I've proposed upstream: https://bugs.debian.org/929889 The attached patch approximates the proposed upstream patch for guix, and works for me so you can do a single call to debootstrap without the complicated chroot /debootstrap/debootstrap PATH-setting dance. live well, vagrant From bb00c031e0037eb8edd9db2ab06f630109237d0a Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 2 Jun 2019 11:34:33 -0700 Subject: [PATCH] gnu: debootstrap: Workaround for PATH issues. * gnu/packages/debian (debootstrap): [arguments]: Substitute PATH to include $PATH. [description]: Remove obsolete workaround from description. --- gnu/packages/debian.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm index 1b401bc946..f94f49c51b 100644 --- a/gnu/packages/debian.scm +++ b/gnu/packages/debian.scm @@ -154,6 +154,11 @@ contains the archive keys used for that.") (("/usr") ubuntu)) (substitute* "debootstrap" (("=/usr") (string-append "=" out))) + ;; Ensure PATH works both in guix and within the debian chroot + ;; workaround for: https://bugs.debian.org/929889 + (substitute* "functions" + (("PATH=/sbin:/usr/sbin:/bin:/usr/bin") + "PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin")) (substitute* (find-files "scripts" ".") (("/usr/share/zoneinfo") (string-append tzdata "/share/zoneinfo"))) #t))) @@ -184,9 +189,5 @@ contains the archive keys used for that.") (description "Debootstrap is used to create a Debian base system from scratch, without requiring the availability of @code{dpkg} or @code{apt}. It does this by downloading .deb files from a mirror site, and carefully -unpacking them into a directory which can eventually be chrooted into. - -It is recommended to run @code{debootstrap --foreign --arch=...} and then -@code{chroot} into the directory, set the PATH and run @code{debootstrap ---second-stage} after.") +unpacking them into a directory which can eventually be chrooted into.") (license license:gpl2))) -- 2.20.1