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.

93 lines
2.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../linux-src/linux-src.conf
  5. # Copyright (C) 2007 - 2011 The OpenSDE Project
  6. # Copyright (C) 1998 - 2003 Clifford Wolf
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. # include the function to patch and configure the kernel
  16. . $base/package/*/*/linux-conf.in
  17. main_lx_src() {
  18. local vanilla_ver=$( echo $ver | cut -d. -f1-3 )
  19. local patches_dir=
  20. echo "Extracting the Linux Kernel Sources [$vanilla_ver] ... "
  21. # hack to extract the files into our usr/src dir ...
  22. # this part is continued inside lx_injectextraversion
  23. mkdir -p linux-$vanilla_ver
  24. tar -C linux-$vanilla_ver --strip-components=1 $taropt $( match_source_file -p linux linux | head -n 1 )
  25. chown -R 0:0 linux-$vanilla_ver; chmod go=u,go-w linux-$vanilla_ver
  26. cd linux-$vanilla_ver
  27. lx_patch
  28. lx_config
  29. patches_dir="$root/usr/src/linux-$lx_kernelrelease-patches"
  30. # remove debug configs
  31. rm -f .config.[1-9]
  32. if [ "$SDECFG_PKG_LINUX_CONFIG_STYLE" = none ] ; then
  33. # create a valid .config (new settings may be available etc.)
  34. yes '' | eval $MAKE $makeopt oldconfig > /dev/null
  35. fi
  36. if grep -q "CONFIG_MODULES=y" .config ; then
  37. eval $MAKE $makeopt modules_prepare
  38. fi
  39. echo "Clean up the *.orig and *~ files ... "
  40. find -name '*.orig' -o -name '*~' | xargs rm -f
  41. rm -f .config.old
  42. echo "Copying kernel patches ... "
  43. rm -rf "$patches_dir"; mkdir -p "$patches_dir"
  44. cat <<-EOT > $patches_dir/README
  45. This directory contains all the applied patches, used
  46. to build the kernel (in addition to the official kernel sources).
  47. EOT
  48. for x in $patchfiles ; do
  49. # if the patch does not exist it was downloaded or so
  50. # and we just do not copy it ...
  51. [ ! -f "$x" ] || cp -v "$x" "$patches_dir"
  52. done
  53. if [ "$SDECFG_PKG_LINUX_CONFIG_STYLE" != none ] ; then
  54. cp -v .config_nomods "$patches_dir/config_nomods.txt"
  55. cp -v .config_modules "$patches_dir/config_modules.txt"
  56. fi
  57. cp -v .config "$patches_dir/config.txt"
  58. echo "Installing kernel sources [$lx_kernelrelease] "
  59. rm -rf $root/usr/src/{linux-$lx_kernelrelease,linux}
  60. mkdir -vp "$root/usr/src/linux-$lx_kernelrelease"
  61. ln -svnf "linux-$lx_kernelrelease" $root/usr/src/linux
  62. tar -cf - * | tar -C "$root/usr/src/linux-$lx_kernelrelease" -xf -
  63. cp -v .config "$root/usr/src/linux-$lx_kernelrelease/"
  64. }
  65. createdocs=0
  66. srctar=none
  67. custmain="main_lx_src"
  68. for x in $( match_source_file -p patch-.* linux | grep -v '\.tar\.' ); do
  69. var_insert patchfiles " " "$x"
  70. done
  71. for x in $( ls -1d $base/package/$repository/linux/*.patch ); do
  72. var_append patchfiles " " "$x"
  73. done