[gnome-build-meta/tristan/gnome-boot: 30/31] Adding vm/desktop-vm.bst & vm/desktop-vm-image-x86_64.bst



commit d5268bfe875f79808f648a35d039afc78bf83d6c
Author: Tristan Van Berkom <tristan vanberkom codethink co uk>
Date:   Fri May 3 16:54:31 2019 +0900

    Adding vm/desktop-vm.bst & vm/desktop-vm-image-x86_64.bst
    
    These collect artifacts from freedesktop-sdk and GNOME core
    modules to assemble a bootable VM image for x86_64 platforms.

 elements/vm/desktop-vm-image-x86_64.bst | 60 +++++++++++++++++++++++++++++++
 elements/vm/desktop-vm.bst              | 62 +++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
---
diff --git a/elements/vm/desktop-vm-image-x86_64.bst b/elements/vm/desktop-vm-image-x86_64.bst
new file mode 100644
index 00000000..59344c75
--- /dev/null
+++ b/elements/vm/desktop-vm-image-x86_64.bst
@@ -0,0 +1,60 @@
+kind: x86image
+description: Create a deployment of the desktop image
+depends:
+- filename: vm/desktop-vm.bst
+  type: build
+- filename: vm/deploy-tools.bst
+  junction: freedesktop-sdk.bst
+  type: build
+
+variables:
+  # Size of the disk to create
+  #
+  # Should be able to calculate this based on the space
+  # used, however it must be a multiple of (63 * 512) bytes
+  # as mtools wants a size that is devisable by sectors (512 bytes)
+  # per track (63).
+  #
+  # This is the smallest boot partition I managed to make.
+  boot-size: 38912K
+
+  rootfs-size: 5G
+  sector-size: 512
+  swap-size: 40K
+
+  kernel-args: root=/dev/sda2 rootfstype=ext4 init=/usr/lib/systemd/systemd console=ttyS0
+
+config:
+  base: vm/deploy-tools.bst
+  input: vm/desktop-vm.bst
+
+  filesystem-tree-setup-commands:
+    (<):
+    - mkdir -p %{build-root}/dev
+    - mkdir -p %{build-root}/proc
+    (>):
+    - |
+      # Set some setuid/setgid binaries, since BuildStream still does not
+      # support persisting these attributes in the artifacts, we need to
+      # do it at the last minute when creating the image.
+      chmod 4755 %{build-root}/usr/bin/su
+      chmod 4755 %{build-root}/usr/bin/passwd
+      chmod 4755 %{build-root}/usr/bin/gpasswd
+      chmod 4755 %{build-root}/usr/bin/chsh
+      chmod 4755 %{build-root}/usr/bin/chfn
+      chmod 4755 %{build-root}/usr/bin/newgrp
+      chmod 4755 %{build-root}/usr/bin/pkexec
+      chmod 4755 %{build-root}/usr/bin/mount
+      chmod 4755 %{build-root}/usr/bin/umount
+      chmod 2755 %{build-root}/usr/bin/expiry
+      chmod 2755 %{build-root}/usr/bin/chage
+      chmod 2755 %{build-root}/usr/bin/ssh-agent
+
+  final-commands:
+    (>):
+    - |
+      cat > %{install-root}/run-in-qemu.sh << EOF
+      #!/bin/sh
+      qemu-system-x86_64 -drive file=sda.img,format=raw -enable-kvm -m 2G -netdev user,id=net1 -device 
e1000,netdev=net1 -vga virtio -display sdl,gl=on -usb -usbdevice tablet
+      EOF
+      chmod +x %{install-root}/run-in-qemu.sh
diff --git a/elements/vm/desktop-vm.bst b/elements/vm/desktop-vm.bst
new file mode 100644
index 00000000..e78345fb
--- /dev/null
+++ b/elements/vm/desktop-vm.bst
@@ -0,0 +1,62 @@
+kind: compose
+
+depends:
+- filename: vm/base-filesystem.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: components/util-linux.bst
+  junction: freedesktop-sdk.bst
+  type: build
+#- filename: components/man-db-generate.bst
+#  junction: freedesktop-sdk.bst
+#  type: build
+- filename: split-locales.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: split-docs.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: components/tzdata.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: vm/bsp-generic.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: vm/initramfs/initramfs-gz.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: components/systemd.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: components/xorg-server.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: vm/linux-vm-boot/shadow.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: vm/boot-integration.bst
+  junction: freedesktop-sdk.bst
+  type: build
+- filename: vm/mesa-default.bst
+  junction: freedesktop-sdk.bst
+  type: build
+
+# And add GNOME core on top !
+- filename: sdk.bst
+  type: build
+- filename: core.bst
+  type: build
+
+# Hmm lets create a huge image for now, I don't trust the splits
+config:
+  exclude:
+  - devel
+  - debug
+
+public:
+  bst:
+    split-rules:
+      docs:
+      - '%{datadir}/runtime/docs/**'
+      locale:
+      - '%{datadir}/runtime/locale/**'


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