[gnome-build-meta/valentindavid/eos-installer: 25/27] Add installer ISO image
- From: Valentin David <valentindavid src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-build-meta/valentindavid/eos-installer: 25/27] Add installer ISO image
- Date: Sat, 18 Apr 2020 08:13:47 +0000 (UTC)
commit 2c85d374b0684a505150815f515e0d7d03159135
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 | 50 +++++++++++
elements/iso/filesystem.bst | 10 +++
elements/iso/image.bst | 122 ++++++++++++++++++++++++++
elements/iso/initial-scripts.bst | 7 ++
elements/iso/initramfs.bst | 74 ++++++++++++++++
elements/iso/initramfs/deps.bst | 19 ++++
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, 319 insertions(+)
---
diff --git a/elements/iso/deps.bst b/elements/iso/deps.bst
new file mode 100644
index 00000000..d9292c77
--- /dev/null
+++ b/elements/iso/deps.bst
@@ -0,0 +1,50 @@
+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
+- vm/spice-vdagent.bst
+- vm/linux-firmware.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
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..fe38e250
--- /dev/null
+++ b/elements/iso/image.bst
@@ -0,0 +1,122 @@
+kind: script
+
+build-depends:
+- iso/iso-build-deps.bst
+- iso/signed-image-only.bst
+- iso/filesystem.bst
+- iso/initial-scripts.bst
+- iso/initramfs.bst
+
+variables:
+ uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d
+
+config:
+ layout:
+ - element: ''
+ destination: /tmp
+ - element: ''
+ destination: /images
+ - element: ''
+ destination: /stage-1
+ - element: ''
+ destination: /stage-2
+ - element: ''
+ destination: /sysroot-stage-2
+ - 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/signed-image-only.bst
+ destination: /sysroot/eosimages
+
+ commands:
+ - |
+ prepare-image.sh \
+ --sysroot /sysroot \
+ --seed "%{uuidnamespace}" \
+ --rootpasswd root \
+ --rootsource LABEL=GNOME-OS-INSTALLER \
+ --rootfstype iso9660 \
+ --noboot >/dev/null
+
+ - |
+ get_size() {
+ size=$(($(du --apparent-size -B 512 -s "${1}" | cut -f1)*2))
+ echo $((${size}+(${size}/10)))k
+ }
+ cat >/stage-1/genimage.cfg <<EOF
+ image eosimages.img {
+ mountpoint = "/eosimages"
+ vfat {
+ extraargs = "-F32 -n eosimages"
+ }
+ size = $(get_size /sysroot/eosimages)
+ }
+ image eosimages.gpt.img {
+ hdimage {
+ gpt = true
+ }
+ partition eosimages {
+ image = "eosimages.img"
+ partition-type-uuid = "F"
+ }
+ }
+ image efi.img {
+ mountpoint = "/efi"
+ vfat {
+ extraargs = "-F32 -n EFI"
+ }
+ size = $(get_size /sysroot/efi)
+ }
+ image squashfs.img {
+ mountpoint = "/"
+ squashfs {
+ }
+ }
+ config {
+ rootpath = "/sysroot"
+ inputpath = "/images"
+ outputpath = "/images"
+ }
+ EOF
+
+ - |
+ 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"
+ }
+ }
+ config {
+ rootpath = "/sysroot-stage-2"
+ inputpath = "/images"
+ outputpath = "/images"
+ genisoimage = "xorrisofs"
+ }
+ EOF
+
+ - |
+ cd /stage-1
+ genimage
+
+ - |
+ mkdir -p "/sysroot-stage-2/LiveOS"
+ cp "/images/squashfs.img" \
+ "/sysroot-stage-2/LiveOS/"
+ cp "/images/efi.img" \
+ "/sysroot-stage-2/"
+ cp "/images/eosimages.gpt.img" \
+ "/sysroot-stage-2/"
+
+ - |
+ cd /stage-2
+ 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..fe892ed4
--- /dev/null
+++ b/elements/iso/initramfs/deps.bst
@@ -0,0 +1,19 @@
+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
+- vm/linux-firmware.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..99fea9f4
--- /dev/null
+++ b/elements/iso/iso-build-deps.bst
@@ -0,0 +1,11 @@
+kind: stack
+
+runtime-depends:
+- core-deps/libostree.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]