image28

Untested live kernel update script

Jan 1st, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.61 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function live-kernerl-update()
  4. {
  5.     # Update the kernel source
  6.     KERNELSOURCE=~/LiveKernel/linux
  7.     cd $KERNELSOURCE
  8.     git pull
  9.    
  10.     # Compiling the updated kernel source ( just changes since last hours git pull )
  11.     fakeroot debian/rules binary-headers binary-generic binary-perarch skipdbg=false
  12.  
  13.     # Test compile was successful
  14.     if test $? -ne 0;
  15.     then
  16.         echo "Git Kernel Failed to compile, will try again in an hour"
  17.         exit;
  18.     fi
  19.    
  20.     # Create Kpatch module
  21.     kpatch -t vmlinuz kpatch-`date %h-%j-%Y`.ko
  22.  
  23.     # Update the currently running kernel live
  24.     sudo kpatch load kpatch-`date +%H-%j-%Y`.ko
  25. }
Add Comment
Please, Sign In to add comment