From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vagrant Cascadian Subject: bug#29312: GRUB with multiple partitions with identical bzImage Date: Wed, 15 Nov 2017 15:36:11 -0800 Message-ID: <87mv3n2jys.fsf@aikidev.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eF8B1-00030U-MH for bug-guix@gnu.org; Wed, 15 Nov 2017 19:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eF8Aw-0003LE-Iq for bug-guix@gnu.org; Wed, 15 Nov 2017 19:37:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eF8Aw-0003L7-Ef for bug-guix@gnu.org; Wed, 15 Nov 2017 19:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eF8Aw-00021N-6z for bug-guix@gnu.org; Wed, 15 Nov 2017 19:37:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eF7Eu-0000oi-55 for bug-guix@gnu.org; Wed, 15 Nov 2017 18:37:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eF7Er-0006xf-1x for bug-guix@gnu.org; Wed, 15 Nov 2017 18:37:04 -0500 Received: from cascadia.aikidev.net ([173.255.214.101]:55711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eF7Eq-0006tr-Oo for bug-guix@gnu.org; Wed, 15 Nov 2017 18:37:00 -0500 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 4DE3E1AA2C for ; Wed, 15 Nov 2017 15:36:55 -0800 (PST) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 29312@debbugs.gnu.org --=-=-= Content-Type: text/plain I've been exploring GuixSD for the past few days. Very cool! Even if a little rough around the edges... Ran into an ugly problem with GRUB being unable to load the initrd, due to having multiple GuixSD installs on the same machine, with identical paths for the bzImage files, but not identical paths for initrd files... Confusingly, when I loaded the kernel+initrd by hand from the grub commandline, it would work! But that was because I was specifying which device to load from... With some help from the folks on #grub on freenode (Thanks to TJ- and Jordan_U!), we identified it was an issue with the way GRUB was configured to search for files: menuentry "GNU with Linux-Libre 4.13.12 (beta)" { search --file --set /gnu/store/q9q8y9rh3jw1qcx6bic1v18qag80z74a-linux-libre-4.13.12/bzImage linux /gnu/store/q9q8y9rh3jw1qcx6bic1v18qag80z74a-linux-libre-4.13.12/bzImage \ --root=/dev/mapper/cryptic \ --system=/gnu/store/bsxnm36vvx2wxc9h3q5l8b5286gw75hr-system \ --load=/gnu/store/bsxnm36vvx2wxc9h3q5l8b5286gw75hr-system/boot \ initrd /gnu/store/7w9dzb6b9vb9gzj61zyqsg4zg6ys4hgb-raw-initrd/initrd } I had two partitions, one on (hd0,msdos4) and one on (crypto0) which both contained /gnu/store/q9q8y9rh3jw1qcx6bic1v18qag80z74a-linux-libre-4.13.12/bzImage, and the search command was returning the one on (hd0,msdos4), and thus setting root (hd0,msdos4). Unfortunately, /gnu/store/7w9dzb6b9vb9gzj61zyqsg4zg6ys4hgb-raw-initrd/initrd was only present on the (crypto0) partition. So, when it booted, I would get the confusing error message: error: file `/gnu/store/7w9dzb6b9vb9gzj61zyqsg4zg6ys4hgb-raw-initrd/initrd' not found And then a kernel panic, as there was no initrd... The suggestion from the #grub folks was to use a UUID or some other more reliable method of finding the correct device to load the kernel and initrd files from. A quick workaround might be to also add a search line for the initrd after loading the kernel: menuentry "GNU with Linux-Libre 4.13.12 (beta)" { search --file --set /gnu/store/q9q8y9rh3jw1qcx6bic1v18qag80z74a-linux-libre-4.13.12/bzImage linux /gnu/store/q9q8y9rh3jw1qcx6bic1v18qag80z74a-linux-libre-4.13.12/bzImage \ --root=/dev/mapper/cryptic \ --system=/gnu/store/bsxnm36vvx2wxc9h3q5l8b5286gw75hr-system \ --load=/gnu/store/bsxnm36vvx2wxc9h3q5l8b5286gw75hr-system/boot \ search --file --set /gnu/store/7w9dzb6b9vb9gzj61zyqsg4zg6ys4hgb-raw-initrd/initrd initrd /gnu/store/7w9dzb6b9vb9gzj61zyqsg4zg6ys4hgb-raw-initrd/initrd } I'm not sure this is the best approach, as it could potentially load kernel+initrd from an untrusted filesystem which may contain a malicious kernel or initrd that simply matches the file paths... I'll look into a proper solution at some point, but it'd be fine if someone beats me to it! live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAloMz2sACgkQt4uC1IFL kbbm8g/9Fn2e9lel8TInwxoGwWc/x3nW6Djj3WA09OaQ6vuGM6MiEbCPHXP+aY9O Tm4/8URZ+S5h5Yt+ybkmJfO6sVyRxC+/2QiVOnfsHuAgFgSR5Ev97XpGNEF5Se7F mJ7SL2v+dpiHI823EkvOp4GOuDG4OnvdMQyDs35WY3kqQPOpWDdK34sFLCOSLeby mPuwqPEnzTqnYVQhd4fZgqyBEr4jeSJNZAuVE9AbXYVYNqaiHSTr0czUTj0ZXdz/ xa+3ldcuGE6sWFvnEPzSw2zjMndrxNKwTewvmHKjFzztt8mEdEht0B0TqvAz6bxw 2SGR7OrG7STuC9jHoGAJiYCJKhmECLKxdvZnIXwfb//LoFGX1Yk4fkGAYbX4RCN7 MQdvyM4mv9ok0et4m5IauDBH9mE6D+wY8GEDbWgazBnK8GFGqNbABE5XKIaB1vNm S+yxIsx9+Oi35hmGDASSukPhDAQvNRKxPgqkhBNgigWrbSGQjc3TdMJTwoRN8pKo 0UBCmWDlLD5GqgGoqALnpeugqPt1ojMo42HqYC099fdFvpsdS2YDXLC/iTonL/B3 8tGQSaRCPOvjZRgVTf7XsnJLcnMB8hXsgh//WqpKs598Ls2RMz97fZVU3rFficyd imI5+oftFcSay9obBo4QiKT74xcopMHPIFh+gx2gZLJ299PbQ/o= =mYEj -----END PGP SIGNATURE----- --=-=-=--