Skip to content

Commit

Permalink
conf: sunxi.inc: add wks file for arm
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Pijanowski <[email protected]>
  • Loading branch information
macpijan committed Sep 28, 2020
1 parent df468d7 commit 9f622c7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
15 changes: 14 additions & 1 deletion conf/machine/include/sunxi.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
KERNEL_IMAGETYPE ?= "uImage"

IMAGE_CLASSES += "sdcard_image-sunxi"
IMAGE_FSTYPES += "ext3 tar.gz sunxi-sdimg"
IMAGE_FSTYPES += "ext3 tar.gz sunxi-sdimg wic.gz wic.bmap"

MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"

Expand All @@ -32,3 +32,16 @@ SPL_BINARY ?= "u-boot-sunxi-with-spl.bin"

SERIAL_CONSOLE ?= "115200 ttyS0"
MACHINE_FEATURES ?= "alsa apm keyboard rtc serial screen usbgadget usbhost vfat"

# Mimic the sdcard_image-sunxi.bbclass
# image-version-info file was also generated and installed to boot partition,
# but it is missing here - can be added somehow (how?) if required
SUNXI_FEX_FILE ?= " "
SUNXI_BOOT_SPACE ?= "40"
IMAGE_BOOT_FILES ?= "${KERNEL_IMAGETYPE} boot.scr"
# ship fex file for sunxi kernel, devicetree file for mainline kernel
IMAGE_BOOT_FILES += "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/kernel', 'linux-sunxi', '${SUNXI_FEX_FILE}', '${KERNEL_DEVICETREE}', d)}"
WKS_FILES ?= "sunxi-sdcard-image.wks.in"
WKS_FILE_DEPENDS ?= "virtual/kernel u-boot"
# in case of sunxi kernel, sunxi-board-fex must be built prior wic image assembly
WKS_FILE_DEPENDS += " ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/kernel', 'linux-sunxi', 'sunxi-board-fex', '', d)}"
18 changes: 18 additions & 0 deletions wic/sunxi-sdcard-image.wks.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# short-description: Create SD card image with a boot partition
# long-description:
# Create an image that can be written onto a SD card using dd for use
# with Allwinner arm (32-bit) SoC family
#
# The disk layout used is:
# - --------------------------- -------------- --------------
# | | u-boot-sunxi-with-spl.bin | boot | rootfs |
# - --------------------------- -------------- --------------
# ^ ^ ^ ^ ^
# | | | | |
# 0 | 2MiB ${SUNXI_BOOT_SPACE}MiB ${SUNXI_BOOT_SPACE}MiB + rootfs + IMAGE_EXTRA_SPACE
# 8KiB
#

part u-boot --source rawcopy --sourceparams="file=${SPL_BINARY}" --ondisk mmcblk0 --no-table --align 8
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 2048 --fixed-size ${SUNXI_BOOT_SPACE}
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --align 2048

0 comments on commit 9f622c7

Please sign in to comment.