From a7d701593ac5ba731b6640b94fd7e120b3168ffd Mon Sep 17 00:00:00 2001 From: emmett1 Date: Sat, 28 Jun 2025 23:29:07 +0800 Subject: busybox: added modinfo patch --- repos/core/busybox/.checksum | 1 + ...6-modinfo-add-k-option-for-kernel-version.patch | 137 +++++++++++++++++++++ repos/core/busybox/abuild | 3 +- 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 repos/core/busybox/0006-modinfo-add-k-option-for-kernel-version.patch diff --git a/repos/core/busybox/.checksum b/repos/core/busybox/.checksum index f52553f8..d6ab8c69 100644 --- a/repos/core/busybox/.checksum +++ b/repos/core/busybox/.checksum @@ -1,4 +1,5 @@ 6499c4a3d5379e4e34e30a84f7ef9ae513b696694a07d1f4fbd9de9a998d0da1 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch +51952a0bbcad4d86d21319ca4ab89424665d66f242bc6eeda78d0180c22bdd5c 0006-modinfo-add-k-option-for-kernel-version.patch 8c364768319aa2f68f480fe1fb4679af38cd692c5e7c66c8e0c2e0e0c7464e4c 0016-ping-make-ping-work-without-root-privileges.patch a7c6c992ca7bed0881b4be27af3d45e10b8f9560a3ee3db6a4e0ceda65f05e30 0031-syslogd-fix-wrong-OPT_locallog-flag-detection.patch 7c40dc84a65c34364ef9de29247cb76f2c2db799ef091b4d980576dd11d7e16d 0034-adduser-remove-preconfigured-GECOS-full-name-field.patch diff --git a/repos/core/busybox/0006-modinfo-add-k-option-for-kernel-version.patch b/repos/core/busybox/0006-modinfo-add-k-option-for-kernel-version.patch new file mode 100644 index 00000000..30f342cf --- /dev/null +++ b/repos/core/busybox/0006-modinfo-add-k-option-for-kernel-version.patch @@ -0,0 +1,137 @@ +From daed0a98b3d116d3fabb51340497273b5b9ce995 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Thu, 28 Apr 2022 23:04:01 +0200 +Subject: [PATCH] modinfo: add -k option for kernel version + +It is useful to be able to specify kernel version when generating +initramfs and similar for a kernel version that might not be the running +one. + +bloatcheck on x86_64: + +function old new delta +packed_usage 26193 26218 +25 +modinfo_main 391 414 +23 +.rodata 80296 80298 +2 +------------------------------------------------------------------------------ +(add/remove: 0/0 grow/shrink: 3/0 up/down: 50/0) Total: 50 +bytes + text data bss dec hex filename + 834606 14124 2008 850738 cfb32 busybox_old + 834657 14124 2008 850789 cfb65 busybox_unstripped + +Signed-off-by: Natanael Copa +--- + modutils/modinfo.c | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/modutils/modinfo.c b/modutils/modinfo.c +index 0a86c3296..53bc02880 100644 +--- a/modutils/modinfo.c ++++ b/modutils/modinfo.c +@@ -38,17 +38,18 @@ static const char *const shortcuts[] ALIGN_PTR = { + + enum { + OPT_0 = (1 << 0), /* \0 as separator */ +- OPT_F = (1 << 1), /* field name */ ++ OPT_k = (1 << 1), /* kernel version */ ++ OPT_F = (1 << 2), /* field name */ + /* first bits are for -nadlp options, the rest are for + * fields not selectable with "shortcut" options + */ +- OPT_n = (1 << 2), +- OPT_TAGS = ((1 << ARRAY_SIZE(shortcuts)) - 1) << 2, ++ OPT_n = (1 << 3), ++ OPT_TAGS = ((1 << ARRAY_SIZE(shortcuts)) - 1) << 3, + }; + + static void display(const char *data, const char *pattern) + { +- int flag = option_mask32 >> 1; /* shift out -0 bit */ ++ int flag = option_mask32 >> 2; /* shift out -0 and -k bits */ + if (flag & (flag-1)) { + /* more than one field to show: print "FIELD:" pfx */ + int n = printf("%s:", pattern); +@@ -82,7 +83,8 @@ static void modinfo(const char *path, const char *version, + } + } + +- for (j = 1; (1<