Gentoo installation script
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kbuild.sh 839B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # /etc/profile.d/kbuild.sh
  2. kbuild() {
  3. CWD="$(pwd)"
  4. if [ $EUID -ne 0 ]; then
  5. if [ -e $(command -v sudo) ]; then
  6. SU="sudo"
  7. else
  8. SU="su -c"
  9. fi
  10. fi
  11. KMake="make -s -j$(grep -c ^processor /proc/cpuinfo)"
  12. eselect kernel list
  13. TargetProfile=""
  14. while [ -z "$TargetProfile" ]; do
  15. read -ep "Which profile?: " TargetProfile
  16. done
  17. if [ -n "$TargetProfile" ]; then
  18. $SU eselect kernel set "$TargetProfile" &&
  19. cd /usr/src/linux &&
  20. $SU make menuconfig &&
  21. $SU $KMake &&
  22. $SU $KMake modules &&
  23. $SU $KMake install &&
  24. $SU $KMake modules install &&
  25. $SU grub-mkconfig -o /boot/grub/grub.cfg &&
  26. $SU emerge -av --quiet-build @module-rebuild
  27. fi
  28. $SU make clean
  29. unset KMake
  30. cd $CWD
  31. }