diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/binman/control.py | 9 | ||||
-rw-r--r-- | tools/buildman/README | 12 | ||||
-rw-r--r-- | tools/buildman/control.py | 10 | ||||
-rw-r--r-- | tools/docker/Dockerfile | 19 | ||||
-rw-r--r-- | tools/dtoc/dtb_platdata.py | 1 | ||||
-rw-r--r-- | tools/env/fw_env.c | 22 | ||||
-rw-r--r-- | tools/mkimage.c | 6 | ||||
-rwxr-xr-x | tools/patman/main.py | 12 | ||||
-rw-r--r-- | tools/patman/tools.py | 15 |
9 files changed, 68 insertions, 38 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py index dcba02ff7f..0dbcbc28e9 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -565,12 +565,9 @@ def Binman(args): global state if args.full_help: - pager = os.getenv('PAGER') - if not pager: - pager = 'more' - fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'README.rst') - command.Run(pager, fname) + tools.PrintFullHelp( + os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README.rst') + ) return 0 # Put these here so that we can import this module without libfdt diff --git a/tools/buildman/README b/tools/buildman/README index ec2d4e7c6f..ce27788432 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -1010,13 +1010,13 @@ For example: ... 43: Convert CONFIG_SPL_USBETH_SUPPORT to Kconfig arm: - + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET_SUPPORT=1 - + u-boot-spl.cfg: CONFIG_SPL_MMC_SUPPORT=1 CONFIG_SPL_NAND_SUPPORT=1 - + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC_SUPPORT=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET_SUPPORT=1 + + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET=1 + + u-boot-spl.cfg: CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 + + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET=1 am335x_evm_usbspl : - + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET_SUPPORT=1 - + u-boot-spl.cfg: CONFIG_SPL_MMC_SUPPORT=1 CONFIG_SPL_NAND_SUPPORT=1 - + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC_SUPPORT=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET_SUPPORT=1 + + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET=1 + + u-boot-spl.cfg: CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 + + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET=1 44: Convert CONFIG_SPL_USB_HOST to Kconfig ... diff --git a/tools/buildman/control.py b/tools/buildman/control.py index a98d1b4c06..fd9664c85d 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -16,6 +16,7 @@ from patman import command from patman import gitutil from patman import patchstream from patman import terminal +from patman import tools from patman.terminal import Print def GetPlural(count): @@ -133,12 +134,9 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, global builder if options.full_help: - pager = os.getenv('PAGER') - if not pager: - pager = 'more' - fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'README') - command.Run(pager, fname) + tools.PrintFullHelp( + os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README') + ) return 0 gitutil.Setup() diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 0195456dfe..92113dcb72 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -2,7 +2,7 @@ # This Dockerfile is used to build an image containing basic stuff to be used # to build U-Boot and run our test suites. -FROM ubuntu:focal-20210723 +FROM ubuntu:focal-20210827 MAINTAINER Tom Rini <trini@konsulko.com> LABEL Description=" This image is for building U-Boot inside a container" @@ -60,6 +60,7 @@ RUN apt-get update && apt-get install -y \ iasl \ imagemagick \ iputils-ping \ + libconfuse-dev \ libgit2-dev \ libguestfs-tools \ liblz4-tool \ @@ -76,6 +77,7 @@ RUN apt-get update && apt-get install -y \ mount \ mtd-utils \ mtools \ + ninja-build \ openssl \ picocom \ parted \ @@ -166,11 +168,24 @@ RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \ cd /tmp/qemu && \ git submodule update --init dtc && \ - git checkout v4.2.0 && \ + git checkout v6.1.0 && \ + # config user.name and user.email to make 'git am' happy + git config user.name u-boot && \ + git config user.email u-boot@denx.de && \ + # manually apply the bug fix for QEMU 6.1.0 Xilinx Zynq UART emulation codes + wget -O - http://patchwork.ozlabs.org/project/qemu-devel/patch/20210823020813.25192-2-bmeng.cn@gmail.com/mbox/ | git am && \ ./configure --prefix=/opt/qemu --target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv32-softmmu,riscv64-softmmu,sh4-softmmu,x86_64-softmmu,xtensa-softmmu" && \ make -j$(nproc) all install && \ rm -rf /tmp/qemu +# Build genimage (required by some targets to generate disk images) +RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ && \ + cd /tmp/genimage-14 && \ + ./configure && \ + make -j$(nproc) && \ + make install && \ + rm -rf /tmp/genimage-14 + # Create our user/group RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot RUN useradd -m -U uboot diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 869c92b49b..3bb5c680f2 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -62,6 +62,7 @@ VAL_PREFIX = 'dtv_' # a phandle property. PHANDLE_PROPS = { 'clocks': '#clock-cells', + 'interrupts-extended': '#interrupt-cells', 'gpios': '#gpio-cells', 'sandbox,emul': '#emul-cells', } diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 2a61a5d6f0..e39c39e23a 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -951,21 +951,23 @@ static int flash_read_buf(int dev, int fd, void *buf, size_t count, DEVNAME(dev), strerror(errno)); return -1; } - if (rc != readlen) { - fprintf(stderr, - "Read error on %s: Attempted to read %zd bytes but got %d\n", - DEVNAME(dev), readlen, rc); - return -1; - } #ifdef DEBUG fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n", rc, (unsigned long long)blockstart + block_seek, DEVNAME(dev)); #endif - processed += readlen; - readlen = min(blocklen, count - processed); - block_seek = 0; - blockstart += blocklen; + processed += rc; + if (rc != readlen) { + fprintf(stderr, + "Warning on %s: Attempted to read %zd bytes but got %d\n", + DEVNAME(dev), readlen, rc); + readlen -= rc; + block_seek += rc; + } else { + blockstart += blocklen; + readlen = min(blocklen, count - processed); + block_seek = 0; + } } return processed; diff --git a/tools/mkimage.c b/tools/mkimage.c index 302bfcf971..fbe883ce36 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -732,6 +732,12 @@ copy_file (int ifd, const char *datafile, int pad) exit (EXIT_FAILURE); } + if (sbuf.st_size == 0) { + fprintf (stderr, "%s: Input file %s is empty, bailing out\n", + params.cmdname, datafile); + exit (EXIT_FAILURE); + } + ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0); if (ptr == MAP_FAILED) { fprintf (stderr, "%s: Can't read %s: %s\n", diff --git a/tools/patman/main.py b/tools/patman/main.py index 04e37a5931..e5be28e331 100755 --- a/tools/patman/main.py +++ b/tools/patman/main.py @@ -28,6 +28,7 @@ from patman import settings from patman import terminal from patman import test_util from patman import test_checkpatch +from patman import tools epilog = '''Create patches from commits in a branch, check them and email them as specified by tags you place in the commits. Use -n to do a dry run first.''' @@ -170,14 +171,9 @@ elif args.cmd == 'send': fd.close() elif args.full_help: - pager = os.getenv('PAGER') - if not pager: - pager = shutil.which('less') - if not pager: - pager = 'more' - fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'README') - command.Run(pager, fname) + tools.PrintFullHelp( + os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README') + ) else: # If we are not processing tags, no need to warning about bad ones diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 877e37cd8d..710f1fdcd3 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -5,6 +5,7 @@ import glob import os +import shlex import shutil import struct import sys @@ -581,3 +582,17 @@ def ToHexSize(val): hex value of size, or 'None' if the value is None """ return 'None' if val is None else '%#x' % len(val) + +def PrintFullHelp(fname): + """Print the full help message for a tool using an appropriate pager. + + Args: + fname: Path to a file containing the full help message + """ + pager = shlex.split(os.getenv('PAGER', '')) + if not pager: + lesspath = shutil.which('less') + pager = [lesspath] if lesspath else None + if not pager: + pager = ['more'] + command.Run(*pager, fname) |