From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: GuixSD bootable ISO-9669 image (was: Re: GuixSD on servers [Fwd: [rtracker.1984.is #131647] A question about VServer system specific requirements]) Date: Sun, 23 Apr 2017 22:11:04 -0700 Message-ID: <87k26afl07.fsf_-_@gmail.com> References: <20170418141719.llp77itz7vyq5rij@abyayala> <87k26hwxt0.fsf@gmail.com> <8760i0m7vg.fsf@gnu.org> <87pog3u3ms.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2WHI-0002zj-56 for guix-devel@gnu.org; Mon, 24 Apr 2017 01:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2WHG-00051B-N7 for guix-devel@gnu.org; Mon, 24 Apr 2017 01:11:12 -0400 In-Reply-To: <87pog3u3ms.fsf@gmail.com> (Chris Marusich's message of "Sat, 22 Apr 2017 21:52:43 -0700") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Chris Marusich writes: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >>> There appear to be (at least) two problem that prevent this naive >>> solution from working, which might point us in the right direction: >>> >>> First, the GRUB menu is trying to find a file system with label >>> "gnu-disk-image" (via "search --label --set gnu-disk-image"), which >>> won't work because there is no file system with that label in the >>> resulting image. >> >> So it seems that the crux of the problem is that ISO9660 lacks file >> system labels, which breaks the whole thing, right? > > Yes, probably. It seems we can set a "volume id", but not a label like > in EXT file systems. For example, see here: > > https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-d= vd/iso-image.nix I discovered that grub-mkrescue also lets you pass through options to xorriso. So, you can set the volume ID as follows: =2D-8<---------------cut here---------------start------------->8--- $ sudo grub-mkrescue -V gnu-disk-image -v -o /tmp/test-img.iso /mnt/disk-im= age-partition-1 ... grub-mkrescue: info: enabling BIOS support .... grub-mkrescue: info: grub-mkimage --directory '/gnu/store/2hxz9cpipsbf2hkiz= 5aq70k73wjj0fw1-grub-2.02rc1/lib/grub/i386-pc' --prefix '/boot/grub' --outp= ut '/tmp/grub.zilpbK/boot/grub/i386-pc/eltorito.img' --format 'i386-pc-elto= rito' --compression 'auto' --config '/tmp/grub.N4OuA5' 'biosdisk' 'iso9660= '=20 ... grub-mkrescue: info: executing xorriso -as mkisofs -graft-points --modifica= tion-date=3D2017042404413800 -b boot/grub/i386-pc/eltorito.img -no-emul-boo= t -boot-load-size 4 -boot-info-table --grub2-boot-info --grub2-mbr /gnu/sto= re/2hxz9cpipsbf2hkiz5aq70k73wjj0fw1-grub-2.02rc1/lib/grub/i386-pc/boot_hybr= id.img --protective-msdos-label -o /tmp/test-img.iso -r /tmp/grub.zilpbK --= sort-weight 0 / --sort-weight 1 /boot -V gnu-disk-image /mnt/disk-image-par= tition-1. ... xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules ... Writing to 'stdio:/tmp/test-img.iso' completed successfully. =2D-8<---------------cut here---------------end--------------->8--- Looks like setting the volume ID worked (despite the warning above): =2D-8<---------------cut here---------------start------------->8--- $ sudo blkid /tmp/test-img.iso /tmp/test-img.iso: UUID=3D"2017-04-24-04-41-38-00" LABEL=3D"gnu-disk-image"= TYPE=3D"iso9660" PTTYPE=3D"dos" =2D-8<---------------cut here---------------end--------------->8--- >>> Second, the init process from the initrd (I think that's what it's >>> called?) is trying to look for a file system with label >>> "gnu-disk-image", which it never finds. It just sits there waiting to >>> find it, and it never shows up, so it freaks out. Possible solution: >>> modify the behavior of our initrd's init process. I'm not sure how to >>> customize the init process here, but there must be a way. We'll >>> probably also need the kernel module that enables reading of iso9660 >>> file systems, if it wasn't present already. >> >> So we could try detecting the root partition by a mechanism other than >> partition labels/UUIDs, but I don=E2=80=99t know which mechanism. Ideas= ? How >> do people address this? > > Volume ID seems like the right thing to try first. What do we need to > change to support this, I wonder? I'm not familiar with the initrd > stuff but would be willing to poke around in there and experiment. I > just don't really know where to begin. Unfortunately, even after setting the volume ID, booting as follows does not work. The init process still doesn't find the partition with the label "gnu-disk-image": =2D-8<---------------cut here---------------start------------->8--- $ sudo qemu-system-x86_64 -machine type=3Dpc-i440fx-2.5,accel=3Dkvm -boot o= rder=3Ddc,menu=3Don -m size=3D4G -k en-us -name guixsd -cdrom /tmp/test-img= .iso /tmp/test =2D-8<---------------cut here---------------end--------------->8--- Judging by the contents of gnu/build/file-systems.scm, we don't have any support for ISO-9669 file systems. Perhaps if we add support here, the machinery to find the partition labeled "gnu-disk-image" will work. What do you think? > By the way, do you think it's possible to build an ISO image from a > manifest of files? I'm still curious to hear your answer regarding this. It isn't clear to me whether we need to generate a disk image first, just to create the ISO-9669 image. It seems redundant. I'm just playing around with the disk image because it's an easy way to get at all the files. If we can put all the files in a single place without creating a disk image, then we can probably invoke xorriso or grub-mkrescue directly on them. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlj9iOgACgkQ3UCaFdgi Rp31dQ/5AQVonbJ64jefmcBsjZcAkUe+RdXp0xyAjMLN2jbyk/6FOHHlIYP84Nl9 eYrgtJawaWsYXrKhby5/7hF8RR2VpmmhQT3NbvOS7PmSL8vsAYClT9pkTw4FMTrg eSuIBsf/kkibysBHkj/OsPmaz8mKeF1G2I2pmPayRxA4di+MNtxYjlgaVppqGbBC pY4rAzp1z0tv60GY4iaw7WV8l/t/Ek3FbjjnCTlsTvRDjrFduTGTw2yiKqMKirMY gVkabzK1JmqdU+RE8VSAXL31riC2QW2Zqc3VPPRUDhs2aZRJ6wdDlGKsH74J9xFf mYmc9bxbzgj+9nzH6VxOE2XoMFeNGKTE2rlA92wXf23De63C6Aeb9dD41jAZS8wk n8sayHlPpcdJfYFjCQ/6fjlFAcDxeJG7bIBoBHqb7ca2JfRvZ5OYDsqaJn1vZOrk jne8vebF5EPEl9fKwemnnivAt9LF55daAqTcsVQGHG6vQyAPsIVvJfUlaeBSd6rc 4wmgdgdaFRkG5n1gblTPSrMpoQJAI/6qP0o5eVAYlEOfoz6/jG1nAvqJd79g5Ssw 4cCKmylX99S5PU0bWG+GCHgx5dyKNHq3s7A1dEga3YJatV27wot3KhOheC5m5MeK JrFuXlPJdlME3xjc2kSwtdcZRSg8zsr8ksvhcH7rYjeyZmwT+8s= =9gVa -----END PGP SIGNATURE----- --=-=-=--