Skip to content

Commit

Permalink
CI: produce tar
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fasano committed Dec 19, 2023
1 parent fc611e4 commit 9999165
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ jobs:
tags: pandare/kernel_builder:latest

- name: Build
run: |
docker run --rm -v $PWD:/app pandare/kernel_builder /app/build.sh
tar czvf kernels-latest.tar.gz binaries
run: docker run --rm -v $PWD:/app pandare/kernel_builder /app/build.sh

- name: Save package
uses: actions/upload-artifact@v3
Expand Down
20 changes: 10 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -eux
#/opt/cross/arm-linux-musleabi
#/opt/cross/aarch64-linux-musl

mkdir /out
mkdir /kernels

TARGET_LIST="armel mipsel mipseb"
for TARGET in $TARGET_LIST; do
Expand Down Expand Up @@ -61,20 +61,20 @@ for TARGET in $TARGET_LIST; do

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

# Generate OSI profile
echo "[${TARGET}]" >> /kernels/osi.config
/panda/panda/plugins/osi_linux/utils/kernelinfo_gdb/run.sh \
/out/vmlinux.${TARGET} /tmp/panda_profile.${TARGET}
echo "[${TARGET}]" >> /out/firmadyne_profiles.conf
cat /tmp/panda_profile.${TARGET} /out/firmadyne_profiles.conf
/kernels/vmlinux.${TARGET} /tmp/panda_profile.${TARGET}
cat /tmp/panda_profile.${TARGET} /kernels/osi.config

/dwarf2json/dwarf2json linux --elf /out/vmlinux.${TARGET} \
| xz - > /out//vmlinux.${TARGET}.json.xz
/dwarf2json/dwarf2json linux --elf /kernels/vmlinux.${TARGET} \
| xz - > /kernels/vmlinux.${TARGET}.json.xz
done

tar cvfz /app/kernels-latest.tar.gz /out
echo "Built by linux_builder on $(date)" > /kernels/README.txt

echo "Built by linux_builder on $(date)" > /out/README.txt
tar cvfz /app/kernels-latest.tar.gz /kernels

0 comments on commit 9999165

Please sign in to comment.