Skip to content

Commit

Permalink
Merge pull request #2223 from bcressey/boot-perms
Browse files Browse the repository at this point in the history
adjust permissions for /boot and System.map
  • Loading branch information
bcressey authored Jun 20, 2022
2 parents f81dfac + e8faa4b commit 4ea71e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/kernel-5.10/kernel-5.10.spec
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ make -s\\\
install -d %{buildroot}/boot
install -T -m 0755 arch/%{_cross_karch}/boot/%{_cross_kimage} %{buildroot}/boot/vmlinuz
install -m 0644 .config %{buildroot}/boot/config
install -m 0644 System.map %{buildroot}/boot/System.map

find %{buildroot}%{_cross_prefix} \
\( -name .install -o -name .check -o \
Expand Down Expand Up @@ -147,6 +146,9 @@ sed -i \
-e 's,$(CONFIG_SYSTEM_TRUSTED_KEYRING),n,g' \
scripts/Makefile

# Restrict permissions on System.map.
chmod 600 System.map

(
find * \
-type f \
Expand Down Expand Up @@ -226,7 +228,6 @@ ln -sf %{_usrsrc}/kernels/%{version} %{buildroot}%{kernel_libdir}/source
%{_cross_attribution_file}
/boot/vmlinuz
/boot/config
/boot/System.map

%files modules
%dir %{_cross_libdir}/modules
Expand Down
5 changes: 3 additions & 2 deletions packages/kernel-5.4/kernel-5.4.spec
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ make -s\\\
install -d %{buildroot}/boot
install -T -m 0755 arch/%{_cross_karch}/boot/%{_cross_kimage} %{buildroot}/boot/vmlinuz
install -m 0644 .config %{buildroot}/boot/config
install -m 0644 System.map %{buildroot}/boot/System.map

find %{buildroot}%{_cross_prefix} \
\( -name .install -o -name .check -o \
Expand Down Expand Up @@ -154,6 +153,9 @@ sed -i \
-e 's,$(CONFIG_SYSTEM_TRUSTED_KEYRING),n,g' \
scripts/Makefile

# Restrict permissions on System.map.
chmod 600 System.map

(
find * \
-type f \
Expand Down Expand Up @@ -231,7 +233,6 @@ ln -sf %{_usrsrc}/kernels/%{version} %{buildroot}%{kernel_libdir}/source
%{_cross_attribution_file}
/boot/vmlinuz
/boot/config
/boot/System.map

%files modules
%dir %{_cross_libdir}/modules
Expand Down
1 change: 1 addition & 0 deletions tools/rpm2img
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ EOF

# BOTTLEROCKET-BOOT-A
mkdir -p "${BOOT_MOUNT}/lost+found"
chmod -R go-rwx "${BOOT_MOUNT}"
BOOT_LABELS=$(setfiles -n -d -F -m -r "${BOOT_MOUNT}" \
"${SELINUX_FILE_CONTEXTS}" "${BOOT_MOUNT}" \
| awk -v root="${BOOT_MOUNT}" '{gsub(root"/","/"); gsub(root,"/"); print "ea_set", $1, "security.selinux", $4}')
Expand Down

0 comments on commit 4ea71e2

Please sign in to comment.