-
Notifications
You must be signed in to change notification settings - Fork 78
Draft: [dhd] Allow bundling keys into kernel and bootloader. JB#54649 OMP#OS-7115 #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,10 @@ BuildRequires: oneshot | |
BuildRequires: systemd | ||
BuildRequires: qt5-qttools-kmap2qmap >= 5.1.0+git5 | ||
BuildRequires: rsync | ||
%if 0%{?with_system_keys:1} | ||
BuildRequires: system-keys-kernel | ||
BuildRequires: system-keys-bootloader | ||
%endif | ||
# starting from Android 8 | ||
BuildRequires: python | ||
%{?custom_build_requires} | ||
|
@@ -385,6 +389,25 @@ if (grep -q '^TARGET_ARCH := arm64' %{android_root}/device/*/*/BoardConfig*.mk); | |
fi | ||
%endif | ||
|
||
%if 0%{?with_system_keys:1} | ||
KERNEL_DIRS=$(find %android_root -maxdepth 1 -type d \( -name "kernel-*.*" -o -name "kernel" \) && | ||
find %android_root -maxdepth 2 -type d -path "*/linux/kernel") | ||
|
||
# Copy trusted keys into kernel source directory | ||
echo "$KERNEL_DIRS" | | ||
while IFS= read -r kernel; do | ||
cp -r /etc/keys/kernel/* ${kernel}/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks weird how could or should come these keys from the rootfs of the build host? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are supposed to be provided by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't they go then into /usr/lib? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Package supplied configuration files that should not be edited are now days in /usr/lib not in /etc, etc is for file created outside of the package-manager or those that should be edit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I am agree on moving static data to Maybe |
||
done | ||
|
||
# Override aboot OEM keystore | ||
if [ -d bootable/bootloader/lk/include ]; then | ||
cp /etc/keys/bootloader/oem_keystore.h bootable/bootloader/lk/include | ||
fi | ||
if [ -d vendor/mediatek/proprietary/bootable/bootloader/lk/include ]; then | ||
cp /etc/keys/bootloader/oem_keystore.h vendor/mediatek/proprietary/bootable/bootloader/lk/include | ||
fi | ||
%endif | ||
|
||
%if 0%{?_obs_build_project:1} | ||
|
||
# Set up kernel extra version for OBS kernel builds | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can directly pass the find output to read, see: https://github.com/koalaman/shellcheck/wiki/SC2044
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing output directly is a bash-specific thing, it won't work with plain POSIX shell. Is it okay to use bashisms here?