Skip to content

Instantly share code, notes, and snippets.

@KatrinaHoffert
Last active August 29, 2015 14:10
Show Gist options
  • Save KatrinaHoffert/f111a32d18691f52a983 to your computer and use it in GitHub Desktop.
Save KatrinaHoffert/f111a32d18691f52a983 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# By Mike Hoffert. Based on clean-kernel.sh in OS161.
#
# Does a better job of removing unnecessary files. Will reset the build number
# that OS161 thinks it is (if you don't like this, remove the line that deletes
# src/defs.mk).
#
# You will have to re-run conf-kernel.sh after running this (and rebuild, of
# course). If you use my other script, build-kernel2.sh, this script should only
# have to be run before handing anything in.
PATH=/www/docs/classes/332/t1/os161/bin:$PATH
cd src
bmake clean
cd ../
# Preserve the sys161.conf file, but delete the rest of the root directory
mv root/sys161.conf .
rm -rf root/*
mv sys161.conf root
# Remove other folders that this script didn't remove for whatever reason
rm -rf src/build
rm -f src/kern/build
find src -name ".depend" -delete
rm -rf src/kern/compile/*
rm -f src/defs.mk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment