diff options
| author | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-06-28 23:29:07 +0800 |
|---|---|---|
| committer | emmett1 <emmett1.2miligrams@protonmail.com> | 2025-06-28 23:29:07 +0800 |
| commit | a7d701593ac5ba731b6640b94fd7e120b3168ffd (patch) | |
| tree | bfc6f65d78a3cca91dd01f87e4f8cf6b281014ba /repos/core | |
| parent | 42e9b6f16adbad1b4dd239ab804cfbb702cfb5b5 (diff) | |
| download | alicelinux-a7d701593ac5ba731b6640b94fd7e120b3168ffd.tar.gz alicelinux-a7d701593ac5ba731b6640b94fd7e120b3168ffd.zip | |
busybox: added modinfo patch
Diffstat (limited to 'repos/core')
| -rw-r--r-- | repos/core/busybox/.checksum | 1 | ||||
| -rw-r--r-- | repos/core/busybox/0006-modinfo-add-k-option-for-kernel-version.patch | 137 | ||||
| -rw-r--r-- | repos/core/busybox/abuild | 3 |
3 files changed, 140 insertions, 1 deletions
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 <ncopa@alpinelinux.org> +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 <ncopa@alpinelinux.org> +--- + 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<<j) & (OPT_TAGS|OPT_F); j++) { ++ /* skip initial -0 and -k option bits */ ++ for (j = 2; (1<<j) & (OPT_TAGS|OPT_F); j++) { + const char *pattern; + + if (!((1<<j) & tags)) +@@ -90,7 +92,7 @@ static void modinfo(const char *path, const char *version, + + pattern = field; + if ((1<<j) & OPT_TAGS) +- pattern = shortcuts[j-2]; ++ pattern = shortcuts[j-3]; + + if (strcmp(pattern, shortcuts[0]) == 0) { + /* "-n" or "-F filename" */ +@@ -123,7 +125,7 @@ static void modinfo(const char *path, const char *version, + } + + //usage:#define modinfo_trivial_usage +-//usage: "[-adlpn0] [-F keyword] MODULE" ++//usage: "[-adlpn0] [-F keyword] [-k kernel] MODULE" + //usage:#define modinfo_full_usage "\n\n" + //usage: " -a Shortcut for '-F author'" + //usage: "\n -d Shortcut for '-F description'" +@@ -131,6 +133,7 @@ static void modinfo(const char *path, const char *version, + //usage: "\n -p Shortcut for '-F parm'" + ////usage: "\n -n Shortcut for '-F filename'" + //usage: "\n -F keyword Keyword to look for" ++//usage: "\n -k kernel kernel version" + //usage: "\n -0 NUL terminated output" + //usage:#define modinfo_example_usage + //usage: "$ modinfo -F vermagic loop\n" +@@ -139,6 +142,7 @@ int modinfo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int modinfo_main(int argc UNUSED_PARAM, char **argv) + { + const char *field; ++ const char *kernel; + char name[MODULE_NAME_LEN]; + struct utsname uts; + parser_t *parser; +@@ -147,15 +151,17 @@ int modinfo_main(int argc UNUSED_PARAM, char **argv) + unsigned i; + + field = NULL; +- opts = getopt32(argv, "^" "0F:nadlp" "\0" "-1"/*minimum one arg*/, &field); ++ uname(&uts); ++ kernel = uts.release; ++ opts = getopt32(argv, "^" "0k:F:nadlp" "\0" "-1"/*minimum one arg*/, &kernel, &field); + /* If no field selected, show all */ + if (!(opts & (OPT_TAGS|OPT_F))) + option_mask32 |= OPT_TAGS; ++ + argv += optind; + +- uname(&uts); + parser = config_open2( +- xasprintf("%s/%s/%s", CONFIG_DEFAULT_MODULES_DIR, uts.release, CONFIG_DEFAULT_DEPMOD_FILE), ++ xasprintf("%s/%s/%s", CONFIG_DEFAULT_MODULES_DIR, kernel, CONFIG_DEFAULT_DEPMOD_FILE), + xfopen_for_read + ); + +@@ -167,7 +173,7 @@ int modinfo_main(int argc UNUSED_PARAM, char **argv) + filename2modname(bb_basename(tokens[0]), name); + for (i = 0; argv[i]; i++) { + if (fnmatch(argv[i], name, 0) == 0) { +- modinfo(tokens[0], uts.release, field); ++ modinfo(tokens[0], kernel, field); + argv[i] = (char *) ""; + } + } +@@ -177,7 +183,7 @@ int modinfo_main(int argc UNUSED_PARAM, char **argv) + + for (i = 0; argv[i]; i++) { + if (argv[i][0]) { +- modinfo(argv[i], uts.release, field); ++ modinfo(argv[i], kernel, field); + } + } + diff --git a/repos/core/busybox/abuild b/repos/core/busybox/abuild index ac9c1b56..2b177b61 100644 --- a/repos/core/busybox/abuild +++ b/repos/core/busybox/abuild @@ -1,9 +1,10 @@ name=busybox version=1.37.0 -release=2 +release=3 source="https://${name}.net/downloads/${name}-${version}.tar.bz2 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch 0016-ping-make-ping-work-without-root-privileges.patch + 0006-modinfo-add-k-option-for-kernel-version.patch 0031-syslogd-fix-wrong-OPT_locallog-flag-detection.patch 0034-adduser-remove-preconfigured-GECOS-full-name-field.patch kernel-6.8-tca.patch |