From 9cf34d3e1ca505995c9da497da548874312af57c Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Sat, 27 Nov 2021 11:33:26 +0000 Subject: [PATCH] cleanup-linux.sh --- _posts/2021-11-06-linux-contribution.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/_posts/2021-11-06-linux-contribution.md b/_posts/2021-11-06-linux-contribution.md index 683fd4f..9cdb568 100644 --- a/_posts/2021-11-06-linux-contribution.md +++ b/_posts/2021-11-06-linux-contribution.md @@ -84,6 +84,16 @@ scp -P 2222 ~/.tmux.conf root@localhost:/root scp -r -P 2222 ~/.config/nvim root@localhost:/root/.config/ {% endhighlight %} +One thing I found necessary, due to limited storage, is a script to cleanup each linux version after I'm done with them, since they create a couple of files in different places. I call this `cleanup-linux.sh`: + +{% highlight bash %} +VERSION=$1 +rm /boot/vmlinuz-linux${VERSION} +rm /boot/initramfs-linux${VERSION}.img +rm /boot/initramfs-linux-fallback${VERSION}.img +rm -r /usr/lib/modules/${VERSION} +{% endhighlight %} + # Debugging There is a `pr_debug` function used over the code, in order to enable those logs in `dmesg` for a specific module, you can do this: