Skip to content

Commit

Permalink
Add Linux 6.7 (#9)
Browse files Browse the repository at this point in the history
* Add Linux 6.7

* Make per-version build dirs
  • Loading branch information
be32826 authored Jan 18, 2024
1 parent afd5856 commit 624afa6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
path = linux/4.10
url = https://github.com/panda-re/linux.git
branch = 4.10_min
[submodule "linux_6.7"]
path = linux/6.7
url = https://github.com/panda-re/linux.git
branch = 6.7_min
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN git clone --depth 1 https://github.com/volatilityfoundation/dwarf2json.git \

FROM ghcr.io/panda-re/embedded-toolchains:latest
COPY --from=go /go/dwarf2json/dwarf2json /bin/dwarf2json
RUN apt-get update && apt-get -y install gdb xonsh
RUN apt-get update && apt-get -y install gdb xonsh flex bison libssl-dev

# Get panda for kernelinfo_gdb. Definitely a bit overkill to pull the whole repo
RUN git clone --depth 1 https://github.com/panda-re/panda.git
18 changes: 9 additions & 9 deletions _in_container_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,29 @@ for TARGET in $TARGETS; do
echo "No config for $TARGET"
exit 1
fi
mkdir -p "/tmp/build/${TARGET}"
cp "/app/config.${TARGET}" "/tmp/build/${TARGET}/.config"
mkdir -p "/tmp/build/${VERSION}/${TARGET}"
cp "/app/config.${TARGET}" "/tmp/build/${VERSION}/${TARGET}/.config"

# Actually build
echo "Building kernel for $TARGET"
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${TARGET}/ olddefconfig
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ olddefconfig

# If updating configs, lint them with kernel first! This sorts, removes default options and duplicates.
if $CONFIG_ONLY; then
echo "Updating $TARGET config in place"
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${TARGET}/ savedefconfig
cp /tmp/build/${TARGET}/defconfig /app/config.${TARGET}
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ savedefconfig
cp /tmp/build/${VERSION}/${TARGET}/defconfig /app/config.${TARGET}
echo "Finished update for config.${TARGET}"
else
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${TARGET}/ $BUILD_TARGETS -j$(nproc)
make -C /app/linux/$VERSION ARCH=${short_arch} CROSS_COMPILE=$(get_cc $TARGET) O=/tmp/build/${VERSION}/${TARGET}/ $BUILD_TARGETS -j$(nproc)

mkdir -p /kernels/$VERSION

# Copy out zImage (if present) and vmlinux (always)
if [ -f "/tmp/build/${TARGET}/arch/${short_arch}/boot/zImage" ]; then
cp "/tmp/build/${TARGET}/arch/${short_arch}/boot/zImage" /kernels/$VERSION/zImage.${TARGET}
if [ -f "/tmp/build/${VERSION}/${TARGET}/arch/${short_arch}/boot/zImage" ]; then
cp "/tmp/build/${VERSION}/${TARGET}/arch/${short_arch}/boot/zImage" /kernels/$VERSION/zImage.${TARGET}
fi
cp "/tmp/build/${TARGET}/vmlinux" /kernels/$VERSION/vmlinux.${TARGET}
cp "/tmp/build/${VERSION}/${TARGET}/vmlinux" /kernels/$VERSION/vmlinux.${TARGET}

# Generate OSI profile
echo "[${TARGET}]" >> /kernels/$VERSION/osi.config
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ USAGE ./build.sh [--help] [--config-only] [--versions VERSIONS] [--targets TARGE
Build only for the specified targets. By default, all targets are built.
EXAMPLES
./build.sh --config-only --versions 4.10 --targets "armel mipseb mipsel mips64eb"
./build.sh --config-only --versions "4.10 6.7" --targets "armel mipseb mipsel mips64eb"
./build.sh --versions 4.10
./build.sh --targets armel
./build.sh
Expand All @@ -23,7 +23,7 @@ EOF

# Default options
CONFIG_ONLY=false
VERSIONS=4.10
VERSIONS="4.10 6.7"
TARGETS="armeb armel mipseb mipsel mips64eb mips64el"

# Parse command-line arguments
Expand Down
1 change: 1 addition & 0 deletions linux/6.7
Submodule 6.7 added at b7eaaa

0 comments on commit 624afa6

Please sign in to comment.