[gnome-build-meta/valentindavid/eos-installer: 1/4] Add volume descriptor in installer ISO to ease osinfo detection




commit 7589360552c253a8e2bee6beb065cd15da50f6ad
Author: Valentin David <valentin david codethink co uk>
Date:   Tue Mar 10 11:21:52 2020 +0100

    Add volume descriptor in installer ISO to ease osinfo detection

 elements/iso/eos-installer-extra.bst               | 18 +++++++++++++++-
 elements/iso/image.bst                             | 24 +++++++++++++++++++---
 elements/iso/initramfs.bst                         | 22 ++++++++++++++++++--
 ...llercd.mount => run-mount-installercd.mount.in} |  2 +-
 4 files changed, 59 insertions(+), 7 deletions(-)
---
diff --git a/elements/iso/eos-installer-extra.bst b/elements/iso/eos-installer-extra.bst
index 8b49d761..957fa2c0 100644
--- a/elements/iso/eos-installer-extra.bst
+++ b/elements/iso/eos-installer-extra.bst
@@ -19,7 +19,7 @@ sources:
 - kind: local
   path: files/eos-installer-extra/eos-installer.preset
 - kind: local
-  path: files/eos-installer-extra/run-mount-installercd.mount
+  path: files/eos-installer-extra/run-mount-installercd.mount.in
 - kind: local
   path: files/eos-installer-extra/eos-installer.session
 - kind: local
@@ -38,6 +38,22 @@ sources:
   path: files/eos-installer-extra/session.conf
 
 config:
+  build-commands:
+  - |
+    case '%{branch}' in
+      master)
+        branch_name='Nightly'
+        ;;
+      *)
+        branch_name='%{branch}'
+        ;;
+    esac
+
+    volume_id="GNOME OS ${branch_name} %{arch}"
+
+    sed 's/@VOLUME_ID@/${volume_id}/g' run-mount-installercd.mount.in \
+      >run-mount-installercd.mount
+
   install-commands:
   - |
     dir="$(pkg-config --variable=systemdsystemunitdir systemd)"
diff --git a/elements/iso/image.bst b/elements/iso/image.bst
index 6ceaa8ce..06b7b0c1 100644
--- a/elements/iso/image.bst
+++ b/elements/iso/image.bst
@@ -35,10 +35,19 @@ config:
 
   commands:
   - |
+    case '%{branch}' in
+      master)
+        branch_name='Nightly'
+        ;;
+      *)
+        branch_name='%{branch}'
+        ;;
+    esac
+
     prepare-image.sh \
        --sysroot /sysroot \
        --seed "%{uuidnamespace}" \
-       --rootsource LABEL=GNOME-OS-INSTALLER \
+       --rootsource LABEL="GNOME OS ${branch_name} %{arch}" \
        --rootfstype iso9660 \
        --noboot >/dev/null
 
@@ -84,11 +93,20 @@ config:
     EOF
 
   - |
+    case '%{branch}' in
+      master)
+        branch_name='Nightly'
+        ;;
+      *)
+        branch_name='%{branch}'
+        ;;
+    esac
+
     cat >/stage-2/genimage.cfg <<EOF
     image installer.iso {
         iso {
-            extraargs = "-e /efi.img -no-emul-boot -boot-load-size 4 -efi-boot-part --efi-boot-image"
-            volume-id = "GNOME-OS-INSTALLER"
+            extraargs = "-e /efi.img -no-emul-boot -boot-load-size 4 -efi-boot-part --efi-boot-image -sysid 
LINUX -publisher GNOME"
+            volume-id = "GNOME OS ${branch_name} %{arch}"
         }
     }
     config {
diff --git a/elements/iso/initramfs.bst b/elements/iso/initramfs.bst
index 72be2aad..bb6398e5 100644
--- a/elements/iso/initramfs.bst
+++ b/elements/iso/initramfs.bst
@@ -33,19 +33,37 @@ config:
 
   commands:
   - |
+    case '%{branch}' in
+      master)
+        branch_name='Nightly'
+        ;;
+      *)
+        branch_name='%{branch}'
+        ;;
+    esac
+
     prepare-image.sh \
        --seed "%{uuidnamespace}" \
-       --rootsource LABEL=GNOME-OS-INSTALLER \
+       --rootsource LABEL="GNOME OS ${branch_name} %{arch}" \
        --rootfstype iso9660 \
        --noboot >/dev/null
 
   - |
+    case '%{branch}' in
+      master)
+        branch_name='Nightly'
+        ;;
+      *)
+        branch_name='%{branch}'
+        ;;
+    esac
+
     dracut -v --uefi \
            --uefi-stub /usr/lib/systemd/boot/efi/linux%{efi-arch}.efi.stub \
            --kernel-image "/boot/vmlinuz" \
            --no-machineid \
            --kver "$(ls -1 /usr/lib/modules | head -n1)" \
-           --kernel-cmdline "rw quiet splash root=live:LABEL=GNOME-OS-INSTALLER" \
+           --kernel-cmdline "rw quiet splash root=live:LABEL='GNOME OS ${branch_name} %{arch}'" \
            --add dmsquash-live \
            --add plymouth \
            --install grep \
diff --git a/files/eos-installer-extra/run-mount-installercd.mount 
b/files/eos-installer-extra/run-mount-installercd.mount.in
similarity index 82%
rename from files/eos-installer-extra/run-mount-installercd.mount
rename to files/eos-installer-extra/run-mount-installercd.mount.in
index 2cebf68b..626bab8f 100644
--- a/files/eos-installer-extra/run-mount-installercd.mount
+++ b/files/eos-installer-extra/run-mount-installercd.mount.in
@@ -2,7 +2,7 @@
 Description=Mount installer CD
 
 [Mount]
-What=LABEL=GNOME-OS-INSTALLER
+What=LABEL=@VOLUME_ID@
 Where=/run/mount/installercd
 Type=iso9660
 Options=ro,nodev,nosuid,noexec,nofail,allow_other


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]