Skip to content

Commit

Permalink
Test DKMS in chroot
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Jan 11, 2025
1 parent 58a1914 commit 6fe85f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 41 deletions.
49 changes: 9 additions & 40 deletions .github/workflows/image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,46 +69,15 @@ jobs:
echo '&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hyperhdr.public.apt.gpg.key] https://awawa-dev.github.io $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hyperhdr.list > /dev/null \' >> start_chroot_script
echo '&& sudo apt update \' >> start_chroot_script
echo '&& sudo apt install hyperhdr -y' >> start_chroot_script
echo 'cd /tmp' >> start_chroot_script
echo 'sudo apt install -y git bc bison flex libssl-dev bc make' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || sudo apt install -y dkms' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || sudo mkdir -p /usr/src/v4l2_p010-1.0' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || sudo wget ${{env.SCRIPT_PATH}}/dkms/p10_dkms.patch -O /usr/src/v4l2_p010-1.0/p10_dkms.patch' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || sudo wget ${{env.SCRIPT_PATH}}/dkms/dkms.conf -O /usr/src/v4l2_p010-1.0/dkms.conf' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || (sudo wget ${{env.SCRIPT_PATH}}/dkms/dkms-patchmodule.sh -O /usr/src/v4l2_p010-1.0/dkms-patchmodule.sh && sudo chmod +x /usr/src/v4l2_p010-1.0/dkms-patchmodule.sh)' >> start_chroot_script
echo '${{env.DISABLE_DKMS}} || sudo dkms add -m v4l2_p010 -v 1.0' >> start_chroot_script
echo 'sudo wget ${{env.SCRIPT_PATH}}/rpi-source/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update --processor 4' >> start_chroot_script
echo 'mkdir -p /tmp/kernel-source && /usr/local/bin/rpi-source -q -d /tmp/kernel-source --nomake --default-config --processor 4 --download-only' >> start_chroot_script
echo 'cd kernel-source && ls *.tar.gz | xargs -n1 tar xf && rm *.tar.gz && cd $(ls -d */|head -n 1)' >> start_chroot_script
echo 'wget ${{env.SCRIPT_PATH}}/p010.patch' >> start_chroot_script
echo 'patch -p0 < ./p010.patch' >> start_chroot_script
echo 'for Architecture in 2712 v8' >> start_chroot_script
echo 'do' >> start_chroot_script
echo 'make clean && make mrproper' >> start_chroot_script
echo 'KERNEL_VERSION=$(ls /usr/lib/linux-image* | sed -E "s/.*linux-image-([0-9]+.[0-9]+.[0-9]+)\+rpt-rpi.*/\1/" | head -1)' >> start_chroot_script
echo 'UNAME=$KERNEL_VERSION+rpt-rpi-$Architecture' >> start_chroot_script
echo 'if [ "$Architecture" == "v8" ]; then' >> start_chroot_script
echo 'KERNEL_VER=$KERNEL_VERSION-v8' >> start_chroot_script
echo 'KERNEL=kernel8' >> start_chroot_script
echo 'yes "" | make bcm2711_defconfig scripts prepare modules_prepare' >> start_chroot_script
echo 'else' >> start_chroot_script
echo 'KERNEL_VER=$KERNEL_VERSION-v8-16k' >> start_chroot_script
echo 'KERNEL=kernel_2712' >> start_chroot_script
echo 'yes "" | make bcm2712_defconfig scripts prepare modules_prepare' >> start_chroot_script
echo 'fi' >> start_chroot_script
echo 'echo "!!!!!!!!!!!!!!!!!!!!!!!!!! Architecture=$Architecture KERNEL_VER=$KERNEL_VER UNAME=$UNAME KERNEL=$KERNEL !!!!!!!!!!!!!!!!!!!!!!!!!!"' >> start_chroot_script
echo 'sudo apt install linux-headers-$UNAME' >> start_chroot_script
echo 'cp /usr/src/linux-headers-$UNAME/Module.symvers .' >> start_chroot_script
echo 'make -j $(nproc) M=drivers/media/usb/uvc modules' >> start_chroot_script
echo 'sudo make -j $(nproc) M=drivers/media/usb/uvc modules_install' >> start_chroot_script
echo 'make -j $(nproc) M=drivers/media/common modules' >> start_chroot_script
echo 'sudo make -j $(nproc) M=drivers/media/common modules_install' >> start_chroot_script
echo 'sudo cp -f /lib/modules/$KERNEL_VER/updates/uvcvideo.ko.xz /lib/modules/$UNAME/kernel/drivers/media/usb/uvc/uvcvideo.ko.xz' >> start_chroot_script
echo 'sudo cp -f /lib/modules/$KERNEL_VER/updates/uvc.ko.xz /lib/modules/$UNAME/kernel/drivers/media/common/uvc.ko.xz' >> start_chroot_script
echo 'done' >> start_chroot_script
echo '(! ${{env.DISABLE_DKMS}}) || (sudo apt remove -y git bc bison flex libssl-dev bc make && sudo apt autoremove -y && sudo apt clean -y)' >> start_chroot_script
echo 'cd /' >> start_chroot_script
echo 'rm -rf /tmp/kernel-source && rm -rf /tmp/*' >> start_chroot_script
echo 'sudo apt install -y dkms git bc bison flex libssl-dev bc make' >> start_chroot_script
echo 'sudo mkdir -p /usr/src/v4l2_p010-1.0' >> start_chroot_script
echo 'sudo wget ${{env.SCRIPT_PATH}}/dkms/p10_dkms.patch -O /usr/src/v4l2_p010-1.0/p10_dkms.patch' >> start_chroot_script
echo 'sudo wget ${{env.SCRIPT_PATH}}/dkms/dkms.conf -O /usr/src/v4l2_p010-1.0/dkms.conf' >> start_chroot_script
echo 'sudo wget ${{env.SCRIPT_PATH}}/dkms/dkms-patchmodule.sh -O /usr/src/v4l2_p010-1.0/dkms-patchmodule.sh && sudo chmod +x /usr/src/v4l2_p010-1.0/dkms-patchmodule.sh' >> start_chroot_script
echo 'sudo dkms add -m v4l2_p010 -v 1.0' >> start_chroot_script
echo 'sudo dkms build -m v4l2_p010 -v 1.0' >> start_chroot_script
echo 'sudo dkms install -m v4l2_p010 -v 1.0' >> start_chroot_script
echo 'sudo apt clean -y' >> start_chroot_script
echo 'touch /boot/ssh' >> start_chroot_script
echo "echo -n 'pi:' > /boot/userconf" >> start_chroot_script
echo "echo 'raspberry' | openssl passwd -6 -stdin >> /boot/userconf" >> start_chroot_script
Expand Down
2 changes: 1 addition & 1 deletion dkms/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CLEAN[0]="rm -f $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build/src/drivers/medi

AUTOINSTALL="yes"
PRE_BUILD="dkms-patchmodule.sh"
BUILD_EXCLUSIVE_KERNEL="^(6\.[6-9]+\.|6\.[1-9]+[0-9]+\.|[7-9]+\.|[1-9]+[0-9]+\.)"
BUILD_EXCLUSIVE_KERNEL="^(6\.[5-9]+\.|6\.[1-9]+[0-9]+\.|[7-9]+\.|[1-9]+[0-9]+\.)"

0 comments on commit 6fe85f6

Please sign in to comment.