Message ID | 20240304153253.732708-20-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Hello Dario, Le 04/03/2024 à 16:32, Dario Binacchi a écrit : > The patch makes it clear that the moved scripts can be used by the > am6{2,4}x platforms. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > Added in v8 > > board/ti/am62x-sk/post-image.sh | 5 ----- > board/ti/{am62x-sk => common/am6xx}/post-build.sh | 0 > board/ti/common/am6xx/post-image.sh | 11 +++++++++++ > configs/ti_am62x_sk_defconfig | 4 ++-- > 4 files changed, 13 insertions(+), 7 deletions(-) > delete mode 100755 board/ti/am62x-sk/post-image.sh > rename board/ti/{am62x-sk => common/am6xx}/post-build.sh (100%) > create mode 100755 board/ti/common/am6xx/post-image.sh > > diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh > deleted file mode 100755 > index 34f732c091ad..000000000000 > --- a/board/ti/am62x-sk/post-image.sh > +++ /dev/null > @@ -1,5 +0,0 @@ > -#!/bin/sh -x > - > -BOARD_DIR="$(dirname "$0")" > - > -support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg" > diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/common/am6xx/post-build.sh > similarity index 100% > rename from board/ti/am62x-sk/post-build.sh > rename to board/ti/common/am6xx/post-build.sh > diff --git a/board/ti/common/am6xx/post-image.sh b/board/ti/common/am6xx/post-image.sh > new file mode 100755 > index 000000000000..917ca238aa78 > --- /dev/null > +++ b/board/ti/common/am6xx/post-image.sh > @@ -0,0 +1,11 @@ > +#!/bin/sh -x > + > +board_dir() { > + if grep -Eq "^BR2_DEFCONFIG=.*/ti_am64x_sk_defconfig\"$" "${BR2_CONFIG}"; then > + echo "am64x-sk" > + else > + echo "am62x-sk" What if we add a new board based on am62 SoC like the beagleplay [1] ? I believe it's fine to have tiny post-image.sh script in each board directory instead of generic script that is aware of boards names (actually board directory name in Buildroot). [1] https://www.beagleboard.org/boards/beagleplay Best regards, Romain > + fi > +} > + > +support/scripts/genimage.sh -c "board/ti/$(board_dir)/genimage.cfg" > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig > index bd294bb712ee..310ba6fb6453 100644 > --- a/configs/ti_am62x_sk_defconfig > +++ b/configs/ti_am62x_sk_defconfig > @@ -1,7 +1,7 @@ > BR2_aarch64=y > BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y > -BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh" > -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh" > +BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/common/am6xx/post-build.sh" > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/common/am6xx/post-image.sh" > BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -l am62x-sk-buildroot -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000" > BR2_LINUX_KERNEL=y > BR2_LINUX_KERNEL_CUSTOM_VERSION=y
Hi Romain On Wed, Mar 13, 2024 at 11:56 AM Romain Naour <romain.naour@smile.fr> wrote: > > Hello Dario, > > Le 04/03/2024 à 16:32, Dario Binacchi a écrit : > > The patch makes it clear that the moved scripts can be used by the > > am6{2,4}x platforms. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > --- > > > > Added in v8 > > > > board/ti/am62x-sk/post-image.sh | 5 ----- > > board/ti/{am62x-sk => common/am6xx}/post-build.sh | 0 > > board/ti/common/am6xx/post-image.sh | 11 +++++++++++ > > configs/ti_am62x_sk_defconfig | 4 ++-- > > 4 files changed, 13 insertions(+), 7 deletions(-) > > delete mode 100755 board/ti/am62x-sk/post-image.sh > > rename board/ti/{am62x-sk => common/am6xx}/post-build.sh (100%) > > create mode 100755 board/ti/common/am6xx/post-image.sh > > > > diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh > > deleted file mode 100755 > > index 34f732c091ad..000000000000 > > --- a/board/ti/am62x-sk/post-image.sh > > +++ /dev/null > > @@ -1,5 +0,0 @@ > > -#!/bin/sh -x > > - > > -BOARD_DIR="$(dirname "$0")" > > - > > -support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg" > > diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/common/am6xx/post-build.sh > > similarity index 100% > > rename from board/ti/am62x-sk/post-build.sh > > rename to board/ti/common/am6xx/post-build.sh > > diff --git a/board/ti/common/am6xx/post-image.sh b/board/ti/common/am6xx/post-image.sh > > new file mode 100755 > > index 000000000000..917ca238aa78 > > --- /dev/null > > +++ b/board/ti/common/am6xx/post-image.sh > > @@ -0,0 +1,11 @@ > > +#!/bin/sh -x > > + > > +board_dir() { > > + if grep -Eq "^BR2_DEFCONFIG=.*/ti_am64x_sk_defconfig\"$" "${BR2_CONFIG}"; then > > + echo "am64x-sk" > > + else > > + echo "am62x-sk" > > What if we add a new board based on am62 SoC like the beagleplay [1] ? > > I believe it's fine to have tiny post-image.sh script in each board directory > instead of generic script that is aware of boards names (actually board > directory name in Buildroot). > This is TI common, other vendor can have their own script. Why all the boards thould keep from there? Michael > [1] https://www.beagleboard.org/boards/beagleplay > > Best regards, > Romain > > > > + fi > > +} > > + > > +support/scripts/genimage.sh -c "board/ti/$(board_dir)/genimage.cfg" > > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig > > index bd294bb712ee..310ba6fb6453 100644 > > --- a/configs/ti_am62x_sk_defconfig > > +++ b/configs/ti_am62x_sk_defconfig > > @@ -1,7 +1,7 @@ > > BR2_aarch64=y > > BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y > > -BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh" > > -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh" > > +BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/common/am6xx/post-build.sh" > > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/common/am6xx/post-image.sh" > > BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -l am62x-sk-buildroot -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000" > > BR2_LINUX_KERNEL=y > > BR2_LINUX_KERNEL_CUSTOM_VERSION=y >
diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh deleted file mode 100755 index 34f732c091ad..000000000000 --- a/board/ti/am62x-sk/post-image.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -x - -BOARD_DIR="$(dirname "$0")" - -support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg" diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/common/am6xx/post-build.sh similarity index 100% rename from board/ti/am62x-sk/post-build.sh rename to board/ti/common/am6xx/post-build.sh diff --git a/board/ti/common/am6xx/post-image.sh b/board/ti/common/am6xx/post-image.sh new file mode 100755 index 000000000000..917ca238aa78 --- /dev/null +++ b/board/ti/common/am6xx/post-image.sh @@ -0,0 +1,11 @@ +#!/bin/sh -x + +board_dir() { + if grep -Eq "^BR2_DEFCONFIG=.*/ti_am64x_sk_defconfig\"$" "${BR2_CONFIG}"; then + echo "am64x-sk" + else + echo "am62x-sk" + fi +} + +support/scripts/genimage.sh -c "board/ti/$(board_dir)/genimage.cfg" diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig index bd294bb712ee..310ba6fb6453 100644 --- a/configs/ti_am62x_sk_defconfig +++ b/configs/ti_am62x_sk_defconfig @@ -1,7 +1,7 @@ BR2_aarch64=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y -BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/common/am6xx/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/common/am6xx/post-image.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -l am62x-sk-buildroot -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y
The patch makes it clear that the moved scripts can be used by the am6{2,4}x platforms. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- Added in v8 board/ti/am62x-sk/post-image.sh | 5 ----- board/ti/{am62x-sk => common/am6xx}/post-build.sh | 0 board/ti/common/am6xx/post-image.sh | 11 +++++++++++ configs/ti_am62x_sk_defconfig | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) delete mode 100755 board/ti/am62x-sk/post-image.sh rename board/ti/{am62x-sk => common/am6xx}/post-build.sh (100%) create mode 100755 board/ti/common/am6xx/post-image.sh