Testing eudev

Addons misc and acpid is optional now
This commit is contained in:
Fabio Belavenuto
2022-07-14 13:23:07 -03:00
parent 69151c65b2
commit 4a1d78056c
20 changed files with 174 additions and 59 deletions

View File

@@ -29,14 +29,14 @@ for PLATFORM in ${!PLATFORMS[@]}; do
else
echo "OK"
fi
echo -n "Checking cache/linux-${KVER}.tar.xz... "
if [ ! -f "cache/linux-${KVER}.tar.xz" ]; then
URL="https://cdn.kernel.org/pub/linux/kernel/v${KVER:0:1}.x/linux-${KVER}.tar.xz"
echo "Downloading ${URL}"
curl -L "${URL}" -o "cache/linux-${KVER}.tar.xz"
else
echo "OK"
fi
# echo -n "Checking cache/linux-${KVER}.tar.xz... "
# if [ ! -f "cache/linux-${KVER}.tar.xz" ]; then
# URL="https://cdn.kernel.org/pub/linux/kernel/v${KVER:0:1}.x/linux-${KVER}.tar.xz"
# echo "Downloading ${URL}"
# curl -L "${URL}" -o "cache/linux-${KVER}.tar.xz"
# else
# echo "OK"
# fi
done
# Generate Dockerfile

View File

@@ -43,28 +43,28 @@ function compile-lkm {
mv "/tmp/input/redpill.ko" "/output/redpill-prod.ko"
}
function compile-drivers {
while read platform kver; do
SRC_PATH="/opt/${platform}"
echo "Compiling for ${platform}-${kver}"
cd /opt/linux-${kver}/drivers
while read dir; do
if [ -f "${dir}/Makefile" ]; then
echo "Driver `basename ${dir}`"
grep "CONFIG_.*/.*" "${dir}/Makefile" | sed 's/.*\(CONFIG_[^)]*\).*/\1=n/g' > /tmp/env
grep "CONFIG_.*\.o.*" "${dir}/Makefile" | sed 's/.*\(CONFIG_[^)]*\).*/\1=m/g' >> /tmp/env
make -C "${SRC_PATH}" M=$(readlink -f "${dir}") clean
cat /tmp/env | xargs -d '\n' make -C "${SRC_PATH}" M=$(readlink -f "${dir}") modules $@
fi
done < <(find -type d)
DST_PATH="/output/compiled-mods/${platform}-${kver}"
mkdir -p "${DST_PATH}"
while read f; do
strip -g "${f}"
mv "${f}" "${DST_PATH}"
done < <(find -name \*.ko)
done </opt/platforms
}
# function compile-drivers {
# while read platform kver; do
# SRC_PATH="/opt/${platform}"
# echo "Compiling for ${platform}-${kver}"
# cd /opt/linux-${kver}/drivers
# while read dir; do
# if [ -f "${dir}/Makefile" ]; then
# echo "Driver `basename ${dir}`"
# grep "CONFIG_.*/.*" "${dir}/Makefile" | sed 's/.*\(CONFIG_[^)]*\).*/\1=n/g' > /tmp/env
# grep "CONFIG_.*\.o.*" "${dir}/Makefile" | sed 's/.*\(CONFIG_[^)]*\).*/\1=m/g' >> /tmp/env
# make -C "${SRC_PATH}" M=$(readlink -f "${dir}") clean
# cat /tmp/env | xargs -d '\n' make -C "${SRC_PATH}" M=$(readlink -f "${dir}") modules $@
# fi
# done < <(find -type d)
# DST_PATH="/output/compiled-mods/${platform}-${kver}"
# mkdir -p "${DST_PATH}"
# while read f; do
# strip -g "${f}"
# mv "${f}" "${DST_PATH}"
# done < <(find -name \*.ko)
# done </opt/platforms
# }
if [ $# -lt 1 ]; then
echo "Use: <command> (<params>)"
@@ -74,7 +74,7 @@ case $1 in
bash) shift; bash -l $@ ;;
compile-module) compile-module $2 ;;
compile-lkm) compile-lkm $2 ;;
compile-drivers) compile-drivers ;;
# compile-drivers) compile-drivers ;;
*) echo "Command not recognized: $1" ;;
esac