From patchwork Thu Dec 3 11:13:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Tyagi X-Patchwork-Id: 107167 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.11867.1796296680162084949 for ; Thu, 03 Dec 2026 03:18:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=EOnRnAb/; spf=pass (domain: gmail.com, ip: 209.85.216.41, mailfrom: ankur.tyagi85@gmail.com) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-3ac78f4c10bso6200022a91.1 for ; Thu, 03 Dec 2026 03:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796296679; x=1796901479; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6KoKulw6fZy6PUtXIP2H5I6yi/DVhD/hvaKjjO1qovU=; b=EOnRnAb/AaWyddRuaZ0WZlyTbNssiIsSqX5qk9hN+0b/7ViXFEN5ZUqRwLUyyZWPhr i4WOycyD4tsJftsYt8ZxDeaQxm2Ir0vPviA6c2lRXFJY/rluf2ZIbJO5/Ra5RU1wyQIM DDLghBkEqRjiGJ66qMMM8OM3SGSaSWzNrQKBQvuOHipISU8XnWxQli+ET1wjT4GK7KqD NafAvqfpSrEGHlDHzCNU/trQz6bjdZTPKHfhRiWt4nbzwb8kCQ0iFq40ihBpef6Gci8z 0oLvUwP39wG1NrqJmRzu7Oug/y1knh+B6uBczF+wkMhE9drgNaYl51m3S+YJxpBDs4Pc io5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796296679; x=1796901479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6KoKulw6fZy6PUtXIP2H5I6yi/DVhD/hvaKjjO1qovU=; b=Qbx2aAdcZYhbxqTw2Cn0bEiQB1+cMbLoHWJxHEbEK4b8d8tL77Xfw+O2XUSJaNooOc Z2XfHfNNHSstJmxE97p1/JWbJSUlY90WkedcyPPKki17GnxSIHbpQldWwGjVzsWzflxo XTM4cE1M7oxMAWqBrVASMP34kPnzu/vdB3MTMtS4tyUbcfYZ0IzbvjOjNv7O5OWry3mz jFcU5z/aB7fknVK2IXThWOFBRLBnooZ1/4VOCkKMQQwxy8qTZOH0l4u/Pvl1QI3pSUFR syOhzMGxpCA/s71vTeKGJD2cPrvJU2X90+/Y2io5SQbjWHRRz1DuayI2dbAXLCU2OZj8 kNig== X-Gm-Message-State: APuU4Z8iJ8bdEaDOnyedVBE4QDoXCKW00eR/Vd5i3l3cbRr0SWQaJQm0 qFdLO9PeTuVyUw6yr0MM44maCTgy4ETh8Ewco/nrEuC6yJXxrRaeIJr9K8eqGn4n X-Gm-Gg: AZFdTZcrqF29sP0kzeH/H1BWyYSF6FP0ldH97E6uEIvGCsOGK1UO8nH4of6gQtPvpZe DtCCOJT95J3Imhmve+NjNnBcIFyUHHLN5q9QIeju6T3a+OL9yfJqHzc04HKT+LOBQZngn2EVqzy GdG7kOb7eTnoS823UHUFXR7NA/mzO2FeT4nmKNVD3hSDjNpsyLoBN+sfOG8cHt2C4uNDv14BBuJ jGNPoOpAoC/N06vyLtFa3tEzdJOLy0/RJHMeFbdgQIs7alTtNINUYMgc0hG/niqfoqqnND/7Li8 Fs9g389xXRckDy7TWiSSrgKuRuRpfxAXtgG5JtkA8Za+mQ8XH0RgcgX7+IYt1OYTjrh45w20N3g 4l9nARrSgL6NE/+lSnaDJp4Xm5i/BxM8rw9HKL6PPxBYas1eHJIyoiZWmVfTSnXUz8Lq2s1HL66 vn+CHPPbuZ9yyUx1OoLssb2lkewNLGyux0ukYhyDolJ91ToYqzjzh98LRcVcSBy3Z9FetqOoUYc GFMN6rS6ukfEGB96fY7MpQ1JnZv/MmAkeDeQekfHg5zoyuia7feP+xQGAr/bksNMOweOwG0I3Bv XoXw0x8P443aerrRxu52OtPX5R66RBiWPXP71brAWpXb2uM9LhM8k2utMx04Jf9zmsa9LxuY4CU uBwyW4zcLohbAhuBkgf3+Pg== X-Received: by 2002:a17:90b:3d50:b0:3b4:d312:8fb4 with SMTP id 98e67ed59e1d1-3b4d31292ebmr33553902a91.43.1796296679460; Thu, 03 Dec 2026 03:17:59 -0800 (PST) Return-Path: Received: from NVAPF55DW0D-IPD.. ([147.161.219.8]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65b94sm3890436a91.12.2026.12.03.03.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 03:17:59 -0800 (PST) From: ankur.tyagi85@gmail.com To: openembedded-devel@lists.openembedded.org Cc: Ankur Tyagi , Khem Raj Subject: [oe][meta-oe][blacksail][PATCH 69/95] bmap-writer: upgrade 1.0.5 -> 1.0.6 Date: Fri, 4 Dec 2026 00:13:40 +1300 Message-ID: <20261203111406.4182597-69-ankur.tyagi85@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261203111406.4182597-1-ankur.tyagi85@gmail.com> References: <20261203111406.4182597-1-ankur.tyagi85@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 11:18:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133959 From: Ankur Tyagi Dropped patches that are part of upstream version. Signed-off-by: Ankur Tyagi Signed-off-by: Khem Raj (cherry picked from commit 17148812fd02cb4f2e7845b62bb049cfad325e2a) Signed-off-by: Ankur Tyagi --- ...p-writer_1.0.5.bb => bmap-writer_1.0.6.bb} | 4 +- ...-Honour-ImageSize-for-the-last-block.patch | 85 ------------------- ...-library-s-ioctl-request-type-for-BL.patch | 50 ----------- 3 files changed, 1 insertion(+), 138 deletions(-) rename meta-oe/recipes-support/bmap-writer/{bmap-writer_1.0.5.bb => bmap-writer_1.0.6.bb} (80%) delete mode 100644 meta-oe/recipes-support/bmap-writer/files/0001-Honour-ImageSize-for-the-last-block.patch delete mode 100644 meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch diff --git a/meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.5.bb b/meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.6.bb similarity index 80% rename from meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.5.bb rename to meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.6.bb index 3aefaa436f..a11fc7ec75 100644 --- a/meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.5.bb +++ b/meta-oe/recipes-support/bmap-writer/bmap-writer_1.0.6.bb @@ -9,10 +9,8 @@ LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=e49f4652534af377a713df3d9dec60cb" SRC_URI = "git://github.com/embetrix/${BPN};branch=master;protocol=https;tag=${PV} \ - file://0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch \ - file://0001-Honour-ImageSize-for-the-last-block.patch \ " -SRCREV = "c7b1bec0f40217d17e315226552e461a4a816abc" +SRCREV = "7662aad2fba224530c45afd511db9146dcb48ccf" DEPENDS = "libtinyxml2 libarchive" inherit cmake pkgconfig diff --git a/meta-oe/recipes-support/bmap-writer/files/0001-Honour-ImageSize-for-the-last-block.patch b/meta-oe/recipes-support/bmap-writer/files/0001-Honour-ImageSize-for-the-last-block.patch deleted file mode 100644 index 1943256d71..0000000000 --- a/meta-oe/recipes-support/bmap-writer/files/0001-Honour-ImageSize-for-the-last-block.patch +++ /dev/null @@ -1,85 +0,0 @@ -From e63a11dedcdece8b9b285485a86405fd258b37d8 Mon Sep 17 00:00:00 2001 -From: Markus Volk -Date: Tue, 29 Sep 2026 17:29:52 +0200 -Subject: [PATCH] Honour ImageSize for the last block - -bmaptool records the exact image size in ImageSize, and the last block -of an image whose size is not a multiple of BlockSize is only partly -filled. Writing and verifying used (endBlock + 1) * BlockSize as the end -of every range, so the range containing that block asked for more bytes -than the image has and the write failed with "Image ended before the -block map did". Read ImageSize and clamp the end of each range to it. - -AI-Generated: Uses Claude Code (Claude Fable 5.1) -Upstream-Status: Pending ---- - src/bmap.cpp | 5 +++++ - src/bmap.h | 1 + - src/image_writer.cpp | 2 +- - src/main.cpp | 2 +- - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/src/bmap.cpp b/src/bmap.cpp -index fabf2c2..0162ac0 100644 ---- a/src/bmap.cpp -+++ b/src/bmap.cpp -@@ -135,6 +135,7 @@ int parseBMap(const std::string &filename, bmap_t& bmapData) { - bmapData.bmapVersion = (version != nullptr) ? trimWhitespace(version) : "unknown"; - - // Parse image information -+ bmapData.imageSize = requireChildUnsigned(p_root, "ImageSize"); - bmapData.blocksTotal = requireChildUnsigned(p_root, "BlocksCount"); - bmapData.blocksMapped = requireChildUnsigned(p_root, "MappedBlocksCount"); - bmapData.blockSize = requireChildUnsigned(p_root, "BlockSize"); -@@ -200,6 +201,10 @@ int validateBmap(const bmap_t& bmap, uint64_t deviceSize) { - if (bmap.blocksTotal == 0) { - throw BmapError("BMAP: BlocksCount must not be zero"); - } -+ if (bmap.imageSize > bmap.blocksTotal * bmap.blockSize || -+ bmap.imageSize <= (bmap.blocksTotal - 1) * bmap.blockSize) { -+ throw BmapError("BMAP: ImageSize does not match BlocksCount and BlockSize"); -+ } - if (bmap.blocksMapped > bmap.blocksTotal) { - throw BmapError("BMAP: MappedBlocksCount exceeds BlocksCount"); - } -diff --git a/src/bmap.h b/src/bmap.h -index cf6ff9d..98cb969 100644 ---- a/src/bmap.h -+++ b/src/bmap.h -@@ -38,6 +38,7 @@ struct bmap_t { - std::string checksumType; - size_t blockSize = 0; - size_t blocksTotal = 0; -+ size_t imageSize = 0; - size_t blocksMapped = 0; - std::string bmapVersion; - std::string bmapChecksum; -diff --git a/src/image_writer.cpp b/src/image_writer.cpp -index bb802ea..f864151 100644 ---- a/src/image_writer.cpp -+++ b/src/image_writer.cpp -@@ -177,7 +177,7 @@ int BmapWriteImage(int fd, const bmap_t &bmap, int dev_fd, const std::string &de - for (const auto &range : bmap.ranges) { - // validateBmap() has already proven that none of this can overflow. - const size_t outStart = range.startBlock * bmap.blockSize; -- const size_t outEnd = (range.endBlock + 1) * bmap.blockSize; -+ const size_t outEnd = std::min((range.endBlock + 1) * bmap.blockSize, bmap.imageSize); - const size_t rangeSize = outEnd - outStart; - const off_t writeOffset = static_cast(outStart); - size_t writtenSize = 0; -diff --git a/src/main.cpp b/src/main.cpp -index ca42c12..b8cbbc5 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) { - FdGuard imageGuard(image_fd); - - std::cout << "BMAP format version: " << bmap.bmapVersion << std::endl; -- std::cout << "Image size: " << (bmap.blocksTotal * bmap.blockSize) << " bytes" << std::endl; -+ std::cout << "Image size: " << bmap.imageSize << " bytes" << std::endl; - std::cout << "Block size: " << bmap.blockSize << " bytes" << std::endl; - std::cout << "Mapped blocks: " << bmap.blocksMapped << " out of " << bmap.blocksTotal - << " (" << std::fixed << std::setprecision(1) --- -2.55.0 - diff --git a/meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch b/meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch deleted file mode 100644 index 236ff7d1ef..0000000000 --- a/meta-oe/recipes-support/bmap-writer/files/0001-device-Use-the-C-library-s-ioctl-request-type-for-BL.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 7b96cb4998714bbb338adecafad8614484feb8cd Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 29 Sep 2026 12:56:53 -0700 -Subject: [PATCH] device: Use the C library's ioctl request type for - BLKGETSIZE64 - -The type of ioctl()'s request argument differs between C libraries: -glibc declares it as unsigned long, musl and bionic as int. BLKGETSIZE64 -is an unsigned long constant, so with -Wconversion -Wsign-conversion --Werror passing it directly fails on musl, while casting it to int fails -on glibc: - - device.cpp:163:50: error: unsigned conversion from 'int' to 'long unsigned int' changes value from '-2146954638' to '18446744071562596978' [-Werror=sign-conversion] - -Deduce the request type from the ioctl() declaration and convert the -request code to it explicitly, which builds on both. - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - src/device.cpp | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/device.cpp b/src/device.cpp -index 2c06c84..d1fa995 100644 ---- a/src/device.cpp -+++ b/src/device.cpp -@@ -151,6 +151,13 @@ int openTargetDevice(const std::string& device) { - return fd; - } - -+// The type of ioctl()'s request argument depends on the C library: glibc -+// uses unsigned long, musl and bionic use int. Deduce it from the -+// declaration so request codes can be converted explicitly on all of them. -+template -+static Request ioctlRequestType(int (*)(int, Request, ...)); -+using ioctl_request_t = decltype(ioctlRequestType(&::ioctl)); -+ - // Capacity of the target in bytes, or 0 when it cannot be determined (a - // regular file which simply grows as needed). - uint64_t getDeviceSize(int fd) { -@@ -160,7 +167,7 @@ uint64_t getDeviceSize(int fd) { - if (::fstat(fd, &statbuf) != 0) { - return 0; - } -- if (S_ISBLK(statbuf.st_mode) && (::ioctl(fd, BLKGETSIZE64, &size) != 0)) { -+ if (S_ISBLK(statbuf.st_mode) && (::ioctl(fd, static_cast(BLKGETSIZE64), &size) != 0)) { - return 0; - } -