Skip to content

Commit

Permalink
core-image-tiny: Provide a new image recipe for poky-tiny that boots …
Browse files Browse the repository at this point in the history
…from RAM

This new image recipe creates an image from the artifacts
obtained after building core-image-tiny-initramfs, it boots
directly to a tiny rootfs provided by initrd

Signed-off-by: Alejandro Hernandez <[email protected]>
  • Loading branch information
Alejandro Hernandez authored and Saul Wold committed Sep 15, 2017
1 parent ee44757 commit 989db4c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
11 changes: 0 additions & 11 deletions common/recipes-core/images/core-image-tiny-initramfs.bbappend

This file was deleted.

37 changes: 37 additions & 0 deletions common/recipes-core/images/core-image-tiny.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
SUMMARY = "A tiny image just capable of allowing a device to boot from RAM, \
this image recipe generates an image file which rather boots from initrd than \
from storage, it achieves this by using wic to pick up the artifacts generated \
by the core-image-tiny-initramfs image"

# The actual rootfs/initrd will be the one from core-image-tiny-initramfs, so
# we reset IMAGE_INSTALL to avoid building other things that will be pointless
IMAGE_INSTALL = ""

# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = ""

IMAGE_LINGUAS = " "

LICENSE = "MIT"

IMAGE_ROOTFS_SIZE ?= "8192"

IMAGE_FSTYPES = "wic"
inherit core-image

# We get some parts from image-live that we need in order to boot from initrd
INITRD_IMAGE_LIVE ?= "core-image-tiny-initramfs"

python() {
image_b = d.getVar('IMAGE_BASENAME')
initrd_i = d.getVar('INITRD_IMAGE_LIVE')
if image_b == initrd_i:
bb.error('INITRD_IMAGE_LIVE %s cannot use the requested IMAGE_FSTYPE' % initrd_i)
bb.fatal('Check IMAGE_FSTYPES and INITRAMFS_FSTYPES settings.')
elif initrd_i:
d.appendVarFlag('do_image', 'depends', ' %s:do_image_complete' % initrd_i)
}

WKS_FILE_intel-corei7-64 = "core-image-tiny.wks.in"
WKS_FILE_intel-core2-32 = "core-image-tiny.wks.in"
WKS_FILE_intel-quark = "mktinygalileodisk.wks"
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# short-description: Create an EFI disk image with systemd-boot and corei7-64
# short-description: Create an EFI disk image with systemd-boot and corei7-64/core2-32
# long-description: Creates a partitioned EFI disk image that the user
# can directly dd to boot media. The selected bootloader is systemd-boot.
# This disk image is meant to be used by corei7-64 and core-image-tiny-initramfs
# This disk image is meant to be used by corei7-64/core2-32 and core-image-tiny-initramfs

part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=core-image-tiny-initramfs-intel-corei7-64.cpio.gz" --ondisk sda --label msdos --active --align 1024
part /boot --source bootimg-efi --sourceparams="loader=systemd-boot,initrd=core-image-tiny-initramfs-${MACHINE}.cpio.gz" --ondisk sda --label msdos --active --align 1024

bootloader --ptable gpt --timeout=5 --append="init=/bin/busybox sh init console=ttyS0,115200 console=tty0 rw LABEL=boot debugshell=5"

Expand Down
8 changes: 0 additions & 8 deletions wic/systemd-bootdisk-tiny32.wks

This file was deleted.

0 comments on commit 989db4c

Please sign in to comment.