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.

146 lines
4.6 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. # copy some specially pre-processed files with version
  73. echo "before $IFS"
  74. IFS=$' \t\n' # correcly set IFS - it get mangled somewhere ...
  75. echo "after $IFS"
  76. for x in $(cd arch/ppc/boot/images/ ; ls zImage.*) ; do
  77. cp -v arch/ppc/boot/images/$x \
  78. $root/boot/${x/zImage/zImage-$ver}
  79. done
  80. ;;
  81. sparc)
  82. eval $MAKE vmlinux
  83. cp -vf vmlinux $root/boot/vmlinux_$ver-rock
  84. [ "$default" ] && \
  85. cp -vf vmlinux $root/boot/vmlinux
  86. # build a sun4 kernel ...
  87. #echo "CONFIG_SUN4=y" >> .config
  88. #yes '' | eval $MAKE oldconfig > /dev/null
  89. #eval $MAKE vmlinux
  90. #cp -vf vmlinux $root/boot/vmlinux4_$ver-rock
  91. [ "$default" ] && \
  92. # cp -vf vmlinux $root/boot/vmlinux4
  93. #echo "# CONFIG_SUN4 is not set" >> .config
  94. yes '' | eval $MAKE oldconfig > /dev/null
  95. ;;
  96. *)
  97. eval $MAKE vmlinux
  98. cp -vf vmlinux $root/boot/vmlinux_${lx_kernelrelease}
  99. [ "$default" ] && \
  100. cp -vf vmlinux $root/boot/vmlinux
  101. ;;
  102. esac
  103. cp -vf .config $root/boot/kconfig_${lx_kernelrelease}
  104. cp -vf System.map $root/boot/System.map_${lx_kernelrelease}
  105. [ "$default" ] && cp -vf System.map $root/boot/System.map
  106. echo "Building the modules ..."
  107. eval $MAKE modules
  108. echo "Installing the modules ..."
  109. if [ $stagelevel -le 1 ] ; then
  110. eval $MAKE modules_install \
  111. INSTALL_MOD_PATH=$root DEPMOD=/bin/true
  112. else
  113. eval $MAKE modules_install DEPMOD=/bin/true
  114. echo "Running 'depmod -a -q -F /boot/System.map ${lx_kernelrelease}' .."
  115. depmod -a -q -F /boot/System.map_${lx_kernelrelease} ${lx_kernelrelease}
  116. for x in /lib/modules/${lx_kernelrelease}/modules.*
  117. do [ -f $x ] && add_flist $x; done
  118. fi
  119. # fix /lib/modules/${ver}/build symlink
  120. rm -f $root/lib/modules/${lx_kernelrelease}/build
  121. ln -sf ../../../usr/src/linux-${lx_kernelrelease} \
  122. $root/lib/modules/${lx_kernelrelease}/build
  123. if [ "$default" ] ; then
  124. cp $base/package/base/linux24/mkinitrd.sh $root/sbin/mkinitrd
  125. chmod +x $root/sbin/mkinitrd
  126. if [ -z "$root" ]; then
  127. mkinitrd empty ${lx_kernelrelease}
  128. rm -f /boot/initrd.img
  129. ln -s initrd-${lx_kernelrelease}.img /boot/initrd.img
  130. fi
  131. fi
  132. }
  133. custmain="main_lx"
  134. autopatch=0