aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey 'Jin' Bostandzhyan <jin@mediatomb.cc>2020-02-11 04:50:08 +0100
committerTrevor Woerner <twoerner@gmail.com>2020-02-11 10:20:58 -0500
commit1aea373d8876b2f7faae2704f7bc70465c59dc13 (patch)
tree067f6ab2be5a465f9edbe02b01493e47759c9e8e
parent6e0ce163b0ddbe33e93a0ac8fcfc0f593eec707e (diff)
downloadmeta-rockchip-1aea373d8876b2f7faae2704f7bc70465c59dc13.tar.gz
meta-rockchip-1aea373d8876b2f7faae2704f7bc70465c59dc13.tar.bz2
meta-rockchip-1aea373d8876b2f7faae2704f7bc70465c59dc13.zip
Add configuration parameter to set boot device for the image
wic modifies /etc/fstab on the root file system during image generation, without the --ondisk parameter it assumes some default device name which leads to an /etc/fstab file populated with /dev/sda entries. This is not correct for the machines in the rockchip layer which use mmcblkX. This patch introduces an RK_BOOT_DEVICE option which is being set in the machine configuratoin and which is being used in the wks files. The variable expansion in the wks is handled by propagating the variable to the wic environment. This results in correct /etc/fstab entries and in a correct kernel bootargs root= parameter. Signed-off-by: Sergey Bostandzhyan <jin@mediatomb.cc>
-rw-r--r--conf/machine/include/rockchip-defaults.inc5
-rw-r--r--conf/machine/rock-pi-4.conf1
-rw-r--r--conf/machine/vyasa-rk3288.conf1
-rw-r--r--wic/firefly-rk3288.wks4
-rw-r--r--wic/rk3288-boot.wks12
-rw-r--r--wic/rk3399-boot.wks12
-rw-r--r--wic/rock-pi-4.wks4
-rw-r--r--wic/tinker-board.wks5
-rw-r--r--wic/vyasa-rk3288.wks4
9 files changed, 28 insertions, 20 deletions
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index 0507017..82fd590 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -21,3 +21,8 @@ XSERVER = " \
# misc
IMAGE_FSTYPES += "ext4"
+
+# boot device (sd-card/emmc)
+RK_BOOT_DEVICE ??= "mmcblk0"
+WICVARS_append = " RK_BOOT_DEVICE"
+
diff --git a/conf/machine/rock-pi-4.conf b/conf/machine/rock-pi-4.conf
index 4a0671c..5231abf 100644
--- a/conf/machine/rock-pi-4.conf
+++ b/conf/machine/rock-pi-4.conf
@@ -10,6 +10,7 @@ require conf/machine/include/rk3399.inc
KERNEL_DEVICETREE = "rockchip/rk3399-rock-pi-4.dtb"
UBOOT_MACHINE = "rock-pi-4-rk3399_defconfig"
+RK_BOOT_DEVICE = "mmcblk1"
WKS_FILE ?= "rock-pi-4.wks"
IMAGE_FSTYPES += "wic wic.bmap"
diff --git a/conf/machine/vyasa-rk3288.conf b/conf/machine/vyasa-rk3288.conf
index d8a6af6..1e1eba4 100644
--- a/conf/machine/vyasa-rk3288.conf
+++ b/conf/machine/vyasa-rk3288.conf
@@ -13,6 +13,7 @@ KERNEL_EXTRA_ARGS += "LOADADDR=0x02000000"
UBOOT_MACHINE = "vyasa-rk3288_defconfig"
+RK_BOOT_DEVICE = "mmcblk2"
WKS_FILE = "vyasa-rk3288.wks"
IMAGE_FSTYPES += "wic wic.bmap"
diff --git a/wic/firefly-rk3288.wks b/wic/firefly-rk3288.wks
index c2027bd..b60aa0e 100644
--- a/wic/firefly-rk3288.wks
+++ b/wic/firefly-rk3288.wks
@@ -2,6 +2,6 @@
# Released under the MIT license (see COPYING.MIT for the terms)
include rk3288-boot.wks
-part / --align 131072 --source rootfs --fstype=ext4 --label root
+part / --align 131072 --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root
-bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk0p7 rootfstype=ext4 init=/sbin/init"
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"
diff --git a/wic/rk3288-boot.wks b/wic/rk3288-boot.wks
index 53c8162..c0b7d95 100644
--- a/wic/rk3288-boot.wks
+++ b/wic/rk3288-boot.wks
@@ -15,10 +15,10 @@
# root 262144 -
#
-part loader1 --align 32 --size 4000K --source rawcopy --sourceparams="file=idbloader.img"
-part reserved1 --align 4032 --size 64K
-part reserved2 --align 4096 --size 4096K
-part loader2 --align 8192 --size 4096K --source rawcopy --sourceparams="file=u-boot.bin"
-part atf --align 12288 --size 4096K
-part /boot --align 16384 --size=114688K --active --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
+part loader1 --align 32 --size 4000K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=idbloader.img"
+part reserved1 --align 4032 --size 64K --ondisk ${RK_BOOT_DEVICE}
+part reserved2 --align 4096 --size 4096K --ondisk ${RK_BOOT_DEVICE}
+part loader2 --align 8192 --size 4096K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=u-boot.bin"
+part atf --align 12288 --size 4096K --ondisk ${RK_BOOT_DEVICE}
+part /boot --align 16384 --size=114688K --active --ondisk ${RK_BOOT_DEVICE} --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
diff --git a/wic/rk3399-boot.wks b/wic/rk3399-boot.wks
index 100b94d..885d46b 100644
--- a/wic/rk3399-boot.wks
+++ b/wic/rk3399-boot.wks
@@ -15,10 +15,10 @@
# root 262144 -
#
-part loader1 --align 32 --size 4000K --source rawcopy --sourceparams="file=idbloader.img"
-part reserved1 --align 4032 --size 64K
-part reserved2 --align 4096 --size 4096K
-part loader2 --align 8192 --size 4096K --source rawcopy --sourceparams="file=u-boot.itb"
-part atf --align 12288 --size 4096K
-part /boot --align 16384 --size=114688K --active --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
+part loader1 --align 32 --size 4000K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=idbloader.img"
+part reserved1 --align 4032 --size 64K --ondisk ${RK_BOOT_DEVICE}
+part reserved2 --align 4096 --size 4096K --ondisk ${RK_BOOT_DEVICE}
+part loader2 --align 8192 --size 4096K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=u-boot.itb"
+part atf --align 12288 --size 4096K --ondisk ${RK_BOOT_DEVICE}
+part /boot --align 16384 --size=114688K --active --ondisk ${RK_BOOT_DEVICE} --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"
diff --git a/wic/rock-pi-4.wks b/wic/rock-pi-4.wks
index 8e4b37c..75ac358 100644
--- a/wic/rock-pi-4.wks
+++ b/wic/rock-pi-4.wks
@@ -2,6 +2,6 @@
# Released under the MIT license (see COPYING.MIT for the terms)
include rk3399-boot.wks
-part / --align 131072 --source rootfs --fstype=ext4 --label root
+part / --align 131072 --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root
-bootloader --ptable gpt --append="console=tty1 console=ttyS2,1500000n8 rw root=/dev/mmcblk1p7 rootfstype=ext4 init=/sbin/init"
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,1500000n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"
diff --git a/wic/tinker-board.wks b/wic/tinker-board.wks
index c2027bd..8f08138 100644
--- a/wic/tinker-board.wks
+++ b/wic/tinker-board.wks
@@ -2,6 +2,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
include rk3288-boot.wks
-part / --align 131072 --source rootfs --fstype=ext4 --label root
-bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk0p7 rootfstype=ext4 init=/sbin/init"
+part / --align 131072 --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root
+
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"
diff --git a/wic/vyasa-rk3288.wks b/wic/vyasa-rk3288.wks
index f019e0d..b577e5a 100644
--- a/wic/vyasa-rk3288.wks
+++ b/wic/vyasa-rk3288.wks
@@ -2,7 +2,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
include rk3288-boot.wks
-part / --align 131072 --source rootfs --fstype=ext4 --label root
+part / --align 131072 --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root
-bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init"
+bootloader --ptable gpt --append="console=tty1 console=ttyS2,115200n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"