From ba17d91f7425a8a3e841fb4283533954886efefb Mon Sep 17 00:00:00 2001 From: lxoliva Date: Sun, 24 Oct 2021 19:15:27 +0000 Subject: [PATCH] post-rc6 tweak for 5.15-rc7-gnu, and backports to active branches use tabs in firmware.h backport firmware.h fixes backport mkspec fixes backport snapcraft tweaks backport post-cleanup comments and success message git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@18410 559672b5-ba27-0410-b829-e8f1faed8b1b --- deblob-4.14 | 60 ++++++++++++++++++++++++++++++----------------------- deblob-4.19 | 40 ++++++++++++++++++++++++++++------- deblob-4.4 | 49 +++++++++++++++++++++++-------------------- deblob-4.9 | 49 +++++++++++++++++++++++-------------------- deblob-5.10 | 41 +++++++++++++++++++++++++++++------- deblob-5.14 | 41 +++++++++++++++++++++++++++++------- deblob-5.15 | 2 +- deblob-5.4 | 40 ++++++++++++++++++++++++++++------- 8 files changed, 219 insertions(+), 103 deletions(-) diff --git a/deblob-4.14 b/deblob-4.14 index 3ed82ea902a..10ce6a164da 100755 --- a/deblob-4.14 +++ b/deblob-4.14 @@ -409,7 +409,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -417,18 +417,20 @@ report_missing_free_firmware(const char *name, const char *what)\ {\ printk(KERN_ERR "%s: Missing Free %s (non-Free firmware loading is disabled)\\n", name,\ what ? what : "firmware");\ - return -EINVAL;\ + return -ENOENT;\ }\ static inline int\ reject_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ + retval = retval0;\ + }\ return -EINVAL;\ }\ static inline int\ @@ -445,17 +447,15 @@ reject_firmware_direct(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + if (fw) *fw = xfw;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ - return -EINVAL;\ -}\ -static inline void\ -discard_rejected_firmware(const struct firmware *fw, void *context)\ -{\ - release_firmware(fw);\ + retval = retval0;\ + }\ + return retval;\ }\ static inline int\ reject_firmware_nowait(struct module *module, int uevent,\ @@ -464,14 +464,10 @@ reject_firmware_nowait(struct module *module, int uevent,\ void (*cont)(const struct firmware *fw,\ void *context))\ {\ - int retval;\ report_missing_free_firmware(dev_name(device), NULL);\ - retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ - device, gfp, NULL,\ - discard_rejected_firmware);\ - if (retval)\ - return retval;\ - return -EINVAL;\ + /* We assume NONFREE_FIRMWARE will not be found; how could it? */\ + return request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ + device, gfp, context, cont);\ }\ static inline int\ maybe_reject_firmware_nowait(struct module *module, int uevent,\ @@ -492,12 +488,15 @@ reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ struct device *device, void *buf, size_t size)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ - return -EINVAL;\ + retval = retval0;\ + }\ + return retval;\ }\ static inline int\ maybe_reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ @@ -521,7 +520,7 @@ static inline int\ maybe_reject_ihex_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ - if (strstr (name, NONFREE_FIRMWARE))\ + if (is_nonfree_firmware(name))\ return reject_firmware(fw, name, device);\ else\ return request_ihex_firmware(fw, name, device);\ @@ -3403,6 +3402,15 @@ clean_sed s,usb8388,whatever,g drivers/base/Kconfig 'removed blob name' if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-4.19 b/deblob-4.19 index 58a7deb00d8..91178d0944f 100755 --- a/deblob-4.19 +++ b/deblob-4.19 @@ -437,9 +437,12 @@ clean_sed ' s,git://git\..*torvalds/linux\.git,/*(DEBLOBBED)*/, ' scripts/package/mkdebian 'upstream development repo' -clean_sed ' -s,Name: kernel,&-libre, -' scripts/package/mkspec 'package name' +# The tarball name and its expansion do not include -libre. +# We could change KERNELPATH and keep this, but what else would break? +# Enabling this would require the other commented-out mkspec bits below. +# clean_sed ' +# s,Name: kernel,&-libre, +# ' scripts/package/mkspec 'package name' clean_sed ' s,The Linux,The GNU Linux-libre, @@ -453,13 +456,22 @@ clean_sed ' s,https\?://www\.kernel\.org,https://linux-libre.fsfla.org, ' scripts/package/mkspec 'home page' +# clean_sed ' +# s,\(%description\) -n kernel-,\1 , +# ' scripts/package/mkspec '-libre subpackages' + +# clean_sed ' +# /Provides: kernel-/{p;s,kernel-,&libre-,;} +# ' scripts/package/mkspec '-libre provides' + +# As with rpms, we leave the package name as kernel. clean_sed ' -s,\(%description\) -n kernel-,\1 , -' scripts/package/mkspec '-libre subpackages' +s,The upstream Linux kernel,The GNU Linux-libre kernel, +' scripts/package/snapcraft.template 'description' clean_sed ' -/Provides: kernel-/{p;s,kernel-,&libre-,;} -' scripts/package/mkspec '-libre provides' +s,Linux kernel,GNU Linux-libre, +' scripts/package/snapcraft.template 'summary' # Add reject_firmware and maybe_reject_firmware grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h || @@ -474,7 +486,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -490,6 +502,7 @@ firmware_reject_nowarn(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0 = -ENOENT;\ + if (fw) *fw = xfw;\ retval = firmware_request_nowarn(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ release_firmware(xfw);\ @@ -524,6 +537,7 @@ reject_firmware_direct(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (fw) *fw = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ @@ -564,6 +578,7 @@ reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size);\ if (!retval) {\ @@ -3464,6 +3479,15 @@ clean_sed s,usb8388,whatever,g drivers/base/firmware_loader/Kconfig 'removed blo if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-4.4 b/deblob-4.4 index 7fe38ad5097..be9aea6bec3 100755 --- a/deblob-4.4 +++ b/deblob-4.4 @@ -396,7 +396,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -404,18 +404,20 @@ report_missing_free_firmware(const char *name, const char *what)\ {\ printk(KERN_ERR "%s: Missing Free %s (non-Free firmware loading is disabled)\\n", name,\ what ? what : "firmware");\ - return -EINVAL;\ + return -ENOENT;\ }\ static inline int\ reject_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ + retval = retval0;\ + }\ return -EINVAL;\ }\ static inline int\ @@ -432,17 +434,15 @@ reject_firmware_direct(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + if (fw) *fw = xfw;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ - return -EINVAL;\ -}\ -static inline void\ -discard_rejected_firmware(const struct firmware *fw, void *context)\ -{\ - release_firmware(fw);\ + retval = retval0;\ + }\ + return retval;\ }\ static inline int\ reject_firmware_nowait(struct module *module, int uevent,\ @@ -451,14 +451,10 @@ reject_firmware_nowait(struct module *module, int uevent,\ void (*cont)(const struct firmware *fw,\ void *context))\ {\ - int retval;\ report_missing_free_firmware(dev_name(device), NULL);\ - retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ - device, gfp, NULL,\ - discard_rejected_firmware);\ - if (retval)\ - return retval;\ - return -EINVAL;\ + /* We assume NONFREE_FIRMWARE will not be found; how could it? */\ + return request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ + device, gfp, context, cont);\ }\ static inline int\ maybe_reject_firmware_nowait(struct module *module, int uevent,\ @@ -487,7 +483,7 @@ static inline int\ maybe_reject_ihex_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ - if (strstr (name, NONFREE_FIRMWARE))\ + if (is_nonfree_firmware(name))\ return reject_firmware(fw, name, device);\ else\ return request_ihex_firmware(fw, name, device);\ @@ -3211,6 +3207,15 @@ clean_blob firmware/WHENCE if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-4.9 b/deblob-4.9 index 0191a238422..247752fad58 100755 --- a/deblob-4.9 +++ b/deblob-4.9 @@ -395,7 +395,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -403,18 +403,20 @@ report_missing_free_firmware(const char *name, const char *what)\ {\ printk(KERN_ERR "%s: Missing Free %s (non-Free firmware loading is disabled)\\n", name,\ what ? what : "firmware");\ - return -EINVAL;\ + return -ENOENT;\ }\ static inline int\ reject_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ + retval = retval0;\ + }\ return -EINVAL;\ }\ static inline int\ @@ -431,17 +433,15 @@ reject_firmware_direct(const struct firmware **fw,\ const char *name, struct device *device)\ {\ const struct firmware *xfw = NULL;\ - int retval;\ - report_missing_free_firmware(dev_name(device), NULL);\ + int retval, retval0;\ + if (fw) *fw = xfw;\ + retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ - if (!retval)\ + if (!retval) {\ release_firmware(xfw);\ - return -EINVAL;\ -}\ -static inline void\ -discard_rejected_firmware(const struct firmware *fw, void *context)\ -{\ - release_firmware(fw);\ + retval = retval0;\ + }\ + return retval;\ }\ static inline int\ reject_firmware_nowait(struct module *module, int uevent,\ @@ -450,14 +450,10 @@ reject_firmware_nowait(struct module *module, int uevent,\ void (*cont)(const struct firmware *fw,\ void *context))\ {\ - int retval;\ report_missing_free_firmware(dev_name(device), NULL);\ - retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ - device, gfp, NULL,\ - discard_rejected_firmware);\ - if (retval)\ - return retval;\ - return -EINVAL;\ + /* We assume NONFREE_FIRMWARE will not be found; how could it? */\ + return request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\ + device, gfp, context, cont);\ }\ static inline int\ maybe_reject_firmware_nowait(struct module *module, int uevent,\ @@ -486,7 +482,7 @@ static inline int\ maybe_reject_ihex_firmware(const struct firmware **fw,\ const char *name, struct device *device)\ {\ - if (strstr (name, NONFREE_FIRMWARE))\ + if (is_nonfree_firmware(name))\ return reject_firmware(fw, name, device);\ else\ return request_ihex_firmware(fw, name, device);\ @@ -3383,6 +3379,15 @@ clean_blob firmware/WHENCE if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-5.10 b/deblob-5.10 index 48dc99acf62..a099ab30348 100755 --- a/deblob-5.10 +++ b/deblob-5.10 @@ -416,9 +416,12 @@ clean_sed ' s,git://git\..*torvalds/linux\.git,/*(DEBLOBBED)*/, ' scripts/package/mkdebian 'upstream development repo' -clean_sed ' -s,Name: kernel,&-libre, -' scripts/package/mkspec 'package name' +# The tarball name and its expansion do not include -libre. +# We could change KERNELPATH and keep this, but what else would break? +# Enabling this would require the other commented-out mkspec bits below. +# clean_sed ' +# s,Name: kernel,&-libre, +# ' scripts/package/mkspec 'package name' clean_sed ' s,The Linux,The GNU Linux-libre, @@ -432,13 +435,22 @@ clean_sed ' s,https\?://www\.kernel\.org,https://linux-libre.fsfla.org, ' scripts/package/mkspec 'home page' +# clean_sed ' +# s,\(%description\) -n kernel-,\1 , +# ' scripts/package/mkspec '-libre subpackages' + +# clean_sed ' +# /Provides: kernel-/{p;s,kernel-,&libre-,;} +# ' scripts/package/mkspec '-libre provides' + +# As with rpms, we leave the package name as kernel. clean_sed ' -s,\(%description\) -n kernel-,\1 , -' scripts/package/mkspec '-libre subpackages' +s,The upstream Linux kernel,The GNU Linux-libre kernel, +' scripts/package/snapcraft.template 'description' clean_sed ' -/Provides: kernel-/{p;s,kernel-,&libre-,;} -' scripts/package/mkspec '-libre provides' +s,Linux kernel,GNU Linux-libre, +' scripts/package/snapcraft.template 'summary' # Add reject_firmware and maybe_reject_firmware grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h || @@ -453,7 +465,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -469,6 +481,7 @@ firmware_reject_nowarn(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0 = -ENOENT;\ + if (fw) *fw = xfw;\ retval = firmware_request_nowarn(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ release_firmware(xfw);\ @@ -503,6 +516,7 @@ reject_firmware_direct(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (fw) *fw = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ @@ -543,6 +557,7 @@ reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size);\ if (!retval) {\ @@ -566,6 +581,7 @@ reject_partial_firmware_into_buf(const struct firmware **firmware_p, const char {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_partial_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size, offset);\ if (!retval) {\ @@ -3822,6 +3838,15 @@ clean_sed s,usb8388,whatever,g drivers/base/firmware_loader/Kconfig 'removed blo if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-5.14 b/deblob-5.14 index 1fca79b1ce8..69dc56020a2 100755 --- a/deblob-5.14 +++ b/deblob-5.14 @@ -416,9 +416,12 @@ clean_sed ' s,git://git\..*torvalds/linux\.git,/*(DEBLOBBED)*/, ' scripts/package/mkdebian 'upstream development repo' -clean_sed ' -s,Name: kernel,&-libre, -' scripts/package/mkspec 'package name' +# The tarball name and its expansion do not include -libre. +# We could change KERNELPATH and keep this, but what else would break? +# Enabling this would require the other commented-out mkspec bits below. +# clean_sed ' +# s,Name: kernel,&-libre, +# ' scripts/package/mkspec 'package name' clean_sed ' s,The Linux,The GNU Linux-libre, @@ -432,13 +435,22 @@ clean_sed ' s,https\?://www\.kernel\.org,https://linux-libre.fsfla.org, ' scripts/package/mkspec 'home page' +# clean_sed ' +# s,\(%description\) -n kernel-,\1 , +# ' scripts/package/mkspec '-libre subpackages' + +# clean_sed ' +# /Provides: kernel-/{p;s,kernel-,&libre-,;} +# ' scripts/package/mkspec '-libre provides' + +# As with rpms, we leave the package name as kernel. clean_sed ' -s,\(%description\) -n kernel-,\1 , -' scripts/package/mkspec '-libre subpackages' +s,The upstream Linux kernel,The GNU Linux-libre kernel, +' scripts/package/snapcraft.template 'description' clean_sed ' -/Provides: kernel-/{p;s,kernel-,&libre-,;} -' scripts/package/mkspec '-libre provides' +s,Linux kernel,GNU Linux-libre, +' scripts/package/snapcraft.template 'summary' clean_sed ' s,linux-upstream,linux-libre, @@ -457,7 +469,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -473,6 +485,7 @@ firmware_reject_nowarn(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0 = -ENOENT;\ + if (fw) *fw = xfw;\ retval = firmware_request_nowarn(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ release_firmware(xfw);\ @@ -507,6 +520,7 @@ reject_firmware_direct(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (fw) *fw = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ @@ -547,6 +561,7 @@ reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size);\ if (!retval) {\ @@ -570,6 +585,7 @@ reject_partial_firmware_into_buf(const struct firmware **firmware_p, const char {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_partial_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size, offset);\ if (!retval) {\ @@ -3885,6 +3901,15 @@ clean_sed s,usb8388,whatever,g drivers/base/firmware_loader/Kconfig 'removed blo if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 diff --git a/deblob-5.15 b/deblob-5.15 index b460e5a6bd6..a398ea0166e 100755 --- a/deblob-5.15 +++ b/deblob-5.15 @@ -476,7 +476,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ diff --git a/deblob-5.4 b/deblob-5.4 index 15e10fb2ee8..0dafdd22daa 100755 --- a/deblob-5.4 +++ b/deblob-5.4 @@ -407,9 +407,12 @@ clean_sed ' s,git://git\..*torvalds/linux\.git,/*(DEBLOBBED)*/, ' scripts/package/mkdebian 'upstream development repo' -clean_sed ' -s,Name: kernel,&-libre, -' scripts/package/mkspec 'package name' +# The tarball name and its expansion do not include -libre. +# We could change KERNELPATH and keep this, but what else would break? +# Enabling this would require the other commented-out mkspec bits below. +# clean_sed ' +# s,Name: kernel,&-libre, +# ' scripts/package/mkspec 'package name' clean_sed ' s,The Linux,The GNU Linux-libre, @@ -423,13 +426,22 @@ clean_sed ' s,https\?://www\.kernel\.org,https://linux-libre.fsfla.org, ' scripts/package/mkspec 'home page' +# clean_sed ' +# s,\(%description\) -n kernel-,\1 , +# ' scripts/package/mkspec '-libre subpackages' + +# clean_sed ' +# /Provides: kernel-/{p;s,kernel-,&libre-,;} +# ' scripts/package/mkspec '-libre provides' + +# As with rpms, we leave the package name as kernel. clean_sed ' -s,\(%description\) -n kernel-,\1 , -' scripts/package/mkspec '-libre subpackages' +s,The upstream Linux kernel,The GNU Linux-libre kernel, +' scripts/package/snapcraft.template 'description' clean_sed ' -/Provides: kernel-/{p;s,kernel-,&libre-,;} -' scripts/package/mkspec '-libre provides' +s,Linux kernel,GNU Linux-libre, +' scripts/package/snapcraft.template 'summary' # Add reject_firmware and maybe_reject_firmware grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h || @@ -444,7 +456,7 @@ clean_sed '$i\ static inline int\ is_nonfree_firmware(const char *name)\ {\ - return strstr(name, NONFREE_FIRMWARE) != 0;\ + return strstr(name, NONFREE_FIRMWARE) != 0;\ }\ \ static inline int\ @@ -460,6 +472,7 @@ firmware_reject_nowarn(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0 = -ENOENT;\ + if (fw) *fw = xfw;\ retval = firmware_request_nowarn(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ release_firmware(xfw);\ @@ -494,6 +507,7 @@ reject_firmware_direct(const struct firmware **fw,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (fw) *fw = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_direct(&xfw, NONFREE_FIRMWARE, device);\ if (!retval) {\ @@ -534,6 +548,7 @@ reject_firmware_into_buf(const struct firmware **firmware_p, const char *name,\ {\ const struct firmware *xfw = NULL;\ int retval, retval0;\ + if (firmware_p) *firmware_p = xfw;\ retval0 = report_missing_free_firmware(dev_name(device), NULL);\ retval = request_firmware_into_buf(&xfw, NONFREE_FIRMWARE, device, buf, size);\ if (!retval) {\ @@ -3580,6 +3595,15 @@ clean_sed s,usb8388,whatever,g drivers/base/firmware_loader/Kconfig 'removed blo if $errors; then echo errors above were ignored because of --force >&2 +else + echo cleaning up has completed successfully, without verification >&2 + # Verification is largely manual, comparing the changes with + # those of a previous known (presumed) good version, e.g. + # git merge the previous known good version onto the current base + # version, and then git diff with this cleaned-up version. + # Creating a tarball of this version, named linux-*.*.tar, + # and running deblob-check on it may also help catch cleaning-up + # errors: .../deblob-check --use-awk -B linux-*.*.tar. fi exit 0 -- 2.31.1