Deliverable: Linux Kernel Patch
Kernel Patch
The one and only deliverable for this exercise is a patch for the Linux kernel containing the modifications you made to the kernel sources to implement the drivers. That patch should consist of a single file. To generate the patch, please use the following instructions.
In the container, list the files you modified and added on top of vanilla Linux v6.6:
root@container:~/workspace/linux-6.6# git status
Add all files you wish to incorporate into the patch and commit (the commit message does not matter):
root@container:~/workspace/linux-6.6# git add drivers/misc/Makefile
root@container:~/workspace/linux-6.6# git add init/main.c
root@container:~/workspace/linux-6.6# git add drivers/misc/edu-rng-sync.c
...
root@container:~/workspace/linux-6.6# git commit -m "submission"
Finally, generate the patch:
root@container:~/workspace/linux-6.6# git diff v6.6 > linux.patch
Inspect the file linux.patch and make sure that:
- It contains all files relevant to your drivers’ implementations: typically that would be Linux’s
main.cwith our synchronous RNG test integrated in the boot process, each driver’s C source file and the corresponding kernel user-space API header file; as well as any kernelMakefileyou modified to integrate your code to the build process. - It does not contain any irrelevant files: no binaries, object files, user-space code, etc.
⚠️⚠️⚠️ Double and triple check the validity of your patch: if it fails to apply to the vanilla sources of Linux v6.6, your mark will be 0. If it makes the marking more difficult (e.g., it applies with warnings or creates unneeded files), you will lose marks too. See below how to check the validity of the patch and the code you submit through it.
Even if you did not fully complete the exercise, please make sure the patch applies, or else you cannot be marked and will get 0.
Testing the Patch
A script is available to check the application of your patch on the vanilla version of the kernel sources, and to run each test that will be used for marking.
To run it, first launch a fresh container based on the lab’s image and copy your patch inside, either using drag-and-drop in a VSCode window attached to the container, or by using docker cp from the command line.
Then, inside the container, run the comp26020-check-submission command with your patch as first argument:
root@container:~/workspace# comp26020-check-submission linux.patch
You should see a log of everything happening. The script will:
- Apply the patch to the kernel sources.
- Compile the kernel.
- Run the VM and wait for it to boot.
- Using SSH connections, compile and run the test applications and test suites we have been using throughout this exercise.
⚠️⚠️⚠️ Make sure to run this script on a fresh container and not the container you are developing in: it may mess up your files.
Before submitting, please make sure you complete the submission checklist.