-
Notifications
You must be signed in to change notification settings - Fork 430
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
Update linux_headers_image to support >= 6.3 kernels. Add 6.2 through 6.11 kernels #2036
Open
ddelnano
wants to merge
3
commits into
pixie-io:main
Choose a base branch
from
ddelnano:ddelnano/add-newer-linux-kernel-headers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright 2018- The Pixie Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM ubuntu:18.04@sha256:8aa9c2798215f99544d1ce7439ea9c3a6dfd82de607da1cec3a8a2fae005931b | ||
|
||
# Install required packages | ||
RUN apt-get update | ||
RUN apt-get upgrade -y -q | ||
RUN apt-get install -y -q build-essential \ | ||
bc \ | ||
libelf-dev \ | ||
libssl-dev \ | ||
flex \ | ||
bison \ | ||
kmod \ | ||
cpio \ | ||
rsync \ | ||
wget \ | ||
binutils-aarch64-linux-gnu \ | ||
gcc-aarch64-linux-gnu \ | ||
dwarves \ | ||
python3 | ||
|
||
ARG KERN_VERSION | ||
|
||
# Download Linux sources | ||
WORKDIR /px/src | ||
RUN KERN_MAJ="$(echo "${KERN_VERSION}" | cut -d'.' -f1)"; \ | ||
wget -nv http://mirrors.edge.kernel.org/pub/linux/kernel/v${KERN_MAJ}.x/linux-${KERN_VERSION}.tar.gz | ||
RUN tar zxf linux-${KERN_VERSION}.tar.gz | ||
|
||
WORKDIR /configs | ||
ADD x86_64_config /configs/x86_64 | ||
ADD arm64_config /configs/arm64 | ||
|
||
ARG ARCH | ||
ARG CROSS_COMPILE | ||
|
||
# Build Linux kernel | ||
WORKDIR /px/src/linux-${KERN_VERSION} | ||
RUN cp /configs/${ARCH} .config | ||
RUN make ARCH=${ARCH} olddefconfig | ||
RUN make ARCH=${ARCH} clean | ||
RUN make ARCH=${ARCH} -j $(nproc) bindeb-pkg LOCALVERSION=-pl | ||
|
||
# Extract headers into a tarball | ||
WORKDIR /px | ||
RUN DEB_ARCH=$(echo ${ARCH} | sed 's/x86_64/amd64/g'); dpkg -x src/linux-headers-${KERN_VERSION}-pl_${KERN_VERSION}-pl-1_${DEB_ARCH}.deb . | ||
|
||
# Remove broken symlinks | ||
RUN find usr/src/linux-headers-${KERN_VERSION}-pl -xtype l -exec rm {} + | ||
|
||
# Remove uneeded files to reduce size | ||
# Keep only: | ||
# - usr/src/linux-headers-x.x.x-pl/include | ||
# - usr/src/linux-headers-x.x.x-pl/arch/${ARCH} | ||
# This reduces the size by a little over 2x. | ||
RUN rm -rf usr/share | ||
RUN find usr/src/linux-headers-${KERN_VERSION}-pl -maxdepth 1 -mindepth 1 ! -name include ! -name arch -type d \ | ||
-exec rm -rf {} + | ||
RUN find usr/src/linux-headers-${KERN_VERSION}-pl/arch -maxdepth 1 -mindepth 1 ! -name $(echo ${ARCH} | sed 's/x86_64/x86/g') -type d -exec rm -rf {} + | ||
RUN tar zcf linux-headers-${ARCH}-${KERN_VERSION}.tar.gz usr | ||
|
||
VOLUME /output | ||
CMD ["sh", "-c", "cp linux-headers-*.tar.gz /output/"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we have an official process for how to pick these? Since I had conditional logic for pre 6.3 and post 6.3, I wanted the latest minor version on either side, in addition to some number of kernels between 6.3 and 6.11.
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.
The last time I did this I picked the newest patch version for each.
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.
Can you check the change in the size of the headers tar with these changes? I believe we were worried about the size increase here. cc @oazizi000
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.
Probably should also update this comment https://github.com/pixie-io/pixie/blob/3c41d554215528e688328aef94192e696db617dc/src/stirling/BUILD.bazel#L68:72
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.
This change adds 63MB to the existing header file and brings its total size to 315MB. That's a pretty big addition, so I'd be open to trimming down the added versions. I think we could select one version in between 6.1 and 6.7/6.8 and one from 6.10/6.11 (since #2035 is related to those versions).
Comment updated and will keep it in sync with what we decide as the right set of new headers to include.