From 58d9422afe0191276109e2ecaeaec721d8816a88 Mon Sep 17 00:00:00 2001
From: Sam Thursfield <sam.thursfield@codethink.co.uk>
Date: Wed, 8 Nov 2017 17:52:41 +0000
Subject: Add support for building an initramfs

The scripts are taken from
https://gitlab.com/BuildStream/buildstream-tests (branch build-gnome).

Those in turn were taken from
http://git.baserock.org/baserock/baserock/initramfs-scripts.git

We manually set the executable permissions in the init scripts
using chmod, because
https://gitlab.com/BuildStream/buildstream/issues/84
---
 elements/initramfs/initramfs-gz.bst | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 elements/initramfs/initramfs-gz.bst

(limited to 'elements/initramfs/initramfs-gz.bst')

diff --git a/elements/initramfs/initramfs-gz.bst b/elements/initramfs/initramfs-gz.bst
new file mode 100644
index 00000000..383e9603
--- /dev/null
+++ b/elements/initramfs/initramfs-gz.bst
@@ -0,0 +1,26 @@
+kind: script
+description: The compressed initramfs
+
+depends:
+- filename: initramfs/initramfs.bst
+  type: build
+- filename: gnu-toolchain.bst
+  type: build
+
+variables:
+  cwd: "%{build-root}"
+
+config:
+  layout:
+  - element: gnu-toolchain.bst
+    destination: /
+  - element: initramfs/initramfs.bst
+    destination: "%{build-root}"
+
+  commands:
+  - mkdir -p %{install-root}/boot
+  # We need to ensure exec permissions here.
+  # See: https://gitlab.com/BuildStream/buildstream/issues/84
+  - chmod +x ./sbin/init ./sbin/shutdown
+  - (find . -print0 | cpio -0 -H newc -o) |
+    gzip -c > %{install-root}/boot/initramfs.gz
-- 
cgit v1.2.1

