From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e17YB-0007ad-Dp for guix-patches@gnu.org; Sun, 08 Oct 2017 05:07:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e17Y6-0008BR-FP for guix-patches@gnu.org; Sun, 08 Oct 2017 05:07:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46791) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e17Y6-0008BD-Cs for guix-patches@gnu.org; Sun, 08 Oct 2017 05:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e17Y6-0001q0-3x for guix-patches@gnu.org; Sun, 08 Oct 2017 05:07:02 -0400 Subject: [bug#28399] [PATCH 1/2] services: mysql: Fix missing modules on activation. Resent-Message-ID: Date: Sun, 8 Oct 2017 10:06:07 +0100 From: Christopher Baines Message-ID: <20171008100607.5c175cf8@cbaines.net> In-Reply-To: <87tvzxu3m8.fsf@gnu.org> References: <20170909153905.087c013f@cbaines.net> <20170909145343.14851-1-mail@cbaines.net> <87shftd67d.fsf@gnu.org> <20170912194825.70eb4436@cbaines.net> <87377nlixr.fsf@gnu.org> <20170916113811.3c7d1b33@cbaines.net> <87tvzxu3m8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/wi9zIP4/xL5OZrHujFZpBpp"; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 28399@debbugs.gnu.org --Sig_/wi9zIP4/xL5OZrHujFZpBpp Content-Type: multipart/mixed; boundary="MP_/9M77eFCFd1uU3WVYxNI3=7g" --MP_/9M77eFCFd1uU3WVYxNI3=7g Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, 20 Sep 2017 11:21:51 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > As you can see, > /gnu/store/9whwwppmb2sjfsy0967s627bzgdfl8bc-guile-static-stripped-2.2.2/s= hare/guile/2.2, > which is at the tail of %load-path, is missing from the root file > system, hence the failure. >=20 > To work around it, we=E2=80=99d have to either ensure that > =E2=80=98guile-static-stripped=E2=80=99 is on the root file system, or ad= just the load > path when we switch roots, or (simplest solution) pre-load (ice-9 > popen) before =E2=80=98switch-root=E2=80=99. >=20 > To be continued=E2=80=A6 Awesome investigation Ludo. This explanation could match what I was experiencing when using the mysql service on GuixSD. Sometimes after running guix gc, the system wouldn't boot. This could have been because the guile package needed by the initrd was removed from the store. Given that the initrd has a dependency on this guile, but it doesn't reference it because its compressed, how about adding a explicit reference to the guile used? I've attached a patch, and this looks to fix the issue as far as the mysql service is concerned. --MP_/9M77eFCFd1uU3WVYxNI3=7g Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-linux-initrd-Ensure-that-the-guile-used-in-the-initr.patch =46rom f313f80407039efb215c18de99ee36696528e98a Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 8 Oct 2017 09:52:24 +0100 Subject: [PATCH] linux-initrd: Ensure that the guile used in the initrd referenced. By referencing guile from the initrd, it will be present in the store when this initrd is used. If the exact guile used within the initrd isn't present in the store, then after root is switched during the boot process, loading modules (such as (ice-9 popen)) won't work. * gnu/system/linux-initrd.scm (expression->initrd)[builder]: Write out a fi= le called references in to the initrd derivation, which includes the store p= ath for guile. --- gnu/system/linux-initrd.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 5a7aec5c8..c869bba5f 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -78,6 +78,19 @@ the derivations referenced by EXP are automatically copi= ed to the initrd." (use-modules (gnu build linux-initrd)) =20 (mkdir #$output) + + ;; Due to the compression, the references to the dependencies are + ;; obscured, so write them out uncompressed to a file. + (call-with-output-file (string-append #$ output "/references") + (lambda (port) + (map (lambda (reference) + (simple-format port "~A\n" reference)) + (list + ;; The guile used in the initrd must be present in the + ;; store, so that module loading works once the root is + ;; switched. + #$guile)))) + (build-initrd (string-append #$output "/initrd") #:guile #$guile #:init #$init --=20 2.14.2 --MP_/9M77eFCFd1uU3WVYxNI3=7g-- --Sig_/wi9zIP4/xL5OZrHujFZpBpp Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlnZ6n9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfLZw//V7b0kGXkQpiDCY88mb+V+JudPveQDRXjM8YjhbNEjuczx49piaS93wVN zHE/VtePzszworbHtDjlC+iqD8PSzzDKamS6HwmVHMbYt86W6vqAOSxPvqBnHIpS zUfbv2NzMPBUDRElulT8JECxZEPj45W5kk28v8yya5DhSszowMgZfTwsA+yyEglQ lt/cE8ZgjWSbCv/cI0iFXhmWXObnDXPJJfG9iBrMcVBNZy+AkzzwYniJhMvuq+sF h7cGmg1lG1PXy9AgySwaDGtGzyuDzRV/fjXatId4rrkrDyW0emtg0CxpnnS3qbA1 ZrGUN3j/Lvm/1d88iwIsKR3DRcP2SXPVP5O37+Euz9ZxacwTC/2J+E00n/hXPQCv Np2b+8tODJ51hIWtiTlgOH+ikiUD9hOELbwFm4QD2gL2Gix/3jTgUbhLJqUXTZ1g B4IlfkCNqVHItAV98zaYwZeytNIqMvp3Xfgdebpq9Uc8sLxMmPf3ModwzPVeQk/m UC4bz/733l3cTwl5PNQM4EfYxb6jpq6v2NmNirzIGhjM3T035hjFXGyzalpCk6pj f8U0zQDE/N9hOD5749lyz8PhSTrDSJBdzbuns5WJ3HwyeLiHq8QLr3dkSh6OmZIr Fyrzmq5e2Mx6sToc3mtxwFvIQYfSk8KbwR25J5pn9ATq9xUq3mk= =HT04 -----END PGP SIGNATURE----- --Sig_/wi9zIP4/xL5OZrHujFZpBpp--