OpenSDE Packages Database (without history before r20070)
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.

155 lines
4.5 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../linux/linux.conf
  5. # Copyright (C) 2007 - 2010 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  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; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. . $base/package/*/linux*/linux-conf.in
  17. main_lx() {
  18. lx_patch
  19. lx_config
  20. hook_eval premake
  21. # we need to rerun the oldconfig since the used .config
  22. # might not match the one used in the last oldconfig run
  23. # (e.g. the nomods is run last - and normally the module
  24. # one is used)
  25. yes '' | eval $MAKE $makeopt oldconfig > /dev/null
  26. kerneldir="$PWD"
  27. moduledir="$root/lib/modules/${lx_kernelrelease}"
  28. echo "Cleanup kernel ..."
  29. eval $MAKE $makeopt clean > /dev/null
  30. cp -vf .config $root/boot/kconfig_${lx_kernelrelease}
  31. if [ -z "$SDEDEBUG_LINUX_SUBMODULES_ONLY" ] ; then
  32. var_append makeopt ' ' vmlinux
  33. if grep -q "CONFIG_MODULES=y" .config ; then
  34. var_append makeopt ' ' modules
  35. var_append makeinstopt ' ' "INSTALL_MOD_PATH=$root DEPMOD=/bin/true modules_install"
  36. else
  37. makeinstopt=
  38. fi
  39. case "$lx_cpu" in
  40. x86|i386|x86_64)
  41. var_append makeopt ' ' bzImage ;;
  42. mips)
  43. var_append makeopt ' ' vmlinux.ecoff ;;
  44. ppc|sh)
  45. var_append makeopt ' ' zImage ;;
  46. sparc*)
  47. var_append makeopt ' ' image ;;
  48. esac
  49. echo "Building the kernel ..."
  50. eval $MAKE $makeopt
  51. cp -vf System.map $root/boot/System.map_${lx_kernelrelease}
  52. hook_eval inmake
  53. [ "$makeinstopt" ] && eval $MAKE $makeinstopt
  54. echo "Installing the kernel ..."
  55. # for debugging with oprofile, also used to boot on some arches
  56. cp -vf vmlinux $root/boot/vmlinux_${lx_kernelrelease}
  57. case "$lx_cpu" in
  58. x86|i386|x86_64)
  59. cp -vf arch/${lx_cpu}/boot/bzImage $root/boot/vmlinuz_${lx_kernelrelease}
  60. ;;
  61. alpha)
  62. gzip < vmlinux > $root/boot/vmlinux_${lx_kernelrelease}.gz
  63. ;;
  64. mips)
  65. cp -vf vmlinux.ecoff $root/boot/vmlinux_${lx_kernelrelease}.ecoff
  66. ;;
  67. ppc)
  68. for x in arch/ppc/boot/images/zImage.* ; do
  69. cp -v $x $root/boot/${x/*\//}-${lx_kernelrelease}
  70. done
  71. ;;
  72. sh)
  73. cp -vf arch/sh/boot/zImage $root/boot/vmlinux_${lx_kernelrelease}
  74. ;;
  75. sparc*)
  76. cp -vf arch/$lx_cpu/boot/image $root/boot/vmlinux_${lx_kernelrelease}
  77. ;;
  78. esac
  79. else
  80. eval $MAKE $makeopt scripts
  81. touch $root/boot/System.map_${lx_kernelrelease}
  82. mkdir -p $moduledir
  83. ln -sf $PWD $moduledir/build
  84. fi
  85. hook_eval postmake
  86. # iterate over the packages that provide 3rd party linux kernel modules
  87. if grep -q "CONFIG_MODULES=y" .config ; then
  88. module_error=0
  89. echo_status "Registered 3rd party kernel modules:"
  90. for x in $lx_3rd_party_modules ; do
  91. echo "Sub-building 3rd party module package $x ..."
  92. pushd $builddir
  93. # ugly, bash does not abort properly when we have this in a if
  94. # and without it the return 1 aborts immediatly ... :-(
  95. set +e
  96. build_package $x postlinux.conf
  97. error=$?
  98. set -e
  99. if [ $error -ne 0 ]; then
  100. echo_warning "Failed building $x."
  101. module_error=1
  102. fi
  103. echo "Done building $x"
  104. popd
  105. done
  106. # maybe fail hard
  107. if ! atstage rebuild && [ $module_error = 1 ]; then
  108. abort "At least one of the 3rd party kernel modules failed!"
  109. fi
  110. echo "Running 'depmod -ae -b ${root:-/} -q -F /boot/System.map ${lx_kernelrelease}' ..."
  111. depmod -ae -b ${root:-/} -q -F $root/boot/System.map_${lx_kernelrelease} ${lx_kernelrelease}
  112. # due static depmod :-(
  113. for x in $moduledir/modules.*
  114. do [ -f $x ] && add_flist $x; done
  115. echo "Fixing /lib/modules/${ver}/build and source symlinks ..."
  116. for x in build source; do
  117. rm -f $root/lib/modules/${lx_kernelrelease}/$x
  118. ln -snf ../../../usr/src/linux-${lx_kernelrelease} \
  119. $root/lib/modules/${lx_kernelrelease}/$x
  120. done
  121. # if module versions is enabled we need to copy 'Module.symvers'
  122. # to be able to build external 3rd party kernel modules without
  123. # rebuilding the whole kernel using the linux-src package
  124. if grep -q "CONFIG_MODVERSIONS=y" .config && pkginstalled linux-src ; then
  125. echo "Copying Module.symvers -> /lib/modules/${lx_kernelrelease}/build/"
  126. cp -v Module.symvers $root/lib/modules/${lx_kernelrelease}/build/
  127. fi
  128. fi
  129. }
  130. custmain="main_lx"
  131. autopatch=0