Mailing List Archive

[PATCH] kernel-install.eclass: explicitly set kernel image to 644
Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Sun Feb 11 10:41:32 2024 +0100

kernel-install.eclass: explicitly set kernel image to 644

The kernel build system sets the permissions on the kernel
image to 644. However objcopy creates a file with permissions
755. This causes a discrepancy in the permissions on the
installed kernel image between +generic-uki,-generic-uki and
between gentoo-kernel, gentoo-kernel-bin.

Restore the symmetry by explicitly setting the objcopy'ed
files permissions to 644.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 47865a953389..f512d815fe09 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -621,6 +621,7 @@ kernel-install_extract_from_uki() {

$(tc-getOBJCOPY) -O binary "-j.${extract_type}" "${uki}" "${out}" ||
die "Failed to extract ${extract_type}"
+ chmod 644 "${out}" || die
}

# @FUNCTION: kernel-install_install_all
Re: [PATCH] kernel-install.eclass: explicitly set kernel image to 644 [ In reply to ]
Andrew Ammerlaan <andrewammerlaan@gentoo.org> writes:

> Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
> Date: Sun Feb 11 10:41:32 2024 +0100
>

Did you not use git-send-email here or what's going on?

Formatting looks off.

> kernel-install.eclass: explicitly set kernel image to 644
>
> The kernel build system sets the permissions on the kernel
> image to 644. However objcopy creates a file with permissions
> 755. This causes a discrepancy in the permissions on the
> installed kernel image between +generic-uki,-generic-uki and
> between gentoo-kernel, gentoo-kernel-bin.
>
> Restore the symmetry by explicitly setting the objcopy'ed
> files permissions to 644.
>

Anyway, OK.

> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
>
> diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
> index 47865a953389..f512d815fe09 100644
> --- a/eclass/kernel-install.eclass
> +++ b/eclass/kernel-install.eclass
> @@ -621,6 +621,7 @@ kernel-install_extract_from_uki() {
>
> $(tc-getOBJCOPY) -O binary "-j.${extract_type}" "${uki}" "${out}" ||
> die "Failed to extract ${extract_type}"
> + chmod 644 "${out}" || die
> }
>
> # @FUNCTION: kernel-install_install_all
Re: [PATCH] kernel-install.eclass: explicitly set kernel image to 644 [ In reply to ]
On 11/02/2024 10:55, Sam James wrote:
>
> Andrew Ammerlaan <andrewammerlaan@gentoo.org> writes:
>
>> Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
>> Date: Sun Feb 11 10:41:32 2024 +0100
>>
>
> Did you not use git-send-email here or what's going on?
>
> Formatting looks off.
>

I was lazy and copy-pasted from 'git log -p'. I do not have
git-send-email setup on this machine (yet).

Best regards,
Andrew