mirror of the now-defunct rocklinux.org
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.

142 lines
4.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/linux24/linux24.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # include the function to patch and configure the kernel
  23. . $base/package/base/linux24/lx_config.sh
  24. main_lx() {
  25. lx_config
  26. # we need to rerun the oldconfig since the used .config
  27. # might not match the one used in the last oldconfig run
  28. # (e.g. the nomods is run last - and normally the module
  29. # one is used)
  30. yes '' | eval $MAKE oldconfig > /dev/null
  31. if [[ $treever = 24* ]] ; then
  32. echo "Creating dependencies ..."
  33. eval $MAKE -j 1 dep
  34. fi
  35. echo "Cleanup kernel ..."
  36. eval $MAKE -j 1 clean > /dev/null
  37. echo "Building the kernel ..."
  38. [ "$pkg" = "$ROCKCFG_DEFAULT_KERNEL" ] && default=1
  39. case "$lx_cpu" in
  40. i386)
  41. eval $MAKE bzImage
  42. cp -vf arch/i386/boot/bzImage $root/boot/vmlinuz_${lx_kernelrelease}
  43. [ "$default" ] && \
  44. cp -vf arch/i386/boot/bzImage $root/boot/vmlinuz
  45. ;;
  46. x86_64)
  47. eval $MAKE bzImage
  48. cp -vf arch/x86_64/boot/bzImage $root/boot/vmlinuz_${lx_kernelrelease}
  49. [ "$default" ] && \
  50. cp -vf arch/x86_64/boot/bzImage $root/boot/vmlinuz
  51. ;;
  52. alpha)
  53. eval $MAKE vmlinux
  54. gzip < vmlinux > $root/boot/vmlinux_${lx_kernelrelease}.gz
  55. [ "$default" ] && \
  56. cp -vf $root/boot/vmlinux_$ver-rock.gz $root/boot/vmlinux.gz
  57. ;;
  58. mips)
  59. eval $MAKE vmlinux
  60. $BUILDCC arch/mips/boot/elf2ecoff.c -o elf2ecoff
  61. ./elf2ecoff vmlinux vmlinux.ecoff
  62. cp -vf vmlinux.ecoff $root/boot/vmlinux_${lx_kernelrelease}.ecoff
  63. [ "$default" ] && \
  64. cp -vf vmlinux.ecoff $root/boot/
  65. ;;
  66. ppc)
  67. eval $MAKE vmlinux
  68. cp -vf vmlinux $root/boot/vmlinux_${lx_kernelrelease}
  69. [ "$default" ] && \
  70. cp -vf vmlinux $root/boot/vmlinux
  71. eval $MAKE zImage
  72. for x in arch/ppc/boot/images/zImage.* ; do
  73. cp -v $x $root/boot/${x/arch\/ppc\/boot\/images\//}-$ver
  74. done
  75. ;;
  76. sparc)
  77. if [[ $treever != 24* ]] && [ "$ROCKCFG_SPARC_BITS" = 32 ]] ; then
  78. eval $MAKE image
  79. else
  80. eval $MAKE vmlinux
  81. fi
  82. cp -vf vmlinux $root/boot/vmlinux_$ver-rock
  83. [ "$default" ] && \
  84. cp -vf vmlinux $root/boot/vmlinux
  85. ;;
  86. um)
  87. eval $MAKE linux
  88. cp -vf linux $root/boot/linux_${lx_kernelrelease}
  89. [ "$default" ] && \
  90. cp -vf linux $root/boot/linux
  91. ;;
  92. *)
  93. eval $MAKE vmlinux
  94. cp -vf vmlinux $root/boot/vmlinux_${lx_kernelrelease}
  95. [ "$default" ] && \
  96. cp -vf vmlinux $root/boot/vmlinux
  97. ;;
  98. esac
  99. cp -vf .config $root/boot/kconfig_${lx_kernelrelease}
  100. cp -vf System.map $root/boot/System.map_${lx_kernelrelease}
  101. [ "$default" ] && cp -vf System.map $root/boot/System.map
  102. echo "Building the modules ..."
  103. eval $MAKE modules
  104. echo "Installing the modules ..."
  105. if [ $stagelevel -le 1 ] ; then
  106. eval $MAKE modules_install \
  107. INSTALL_MOD_PATH=$root DEPMOD=/bin/true
  108. else
  109. eval $MAKE modules_install DEPMOD=/bin/true
  110. echo "Running 'depmod -a -q -F /boot/System.map ${lx_kernelrelease}' .."
  111. depmod -a -q -F /boot/System.map_${lx_kernelrelease} ${lx_kernelrelease}
  112. for x in /lib/modules/${lx_kernelrelease}/modules.*
  113. do [ -f $x ] && add_flist $x; done
  114. fi
  115. # fix /lib/modules/${ver}/build symlink
  116. rm -f $root/lib/modules/${lx_kernelrelease}/build
  117. ln -sf ../../../usr/src/linux-${lx_kernelrelease} \
  118. $root/lib/modules/${lx_kernelrelease}/build
  119. if [ "$default" ] ; then
  120. cp $base/package/base/linux24/mkinitrd.sh $root/sbin/mkinitrd
  121. chmod +x $root/sbin/mkinitrd
  122. if [ -z "$root" ]; then
  123. mkinitrd empty ${lx_kernelrelease}
  124. rm -f /boot/initrd.img
  125. ln -s initrd-${lx_kernelrelease}.img /boot/initrd.img
  126. fi
  127. fi
  128. }
  129. custmain="main_lx"
  130. autopatch=0