[gnome-build-meta/valentindavid/eos-installer: 14/17] Add installer ISO image



commit 8757e4bc6f4ed039624dbd4dbc9c2110e80010f6
Author: Valentin David <valentin david codethink co uk>
Date:   Wed Feb 26 13:11:50 2020 +0100

    Add installer ISO image

 elements/iso/deps.bst                         |  51 +++++++++
 elements/iso/filesystem.bst                   |  10 ++
 elements/iso/image.bst                        | 149 ++++++++++++++++++++++++++
 elements/iso/initial-scripts.bst              |   7 ++
 elements/iso/initramfs.bst                    |  74 +++++++++++++
 elements/iso/initramfs/deps.bst               |  20 ++++
 elements/iso/initramfs/initial-scripts.bst    |   7 ++
 elements/iso/installer-dirs.bst               |  12 +++
 elements/iso/installer-remove-gdm-service.bst |   7 ++
 elements/iso/iso-build-deps.bst               |  11 ++
 10 files changed, 348 insertions(+)
---
diff --git a/elements/iso/deps.bst b/elements/iso/deps.bst
new file mode 100644
index 00000000..7d6a77bb
--- /dev/null
+++ b/elements/iso/deps.bst
@@ -0,0 +1,51 @@
+kind: stack
+
+runtime-depends:
+- iso/eos-installer-extra.bst
+- iso/installer-dirs.bst
+- iso/public-key.bst
+
+- core-deps/plymouth.bst
+- vm/plymouth-gnome-theme.bst
+- freedesktop-sdk.bst:components/wayland.bst
+- freedesktop-sdk.bst:components/systemd.bst
+- freedesktop-sdk.bst:components/linux.bst
+- freedesktop-sdk.bst:components/shadow.bst
+- freedesktop-sdk.bst:vm/mesa-default.bst
+- sdk/os-release.bst
+- freedesktop-sdk.bst:vm/config/journald.bst
+- core-deps/NetworkManager.bst
+- freedesktop-sdk.bst:components/xorg-server.bst
+- core-deps/libinput.bst
+- core/gnome-shell.bst
+- freedesktop-sdk.bst:components/pwquality.bst
+- core/gnome-settings-daemon.bst
+
+- core/gdm.bst
+- core/gnome-backgrounds.bst
+- core/gnome-bluetooth.bst
+- core/gnome-color-manager.bst
+- core/gnome-control-center.bst
+- core/gnome-desktop.bst
+- core/gnome-getting-started-docs.bst
+- core/gnome-keyring.bst
+- core/gnome-menus.bst
+- core/gnome-session.bst
+- core/gnome-settings-daemon.bst
+- core/gnome-shell-extensions.bst
+- core/gnome-shell.bst
+- core/gnome-themes-extra.bst
+- core/gnome-user-docs.bst
+- core/gnome-user-share.bst
+- core/mutter.bst
+- core/orca.bst
+- core/rygel.bst
+- core/sushi.bst
+- sdk/adwaita-icon-theme.bst
+- sdk/glib-networking.bst
+- sdk/gsettings-desktop-schemas.bst
+- sdk/gvfs.bst
+- sdk/ibus.bst
+
+- freedesktop-sdk.bst:components/gdb.bst
+- freedesktop-sdk.bst:components/less.bst
diff --git a/elements/iso/filesystem.bst b/elements/iso/filesystem.bst
new file mode 100644
index 00000000..a4f04b4d
--- /dev/null
+++ b/elements/iso/filesystem.bst
@@ -0,0 +1,10 @@
+kind: compose
+
+build-depends:
+- iso/deps.bst
+- iso/installer-remove-gdm-service.bst
+
+config:
+  exclude:
+  - devel
+  - debug
diff --git a/elements/iso/image.bst b/elements/iso/image.bst
new file mode 100644
index 00000000..146b0aaa
--- /dev/null
+++ b/elements/iso/image.bst
@@ -0,0 +1,149 @@
+kind: script
+
+build-depends:
+- iso/iso-build-deps.bst
+- iso/xz-image.bst
+- iso/image-signature.bst
+- iso/filesystem.bst
+- iso/initial-scripts.bst
+- iso/initramfs.bst
+- iso/verify-signature.bst
+
+variables:
+  uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d
+
+config:
+  layout:
+  - element: ''
+    destination: /tmp
+  - element: ''
+    destination: /images
+  - element: ''
+    destination: /stage-0
+  - element: ''
+    destination: /stage-1
+  - element: ''
+    destination: /stage-2
+  - element: ''
+    destination: /stage-3
+  - element: ''
+    destination: /sysroot-stage-3
+  - element: iso/iso-build-deps.bst
+    destination: /
+  - element: iso/filesystem.bst
+    destination: /sysroot
+  - element: iso/initramfs.bst
+    destination: /sysroot-efi
+  - element: iso/initial-scripts.bst
+    destination: /
+  - element: iso/xz-image.bst
+    destination: /eosimages
+  - element: iso/image-signature.bst
+    destination: /eosimages
+
+  commands:
+  - |
+    prepare-image.sh \
+       --sysroot /sysroot \
+       --seed "%{uuidnamespace}" \
+       --rootpasswd root \
+       --rootsource LABEL=GNOME-OS-INSTALLER \
+       --rootfstype iso9660 \
+       --noboot >/dev/null
+
+  - |
+    cat >/stage-0/genimage.cfg <<\EOF
+    image eosimages.img {
+        vfat {
+            extraargs = "-F32 -n eosimages"
+        }
+        size = "700M"
+    }
+    image eosimages.gpt.img {
+        hdimage {
+            gpt = true
+        }
+        partition eosimages {
+            image = "eosimages.img"
+            partition-type-uuid = "F"
+        }
+    }
+    config {
+        rootpath = "/eosimages"
+        inputpath = "/images"
+        outputpath = "/images"
+    }
+    EOF
+
+  - |
+    cat >/stage-1/genimage.cfg <<\EOF
+    image efi.img {
+        vfat {
+            extraargs = "-F32 -n EFI"
+        }
+        size = "100M"
+    }
+    config {
+        rootpath = "/sysroot-efi"
+        inputpath = "/images"
+        outputpath = "/images"
+    }
+    EOF
+
+  - |
+    cat >/stage-2/genimage.cfg <<\EOF
+    image squashfs.img {
+        squashfs  {
+        }
+    }
+    config {
+        rootpath = "/sysroot"
+        inputpath = "/images"
+        outputpath = "/images"
+    }
+    EOF
+
+  - |
+    cat >/stage-3/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"
+        }
+    }
+    config {
+        rootpath = "/sysroot-stage-3"
+        inputpath = "/images"
+        outputpath = "/images"
+        genisoimage = "xorrisofs"
+    }
+    EOF
+
+  - |
+    cd /stage-0
+    genimage
+
+  - |
+    cd /stage-1
+    genimage
+
+  - |
+    cd /stage-2
+    genimage
+
+  - |
+    mkdir -p "/sysroot-stage-3/LiveOS"
+    cp "/images/squashfs.img" \
+       "/sysroot-stage-3/LiveOS/"
+    cp "/images/efi.img" \
+       "/sysroot-stage-3/"
+    cp "/images/eosimages.gpt.img" \
+       "/sysroot-stage-3/"
+
+  - |
+    cd /stage-3
+    genimage
+
+  - install -Dm644 -t "%{install-root}" /images/installer.iso
+
+  - implantisomd5 "%{install-root}/installer.iso"
diff --git a/elements/iso/initial-scripts.bst b/elements/iso/initial-scripts.bst
new file mode 100644
index 00000000..6a0d022d
--- /dev/null
+++ b/elements/iso/initial-scripts.bst
@@ -0,0 +1,7 @@
+kind: collect_initial_scripts
+
+build-depends:
+- iso/deps.bst
+
+config:
+  path: /etc/fdsdk/initial_scripts
diff --git a/elements/iso/initramfs.bst b/elements/iso/initramfs.bst
new file mode 100644
index 00000000..5dcb0586
--- /dev/null
+++ b/elements/iso/initramfs.bst
@@ -0,0 +1,74 @@
+kind: script
+
+build-depends:
+- iso/initramfs/deps.bst
+- iso/initramfs/initial-scripts.bst
+- freedesktop-sdk.bst:vm/prepare-image.bst
+
+variables:
+  uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d
+  install-root: /boot
+
+  efi-arch: "%{arch}"
+  (?):
+  - arch == "x86_64":
+      efi-arch: x64
+  - arch == "i686":
+      efi-arch: ia32
+
+config:
+  layout:
+  - element: ''
+    destination: '/tmp'
+  - element: ''
+    destination: '/var/tmp'
+  - element: ''
+    destination: '/boot'
+  - element: iso/initramfs/deps.bst
+    destination: '/'
+  - element: iso/initramfs/initial-scripts.bst
+    destination: '/'
+  - element: vm/prepare-image.bst
+    destination: '/'
+
+  commands:
+  - |
+    prepare-image.sh \
+       --seed "%{uuidnamespace}" \
+       --rootpasswd root \
+       --rootsource LABEL=GNOME-OS-INSTALLER \
+       --rootfstype iso9660 \
+       --noboot >/dev/null
+
+  - |
+    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" \
+           --add dmsquash-live \
+           --add plymouth \
+           --install grep \
+           --install head \
+           --install tail \
+           --install less \
+           --install lsof
+
+
+  - dbus-uuidgen >/etc/machine-id
+  - SYSTEMD_RELAX_ESP_CHECKS=1 bootctl --path='/boot' --no-variables install
+  - rm /etc/machine-id
+
+  - |
+    cat <<EOF >/boot/loader/loader.conf
+    timeout 3
+    editor yes
+    console-mode keep
+    default *
+    EOF
+
+  - |
+    rm -f /boot/vmlinuz
+    rm -f /boot/System.map
+
diff --git a/elements/iso/initramfs/deps.bst b/elements/iso/initramfs/deps.bst
new file mode 100644
index 00000000..a0b8cab2
--- /dev/null
+++ b/elements/iso/initramfs/deps.bst
@@ -0,0 +1,20 @@
+kind: stack
+
+runtime-depends:
+- freedesktop-sdk.bst:bootstrap-import.bst
+- freedesktop-sdk.bst:components/util-linux.bst
+- freedesktop-sdk.bst:components/linux.bst
+- freedesktop-sdk.bst:components/systemd.bst
+- freedesktop-sdk.bst:components/dbus.bst
+- freedesktop-sdk.bst:components/dracut.bst
+- sdk/os-release.bst
+- freedesktop-sdk.bst:components/shadow.bst
+- freedesktop-sdk.bst:components/tzdata.bst
+- freedesktop-sdk.bst:components/gzip.bst
+- freedesktop-sdk.bst:components/pkg-config.bst
+- core-deps/plymouth.bst
+- core-deps/lvm2.bst
+- iso/isomd5sum.bst
+- vm/plymouth-gnome-theme.bst
+
+- freedesktop-sdk.bst:components/less.bst
diff --git a/elements/iso/initramfs/initial-scripts.bst b/elements/iso/initramfs/initial-scripts.bst
new file mode 100644
index 00000000..e9dcd601
--- /dev/null
+++ b/elements/iso/initramfs/initial-scripts.bst
@@ -0,0 +1,7 @@
+kind: collect_initial_scripts
+
+build-depends:
+- iso/initramfs/deps.bst
+
+config:
+  path: /etc/fdsdk/initial_scripts
diff --git a/elements/iso/installer-dirs.bst b/elements/iso/installer-dirs.bst
new file mode 100644
index 00000000..5cd81914
--- /dev/null
+++ b/elements/iso/installer-dirs.bst
@@ -0,0 +1,12 @@
+kind: manual
+
+build-depends:
+- freedesktop-sdk.bst:bootstrap-import.bst
+
+config:
+  install-commands:
+  - |
+    mkdir %{install-root}/sys
+    mkdir %{install-root}/dev
+    mkdir %{install-root}/proc
+    mkdir %{install-root}/tmp
diff --git a/elements/iso/installer-remove-gdm-service.bst b/elements/iso/installer-remove-gdm-service.bst
new file mode 100644
index 00000000..32c50841
--- /dev/null
+++ b/elements/iso/installer-remove-gdm-service.bst
@@ -0,0 +1,7 @@
+kind: stack
+
+public:
+  bst:
+    integration-commands:
+    - |
+      rm "%{indep-libdir}/systemd/system/gdm.service"
diff --git a/elements/iso/iso-build-deps.bst b/elements/iso/iso-build-deps.bst
new file mode 100644
index 00000000..fd4a9125
--- /dev/null
+++ b/elements/iso/iso-build-deps.bst
@@ -0,0 +1,11 @@
+kind: stack
+
+runtime-depends:
+- core-deps/ostree.bst
+- iso/libisoburn.bst
+- iso/isomd5sum.bst
+- vm/qemu-tools.bst
+- freedesktop-sdk.bst:integration/mtab.bst
+- freedesktop-sdk.bst:components/genimage.bst
+- freedesktop-sdk.bst:vm/prepare-image.bst
+- freedesktop-sdk.bst:snap-images/squashfs-tools.bst


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