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.

152 lines
4.2 KiB

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