All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image
@ 2020-02-10 17:25 jin
  2020-02-10 17:25 ` [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration jin
  2020-02-11  4:22 ` [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image Trevor Woerner
  0 siblings, 2 replies; 6+ messages in thread
From: jin @ 2020-02-10 17:25 UTC (permalink / raw)
  To: yocto; +Cc: twoerner, Sergey 'Jin' Bostandzhyan

From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>

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>
---
 conf/machine/include/rk3288.inc            |  1 -
 conf/machine/include/rockchip-defaults.inc |  5 +++++
 conf/machine/rock-pi-4.conf                |  1 +
 conf/machine/vyasa-rk3288.conf             |  1 +
 wic/firefly-rk3288.wks                     |  4 ++--
 wic/rk3288-boot.wks                        | 12 ++++++------
 wic/rk3399-boot.wks                        | 12 ++++++------
 wic/rock-pi-4.wks                          |  4 ++--
 wic/tinker-board.wks                       |  5 +++--
 wic/vyasa-rk3288.wks                       |  4 ++--
 10 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index a7edac5..3504f10 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -14,4 +14,3 @@ SERIAL_CONSOLES = "115200;ttyS2"
 
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
 SPL_BINARY ?= "idbloader.img"
-
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"
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration
  2020-02-10 17:25 [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image jin
@ 2020-02-10 17:25 ` jin
  2020-02-11  4:23   ` Trevor Woerner
  2020-02-11  4:22 ` [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image Trevor Woerner
  1 sibling, 1 reply; 6+ messages in thread
From: jin @ 2020-02-10 17:25 UTC (permalink / raw)
  To: yocto; +Cc: twoerner, Sergey 'Jin' Bostandzhyan

From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>

Asus Tinker Board-S has emmc on mmcblk1, this is also the default
configuration when building the image. If you need an image for booting
from the sd card set RK_BOOT_DEVICE to mmcblk0

Signed-off-by: Sergey Bostandzhyan <jin@mediatomb.cc>
---
 README                           |  1 +
 conf/machine/tinker-board-s.conf | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 conf/machine/tinker-board-s.conf

diff --git a/README b/README
index 983d946..d7a42fe 100644
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ Status of supported boards:
 	builds and boots gpt image:
 		rock-pi-4
 		tinker-board
+		tinker-board-s
 		vyasa-rk3288
 		firefly-rk3288
 	builds:
diff --git a/conf/machine/tinker-board-s.conf b/conf/machine/tinker-board-s.conf
new file mode 100644
index 0000000..0f7d80f
--- /dev/null
+++ b/conf/machine/tinker-board-s.conf
@@ -0,0 +1,27 @@
+# Copyright (C) 2018  Trevor Woerner
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: Tinker-S RK3288
+#@DESCRIPTION: ASUS Tinker Board is a Raspberry Pi 3 Alternative based on Rockchip RK3288 Processor.
+
+require conf/machine/include/rk3288.inc
+
+KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
+UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
+
+RK_BOOT_DEVICE ?= "mmcblk1"
+
+WKS_FILE = "tinker-board.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+
+WKS_FILE_DEPENDS ?= " \
+    mtools-native \
+    dosfstools-native \
+    virtual/bootloader \
+    virtual/kernel \
+    "
+IMAGE_BOOT_FILES ?= "\
+    ${KERNEL_IMAGETYPE} \
+    ${KERNEL_DEVICETREE} \
+    "
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-rockchip][PATCH v2 1/2] Add configuration parameter to set boot device for the image
  2020-02-11  4:22 ` [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image Trevor Woerner
@ 2020-02-11  3:50   ` Sergey Bostandzhyan
  0 siblings, 0 replies; 6+ messages in thread
From: Sergey Bostandzhyan @ 2020-02-11  3:50 UTC (permalink / raw)
  To: yocto; +Cc: twoerner, Sergey 'Jin' Bostandzhyan

From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>

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>
---
 conf/machine/include/rockchip-defaults.inc |  5 +++++
 conf/machine/rock-pi-4.conf                |  1 +
 conf/machine/vyasa-rk3288.conf             |  1 +
 wic/firefly-rk3288.wks                     |  4 ++--
 wic/rk3288-boot.wks                        | 12 ++++++------
 wic/rk3399-boot.wks                        | 12 ++++++------
 wic/rock-pi-4.wks                          |  4 ++--
 wic/tinker-board.wks                       |  5 +++--
 wic/vyasa-rk3288.wks                       |  4 ++--
 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"
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-rockchip][PATCH v2 2/2] Add tinker-board-s machine configuration
  2020-02-11  4:23   ` Trevor Woerner
@ 2020-02-11  3:52     ` Sergey Bostandzhyan
  0 siblings, 0 replies; 6+ messages in thread
From: Sergey Bostandzhyan @ 2020-02-11  3:52 UTC (permalink / raw)
  To: yocto; +Cc: twoerner, Sergey 'Jin' Bostandzhyan

From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>

Asus Tinker Board-S has emmc on mmcblk1, this is also the default
configuration when building the image. If you need an image for booting
from the sd card set RK_BOOT_DEVICE to mmcblk0

Signed-off-by: Sergey Bostandzhyan <jin@mediatomb.cc>
---
 README                           |  1 +
 conf/machine/tinker-board-s.conf | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 conf/machine/tinker-board-s.conf

diff --git a/README b/README
index 983d946..d7a42fe 100644
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ Status of supported boards:
 	builds and boots gpt image:
 		rock-pi-4
 		tinker-board
+		tinker-board-s
 		vyasa-rk3288
 		firefly-rk3288
 	builds:
diff --git a/conf/machine/tinker-board-s.conf b/conf/machine/tinker-board-s.conf
new file mode 100644
index 0000000..a7fe2fc
--- /dev/null
+++ b/conf/machine/tinker-board-s.conf
@@ -0,0 +1,27 @@
+# Copyright (C) 2020  Sergey Bostandzhyan
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: Tinker-S RK3288
+#@DESCRIPTION: ASUS Tinker Board is a Raspberry Pi 3 Alternative based on Rockchip RK3288 Processor.
+
+require conf/machine/include/rk3288.inc
+
+KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
+UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
+
+RK_BOOT_DEVICE ?= "mmcblk1"
+
+WKS_FILE = "tinker-board.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+
+WKS_FILE_DEPENDS ?= " \
+    mtools-native \
+    dosfstools-native \
+    virtual/bootloader \
+    virtual/kernel \
+    "
+IMAGE_BOOT_FILES ?= "\
+    ${KERNEL_IMAGETYPE} \
+    ${KERNEL_DEVICETREE} \
+    "
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image
  2020-02-10 17:25 [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image jin
  2020-02-10 17:25 ` [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration jin
@ 2020-02-11  4:22 ` Trevor Woerner
  2020-02-11  3:50   ` [meta-rockchip][PATCH v2 " Sergey Bostandzhyan
  1 sibling, 1 reply; 6+ messages in thread
From: Trevor Woerner @ 2020-02-11  4:22 UTC (permalink / raw)
  To: Sergey Bostandzhyan; +Cc: yocto

On Mon 2020-02-10 @ 06:25:22 PM, Sergey Bostandzhyan wrote:
> From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
> 
> 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>
> ---
>  conf/machine/include/rk3288.inc            |  1 -
>  conf/machine/include/rockchip-defaults.inc |  5 +++++
>  conf/machine/rock-pi-4.conf                |  1 +
>  conf/machine/vyasa-rk3288.conf             |  1 +
>  wic/firefly-rk3288.wks                     |  4 ++--
>  wic/rk3288-boot.wks                        | 12 ++++++------
>  wic/rk3399-boot.wks                        | 12 ++++++------
>  wic/rock-pi-4.wks                          |  4 ++--
>  wic/tinker-board.wks                       |  5 +++--
>  wic/vyasa-rk3288.wks                       |  4 ++--
>  10 files changed, 28 insertions(+), 21 deletions(-)
> 
> diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
> index a7edac5..3504f10 100644
> --- a/conf/machine/include/rk3288.inc
> +++ b/conf/machine/include/rk3288.inc
> @@ -14,4 +14,3 @@ SERIAL_CONSOLES = "115200;ttyS2"
>  
>  PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
>  SPL_BINARY ?= "idbloader.img"
> -

The above looks like a whitespace change? Can you send a v2 without it,
otherwise I can remove it when applying.

Otherwise this patch looks good to me.

> 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"
>  
> -- 
> 2.24.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration
  2020-02-10 17:25 ` [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration jin
@ 2020-02-11  4:23   ` Trevor Woerner
  2020-02-11  3:52     ` [meta-rockchip][PATCH v2 " Sergey Bostandzhyan
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Woerner @ 2020-02-11  4:23 UTC (permalink / raw)
  To: Sergey Bostandzhyan; +Cc: yocto

On Mon 2020-02-10 @ 06:25:23 PM, Sergey Bostandzhyan wrote:
> From: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
> 
> Asus Tinker Board-S has emmc on mmcblk1, this is also the default
> configuration when building the image. If you need an image for booting
> from the sd card set RK_BOOT_DEVICE to mmcblk0
> 
> Signed-off-by: Sergey Bostandzhyan <jin@mediatomb.cc>
> ---
>  README                           |  1 +
>  conf/machine/tinker-board-s.conf | 27 +++++++++++++++++++++++++++
>  2 files changed, 28 insertions(+)
>  create mode 100644 conf/machine/tinker-board-s.conf
> 
> diff --git a/README b/README
> index 983d946..d7a42fe 100644
> --- a/README
> +++ b/README
> @@ -16,6 +16,7 @@ Status of supported boards:
>  	builds and boots gpt image:
>  		rock-pi-4
>  		tinker-board
> +		tinker-board-s
>  		vyasa-rk3288
>  		firefly-rk3288
>  	builds:
> diff --git a/conf/machine/tinker-board-s.conf b/conf/machine/tinker-board-s.conf
> new file mode 100644
> index 0000000..0f7d80f
> --- /dev/null
> +++ b/conf/machine/tinker-board-s.conf
> @@ -0,0 +1,27 @@
> +# Copyright (C) 2018  Trevor Woerner

Oops! Too much copy+pasta? This year and your name should be included above.

> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +#@TYPE: Machine
> +#@NAME: Tinker-S RK3288
> +#@DESCRIPTION: ASUS Tinker Board is a Raspberry Pi 3 Alternative based on Rockchip RK3288 Processor.
> +
> +require conf/machine/include/rk3288.inc
> +
> +KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
> +UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
> +
> +RK_BOOT_DEVICE ?= "mmcblk1"
> +
> +WKS_FILE = "tinker-board.wks"
> +IMAGE_FSTYPES += "wic wic.bmap"
> +
> +WKS_FILE_DEPENDS ?= " \
> +    mtools-native \
> +    dosfstools-native \
> +    virtual/bootloader \
> +    virtual/kernel \
> +    "
> +IMAGE_BOOT_FILES ?= "\
> +    ${KERNEL_IMAGETYPE} \
> +    ${KERNEL_DEVICETREE} \
> +    "
> -- 
> 2.24.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-11 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 17:25 [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image jin
2020-02-10 17:25 ` [meta-rockchip][PATCH 2/2] Add tinker-board-s machine configuration jin
2020-02-11  4:23   ` Trevor Woerner
2020-02-11  3:52     ` [meta-rockchip][PATCH v2 " Sergey Bostandzhyan
2020-02-11  4:22 ` [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image Trevor Woerner
2020-02-11  3:50   ` [meta-rockchip][PATCH v2 " Sergey Bostandzhyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.