install.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. #
  3. # This file is subject to the terms and conditions of the GNU General Public
  4. # License. See the file "COPYING" in the main directory of this archive
  5. # for more details.
  6. #
  7. # Copyright (C) 1995 by Linus Torvalds
  8. #
  9. # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
  10. # Adapted from code in arch/i386/boot/install.sh by Russell King
  11. #
  12. # "make install" script for the LoongArch Linux port
  13. #
  14. # Arguments:
  15. # $1 - kernel version
  16. # $2 - kernel image file
  17. # $3 - kernel map file
  18. # $4 - default install path (blank if root directory)
  19. set -e
  20. case "${2##*/}" in
  21. vmlinux.elf)
  22. echo "Installing uncompressed vmlinux.elf kernel"
  23. base=vmlinux
  24. ;;
  25. vmlinux.efi)
  26. echo "Installing uncompressed vmlinux.efi kernel"
  27. base=vmlinux
  28. ;;
  29. vmlinuz.efi)
  30. echo "Installing gzip/zstd compressed vmlinuz.efi kernel"
  31. base=vmlinuz
  32. ;;
  33. *)
  34. echo "Warning: Unexpected kernel type"
  35. exit 1
  36. ;;
  37. esac
  38. if [ -f $4/$base-$1 ]; then
  39. mv $4/$base-$1 $4/$base-$1.old
  40. fi
  41. cat $2 > $4/$base-$1
  42. # Install system map file
  43. if [ -f $4/System.map-$1 ]; then
  44. mv $4/System.map-$1 $4/System.map-$1.old
  45. fi
  46. cp $3 $4/System.map-$1
  47. # Install kernel config file
  48. if [ -f $4/config-$1 ]; then
  49. mv $4/config-$1 $4/config-$1.old
  50. fi
  51. cp .config $4/config-$1