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



commit c1fb602b8235daeb4910d83a06015ba273de53dd
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              | 50 +++++++++++++++++++++++++++
 2 files changed, 110 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..fd94c48d
--- /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 gtk,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..b61084ee
--- /dev/null
+++ b/elements/vm/desktop-vm.bst
@@ -0,0 +1,50 @@
+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/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
+- filename: core/systemd-presets.bst
+  type: build
+
+# Currently we just take everything and remove the
+# devel stuff (headers and static libraries), and debugging
+# symbols which take a huge amount of space, we could
+# refine this and make it much more selective, though.
+config:
+  exclude:
+  - devel
+  - debug


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