All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Trevor Woerner" <twoerner@gmail.com>
To: Sergey Bostandzhyan <jin@mediatomb.cc>
Cc: yocto@yoctoproject.org
Subject: Re: [meta-rockchip][PATCH 1/2] Add configuration parameter to set boot device for the image
Date: Mon, 10 Feb 2020 23:22:19 -0500	[thread overview]
Message-ID: <20200211042218.GA10571@linux-uys3> (raw)
In-Reply-To: <1581355523-30072-1-git-send-email-jin@mediatomb.cc>

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
> 

  parent reply	other threads:[~2020-02-11  4:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Trevor Woerner [this message]
2020-02-11  3:50   ` [meta-rockchip][PATCH v2 1/2] Add configuration parameter to set boot device for the image Sergey Bostandzhyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211042218.GA10571@linux-uys3 \
    --to=twoerner@gmail.com \
    --cc=jin@mediatomb.cc \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.