diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-10 11:25:31 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-12-06 14:45:25 +0000 |
commit | 6c27a98c6a5207a29bffaeeb486479a2c24cd26c (patch) | |
tree | b6955b8dec6fde8cd5837b8487dc66a0325ed23b /elements/systems/minimal-system-image-x86_64.bst | |
parent | 58d9422afe0191276109e2ecaeaec721d8816a88 (diff) | |
download | definitions-6c27a98c6a5207a29bffaeeb486479a2c24cd26c.tar.gz |
Add minimal-system-image-x86_64
This element produces a disk image that boots in QEMU. It has a kernel,
BusyBox, and little else; but should be suitable as a basis for more
grand endeavours.
This disk image we produce is 53MB. I spent a while trying to get this
as small as possible and this is as far as I got:
* The boot partition seems to have a minimum size just over 32MB;
lower than that and SYSLINUX fails to write the boot sector. The
combined size of the initramfs and kernel is about 32MB, so I
imagine that's what limits us.
* The main partition is limited in size only by the amount of binaries
that we put there.
* We have a useless 40KB swap partition, which the x86image plugin
insists on creating for us. Again 40KB is the minimum size that
`mkswap` will allow. It's possible to override or modify the
x86image plugin to avoid swap altogether but I'm not sure of the
best way to proceed.
There are a few dependency cleanups in the bsp-generic stack; previously
we'd build the whole 'foundation' stack which took ages and wasn't
needed at all.
Diffstat (limited to 'elements/systems/minimal-system-image-x86_64.bst')
-rw-r--r-- | elements/systems/minimal-system-image-x86_64.bst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/elements/systems/minimal-system-image-x86_64.bst b/elements/systems/minimal-system-image-x86_64.bst new file mode 100644 index 00000000..d92d5fd5 --- /dev/null +++ b/elements/systems/minimal-system-image-x86_64.bst @@ -0,0 +1,37 @@ +kind: buildstream-external:x86image +description: Create a deployment of the minimal system +depends: +- filename: systems/minimal-system.bst + type: build +- filename: deploy-tools.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: 33516K + + rootfs-size: 20M + sector-size: 512 + swap-size: 40K + + kernel-args: root=/dev/sda2 rootfstype=ext4 init=/sbin/init console=ttyS0 + +config: + base: deploy-tools.bst + input: systems/minimal-system.bst + + final-commands: + (>): + - | + cat > %{install-root}/run-in-qemu.sh << EOF + #!/bin/sh + qemu-system-x86_64 -drive file=sda.img,format=raw -nographic + EOF + chmod +x %{install-root}/run-in-qemu.sh |