summaryrefslogtreecommitdiff
path: root/elements/initramfs
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-08 17:52:41 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-12-06 13:32:34 +0000
commit58d9422afe0191276109e2ecaeaec721d8816a88 (patch)
tree22e806333095785d66510f0928f1b7b0578542ad /elements/initramfs
parente230e8172a80cfde96f780af5f6be901b55bfbd0 (diff)
downloaddefinitions-58d9422afe0191276109e2ecaeaec721d8816a88.tar.gz
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
Diffstat (limited to 'elements/initramfs')
-rw-r--r--elements/initramfs/initramfs-gz.bst26
-rw-r--r--elements/initramfs/initramfs-scripts.bst6
-rw-r--r--elements/initramfs/initramfs.bst12
3 files changed, 44 insertions, 0 deletions
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
diff --git a/elements/initramfs/initramfs-scripts.bst b/elements/initramfs/initramfs-scripts.bst
new file mode 100644
index 00000000..536a3302
--- /dev/null
+++ b/elements/initramfs/initramfs-scripts.bst
@@ -0,0 +1,6 @@
+kind: import
+
+sources:
+- kind: local
+ path: files/initramfs-scripts
+ directory: /sbin
diff --git a/elements/initramfs/initramfs.bst b/elements/initramfs/initramfs.bst
new file mode 100644
index 00000000..15ef4c0d
--- /dev/null
+++ b/elements/initramfs/initramfs.bst
@@ -0,0 +1,12 @@
+kind: compose
+description: Initramfs composition
+
+depends:
+- filename: gnu-toolchain.bst
+ type: build
+- filename: initramfs/initramfs-scripts.bst
+ type: build
+
+config:
+ include:
+ - runtime