Danny Milosavljevic <dan...@scratchpost.org> skribis: > On Fri, 07 Jul 2017 13:34:52 +0200 > l...@gnu.org (Ludovic Courtès) wrote: > >> Danny Milosavljevic <dan...@scratchpost.org> skribis: >> >> > 95% done. If would actually work if we came to a consensus about the >> > volume label (it must be uppercase; see bug# 27520 in guix-patches). >> > Also, UUID boot support is still mostly missing - same as in the >> > non-iso9660 case. > >>I hope I’m not holding anything back in this area! > > Oh, not at all. I'm just not clear on which way we chose (if any?). > > What was the string-upcase solution? Even if it's created with > (string-upcase "GuixSD") (and it is - if you don't override it) the boot code > as it is now will still fail to find the root - because it matches labels > case-sensitively. The string-upcase is buried deep within the image creation > procedure.
Right. > Or do you mean I should put (string-upcase "GuixSD") in system-disk-image in > gnu/system/vm.scm as well ? That would work, I guess... although the finished > image (iso9660 or not!) would still have "GUIXSD" then. I don't see that as > a big deal, though :) > > There's still the following places: > > ./gnu/build/vm.scm: search --set=root --label > gnu-disk-image~@ > ./gnu/system/install.scm: (device "gnu-disk-image") > ./gnu/system/vm.scm: "gnu-disk-image") > > Or do you mean we should just match case-insensitively in > gnu/build/file-systems.scm ? > > I.e. use > > (define partition-label-predicate > (partition-predicate read-partition-label string-ci=?)) > > That would mean match case-insensitively for both iso9660 and non-iso9660. I > would very much prefer this fix. What about this not-so-bad solution:
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 3e722d081..662fd0085 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -335,11 +335,18 @@ the image." system described by OS. Said image can be copied on a USB stick as is. When VOLATILE? is true, the root file system is made volatile; this is useful to USB sticks meant to be read-only." + (define normalize-label + ;; ISO labels are all-caps (case-insensitive), but since + ;; 'find-partition-by-label' is case-sensitive, make it all-caps here. + (if (string=? "iso9660" file-system-type) + string-upcase + identity)) + (define root-label ;; Volume name of the root file system. Since we don't know which device ;; will hold it, we use the volume name to find it (using the UUID would ;; be even better, but somewhat less convenient.) - "gnu-disk-image") + (normalize-label "gnu-disk-image")) (define file-systems-to-keep (remove (lambda (fs)
That way we preserve case-sensitivity for the other file systems. If that’s fine with you, let’s do that! Longer-term we should probably create <file-system> records for each file system in (gnu build file-system); this would include, for each file system, the ‘superblock?’ procedure, the ‘label’ procedure, and, probably, a ‘label=?’ procedure. Thanks, Ludo’.