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 737B

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