[OpenWrt-Devel] [PATCH] scripts/ubinize-image.sh: fix buildbot breakage

Yousong Zhou yszhou4tech at gmail.com
Sat Jul 27 03:03:48 EDT 2019


On Sat, 27 Jul 2019 at 14:02, Petr Štetiar <ynezz at true.cz> wrote:
>
> New Docker based buildslaves install just bare minimum of packages, thus
> not having bsdmainutils package installed which provides `hexdump`
> utility, leading to the following build breakage on buildbots:
>
>  ubinize-image.sh: 12: /builder/scripts/ubinize-image.sh: hexdump: not found
>
> So this patch simply replaces `hexdump` with `od` utility provided by
> coreutils package, which should be likely available.
>
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
>  scripts/ubinize-image.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/ubinize-image.sh b/scripts/ubinize-image.sh
> index 09a00b1898ce..79935bad1db2 100755
> --- a/scripts/ubinize-image.sh
> +++ b/scripts/ubinize-image.sh
> @@ -9,7 +9,7 @@ outfile=""
>  err=""
>
>  get_magic_word() {
> -       dd if=$1 bs=2 count=1 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
> +       dd if=$1 bs=2 count=1 2>/dev/null | od -x | head -1 | cut -d ' ' -f2
>  }

The change will have endian issue.

I experimented it a bit, the following should work

  od -A n -N 2 -t x1 a | tr -d ' '

On target system by default we have hexdump but no od.  Maybe we
should revise the docker image to also include hexdump.

Regards,
                yousong

>
>  is_ubifs() {
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list