From 44f9f11caa777d2defa383b1184757038eea25a2 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Thu, 27 Mar 2025 11:44:41 +0100 Subject: [PATCH] add board specific code to layer --- recipes-core/base-files/base-files_%.bbappend | 5 ++++- recipes-core/images/core-image-recovery.bbapend | 7 +++++++ wic/image.wks.in | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 recipes-core/images/core-image-recovery.bbapend create mode 100644 wic/image.wks.in diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index 091dec2..f278e1e 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -1,7 +1,10 @@ hostname = "diya" do_install:append () { -cat << EOF >> "${D}${sysconfdir}/modules" + cat << 'EOF' >> "${D}${sysconfdir}/profile" +export DISK="mmcblk1" +EOF + cat << EOF >> "${D}${sysconfdir}/modules" uwe5622_bsp_sdio sprdwl_ng sprdbt_tty diff --git a/recipes-core/images/core-image-recovery.bbapend b/recipes-core/images/core-image-recovery.bbapend new file mode 100644 index 0000000..e40048c --- /dev/null +++ b/recipes-core/images/core-image-recovery.bbapend @@ -0,0 +1,7 @@ +image_patch:append () { + # create /etc/fstab + cat << EOF > ${IMAGE_ROOTFS}/etc/fstab +/dev/mmcblk1p1 /boot auto defaults 0 0 +/dev/mmcblk1p4 /home auto defaults 0 0 +EOF +} \ No newline at end of file diff --git a/wic/image.wks.in b/wic/image.wks.in new file mode 100644 index 0000000..47cb8a2 --- /dev/null +++ b/wic/image.wks.in @@ -0,0 +1,12 @@ +# short-description: Create Raspberry Pi SD card image +# long-description: Creates a partitioned SD card image for use with + +part u-boot --source rawcopy --sourceparams="file=${SPL_BINARY}" --ondisk mmcblk1 --no-table --align 8 +part /boot --source bootimg-partition --ondisk mmcblk1 --fstype=vfat --label boot --active --align 4096 --size 32 +# read only roofs +part / --source rootfs --ondisk mmcblk1 --fstype=ext4 --label root --align 4096 --size 150 --exclude-path home/ --exclude-path var/etc/ --exclude-path boot/ +# modifiable configurations stored in /var/etc +part /var/etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var/etc --ondisk mmcblk1 --fstype=ext4 --label diya --align 1024 --size 32 +# home partition +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --ondisk mmcblk1 --fstype=ext4 --label home --align 1024 --size 16 +# part /home --ondisk mmcblk1 --fstype=vfat --label music --active --align 1024 --size 16 \ No newline at end of file