static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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\
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,\
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,\
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,\
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);\
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
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,
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 ||
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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);\
{\
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) {\
{\
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) {\
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
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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\
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,\
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,\
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);\
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
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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\
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,\
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,\
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);\
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
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,
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 ||
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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);\
{\
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) {\
{\
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) {\
{\
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) {\
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
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,
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,
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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);\
{\
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) {\
{\
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) {\
{\
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) {\
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
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
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,
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 ||
static inline int\
is_nonfree_firmware(const char *name)\
{\
- return strstr(name, NONFREE_FIRMWARE) != 0;\
+ return strstr(name, NONFREE_FIRMWARE) != 0;\
}\
\
static inline int\
{\
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);\
{\
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) {\
{\
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) {\
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