File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,17 @@ if ! grep -qi 'ubuntu' /etc/os-release; then
1515fi 
1616
1717confirm () {
18-   if  [[ " $* "   ==  * " -y" *  ]];  then 
18+   if  [[ " $* "   ==  * " --no-install" *  ]];  then 
19+     echo  " Not installing new kernel." 
20+     exit  0
21+   fi 
22+ 
23+   if  [[ " $* "   ==  * " --install" *  ]];  then 
1924    return  0
2025  fi 
2126
2227  while  true ;  do 
23-     echo  " This script will build and install a new kernel. Run this script at your own risk" 
24-     read  -p " Do you want to continue? (y/n) "   yn
28+     read  -p " Do you want to install the new kernel? (y/n) "   yn
2529    case  $yn  in 
2630    [Yy]* ) return  0 ;;
2731    [Nn]* )
@@ -33,9 +37,6 @@ confirm() {
3337  done 
3438}
3539
36- #  Make sure a user really wants to run this script
37- confirm " $@ " 
38- 
3940KERNEL_URL=$( cat kernel_url) 
4041KERNEL_COMMIT_HASH=$( cat kernel_commit_hash) 
4142KERNEL_VERSION=$( cat kernel_version) 
@@ -85,6 +86,9 @@ echo "Building kernel modules"
8586make modules -j $( nproc) 
8687echo  " Kernel build complete!" 
8788
89+ #  Make sure a user really wants to install this kernel
90+ confirm " $@ " 
91+ 
8892echo  " Installing kernel modules..." 
8993make INSTALL_MOD_STRIP=1 modules_install
9094echo  " Installing kernel..." 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments