Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions resources/hiding_ci/build_and_install_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,35 @@ confirm() {
}

apply_patch_file() {
git apply $1
}

apply_series_mbox() {
git am $1 --empty=drop
}
echo "Applying patch:" $(basename $1)

apply_series_link() {
patch_url=$(cat $1)
echo "Fetching mbox from:" $patch_url
curl --output lore.mbox.gz "$patch_url/t.mbox.gz"
gunzip lore.mbox
apply_series_mbox lore.mbox
rm lore.mbox
git apply $1
}

apply_patch_or_series() {
case "$1" in
*.patch) apply_patch_file $1 ;;
*.mbox) apply_series_mbox $1 ;;
*.lore) apply_series_link $1 ;;
*) echo "Skipping non-patch file" $1 ;;
esac
}

apply_all_patches() {
if [ ! -d "$1" ]; then
echo "Not a directory: $1"
return
fi

echo "Applying all patches in $1"

for f in $1/*; do
if [ -d $f ]; then
apply_all_patches $f
else
apply_patch_or_series $f
fi
done
}

check_new_config() {
if [[ -e "/boot/config-$KERNEL_VERSION" ]]; then
return 0;
Expand Down Expand Up @@ -171,10 +175,7 @@ git fetch --depth 1 origin $KERNEL_COMMIT_HASH
git checkout FETCH_HEAD

# Apply our patches on top
for PATCH in $KERNEL_PATCHES_DIR/*.*; do
echo "Applying patch:" $(basename $PATCH)
apply_patch_or_series $PATCH
done
apply_all_patches $KERNEL_PATCHES_DIR

echo "Making kernel config ready for build"
# We use olddefconfig to automatically pull in the
Expand Down
8 changes: 4 additions & 4 deletions resources/hiding_ci/linux_patches/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Linux kernel patches for direct map removal

The Linux kernel patches in this directory are distributed under the `GPL-2.0`
licence (see the full licence text at [GPL-2.0](./GPL-2.0)). The patches are
required by Firecracker's "Secret Freedom" feature that removes the VM memory
from the host direct map (see
The Linux kernel patches in this directory and its subdirectories are
distributed under the `GPL-2.0` licence (see the full licence text at
[GPL-2.0](./GPL-2.0)). The patches are required by Firecracker's "Secret
Freedom" feature that removes the VM memory from the host direct map (see
[lore](https://lore.kernel.org/kvm/[email protected]/)
for more details). The patches are not yet merged upstream.