From patchwork Sun Aug 1 21:00:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1512135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Dai2fK4y; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GdD7R5hbcz9sT6 for ; Mon, 2 Aug 2021 07:00:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83BAD832EB; Sun, 1 Aug 2021 23:00:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Dai2fK4y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18D7A832EF; Sun, 1 Aug 2021 23:00:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3BA5E832DA for ; Sun, 1 Aug 2021 23:00:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x229.google.com with SMTP id a19so21767737oiw.6 for ; Sun, 01 Aug 2021 14:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A9QqJEZ0rx5PcLv22yYnQqzPWivV+CaqQFhRQYf6g5Y=; b=Dai2fK4yKXr2EPSJ/oO3VgbgK9VsOTl0Uh3yGRKtoZzgWVBfKIa1VEMj0dRkDOghnV t6PARd3R3w6uhc4OhF5sjLVZQKA4Pu9cdjqF6WXAz1Xyyu8u91ip0wFomlyxD34q/szu fhpcproc6ezlEMXdyri1k1npM7EnhdY+klerQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A9QqJEZ0rx5PcLv22yYnQqzPWivV+CaqQFhRQYf6g5Y=; b=XCmDOte5g5qRcgdxzKS3vE+HGV8Em62SI8lD8PsGv4byaCHhLBZri91Ux+Fj0uhl3z AYYEP/kVstQDfdG6tgowjVD7p0IkhQJ+P5HFHricUyQ1DF5x2Id0qSuoPEtZl0CJZJvO xyy6SBXIhBtGU2k/YBjFK6to4O9XqnS9JaojrsLBrrXlTUb1cQOyOTHcC5PFMuk5q+21 dfwo6A4G3UVJS2JTTtVsyJjb3TzGEOAoBNo7fHB0wEss1HrQWHal1pOhtSYNM1mretXc XCn9R4Atzp58iXvisKZlRx2oV4ChFXEeOsrbXm1drPdCksKs7q1h8oiw9cjZsCfmWWTX GDmg== X-Gm-Message-State: AOAM532zHsOPmbC/2nSQ6wyJmoWHQxeaph6T2/VNS08OE8N2uHmQYYLj GXqNn3VtofA9bwryksZUid3OtwYBL32kcWKO X-Google-Smtp-Source: ABdhPJwPfJAKUipMfl8ecLxkF+zrPRZNAy8yizQ4mbkWBtIpwCycri6IhyNKZV+j76KqMcrfiJ6noQ== X-Received: by 2002:a54:4806:: with SMTP id j6mr8495812oij.66.1627851640439; Sun, 01 Aug 2021 14:00:40 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id s16sm1560707otg.51.2021.08.01.14.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 14:00:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Tom Rini , Alexandru Gagniuc , Simon Glass , Joe Hershberger , Marek Vasut , T Karthik Reddy Subject: [PATCH v3 00/15] image: A partial series for the image clean-up Date: Sun, 1 Aug 2021 15:00:17 -0600 Message-Id: <20210801210032.2203104-1-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Now that the competing image clean-up has landed and the smoke has cleared, we can come back to this one. This series includes about a third of the original patches, mostly the ones that apply cleanly. It does not reduce the #idefs by as much, but it does make some small code improvements. Further patches can be pulled in once these ones have been reviewed and land. Changes in v3: - Pick up only the first part of the original v2 series Changes in v2: - Add a patch to introduce a memdup() function - Add new abuf_init_set() function - Update abuf_realloc() to return after every case - Use const for abuf_data() and abuf_size() - Make use of memdup() - Add abuf_init_move() - Add comments about the assumptions made by lib_test_abuf_realloc() - Add better comments about why some tests are skipped at present - Correct 'hose' typo Simon Glass (15): lib: Add memdup() Add support for an owned buffer compiler: Add a comment to host_build() zstd: Create a function for use from U-Boot btrfs: Use U-Boot API for decompression image: Avoid switch default in image_decomp() image: Update zstd to avoid reporting error twice gzip: Avoid use of u64 image: Update image_decomp() to avoid ifdefs image: Split board code out into its own file image: Fix up checkpatch warnings in image-board.c image: Split host code out into its own file image: Create a function to do manual relocation image: Avoid #ifdefs for manual relocation image: Remove ifdefs around image_setup_linux() el at common/Makefile | 2 +- common/bootm.c | 16 +- common/image-board.c | 939 +++++++++++++++++++++++++++++ common/image-host.c | 27 + common/image-sig.c | 40 +- common/image.c | 1177 +++---------------------------------- configs/sandbox_defconfig | 1 + fs/btrfs/compression.c | 51 +- include/abuf.h | 159 +++++ include/compiler.h | 8 + include/gzip.h | 8 +- include/linux/string.h | 13 + include/linux/zstd.h | 11 + include/relocate.h | 30 +- lib/Makefile | 1 + lib/abuf.c | 109 ++++ lib/gunzip.c | 28 +- lib/string.c | 13 + lib/zstd/Makefile | 2 +- lib/zstd/zstd.c | 64 ++ test/lib/Makefile | 1 + test/lib/abuf.c | 344 +++++++++++ test/lib/string.c | 32 + tools/Makefile | 1 + 24 files changed, 1887 insertions(+), 1190 deletions(-) create mode 100644 common/image-board.c create mode 100644 common/image-host.c create mode 100644 include/abuf.h create mode 100644 lib/abuf.c create mode 100644 lib/zstd/zstd.c create mode 100644 test/lib/abuf.c