redpill-lkm5/compile-lkms.sh
pocopico ed5ead24f8
Ida alloc (#7)
* Testing replace ida_pre_get to ida_alloc

* Fixing name of function

Co-authored-by: Fabio Belavenuto <belavenuto@gmail.com>
2022-12-28 18:30:45 +02:00

39 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
TMP_PATH="/tmp"
DEST_PATH="output"
TOOLKIT_VER="7.1"
mkdir -p "${DEST_PATH}"
#if [ -f ../arpl/PLATFORMS ]; then
# cp ../arpl/PLATFORMS PLATFORMS
#else
# curl -sLO "https://github.com/fbelavenuto/arpl/raw/main/PLATFORMS"
#fi
function compileLkm() {
PLATFORM=$1
KVER=$2
OUT_PATH="${TMP_PATH}/${PLATFORM}"
mkdir -p "${OUT_PATH}"
# Compile using docker
docker run --rm -t -v "${OUT_PATH}":/output -v "${PWD}":/input \
fbelavenuto/syno-toolkit:${PLATFORM}-${TOOLKIT_VER} compile-lkm
mv "${OUT_PATH}/redpill-dev.ko" "${DEST_PATH}/rp-${PLATFORM}-${KVER}-dev.ko"
rm -f "${DEST_PATH}/rp-${PLATFORM}-${KVER}-dev.ko.gz"
gzip "${DEST_PATH}/rp-${PLATFORM}-${KVER}-dev.ko"
mv "${OUT_PATH}/redpill-prod.ko" "${DEST_PATH}/rp-${PLATFORM}-${KVER}-prod.ko"
rm -f "${DEST_PATH}/rp-${PLATFORM}-${KVER}-prod.ko.gz"
gzip "${DEST_PATH}/rp-${PLATFORM}-${KVER}-prod.ko"
rm -rf "${OUT_PATH}"
}
# Main
while read PLATFORM KVER; do
docker pull fbelavenuto/syno-toolkit:${PLATFORM}-${TOOLKIT_VER}
compileLkm "${PLATFORM}" "${KVER}" &
done < PLATFORMS
wait