|
|
@ -14,52 +14,79 @@ |
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
|
|
|
|
# include the function to patch and configure the kernel |
|
|
|
. $base/package/base/linux26/lx_config.sh |
|
|
|
. $base/package/*/*/linux-conf.in |
|
|
|
|
|
|
|
main_lx_src() { |
|
|
|
cd $root/usr/src |
|
|
|
local vanilla_ver=$( echo $ver | cut -d. -f1-3 ) |
|
|
|
local patches_dir= |
|
|
|
|
|
|
|
echo "Extracting the Linux Kernel Sources [$vanilla_ver] ... " |
|
|
|
lx_tempdir=`mktemp -d tmp.XXXXXXXXXX` |
|
|
|
|
|
|
|
# hack to extract the files into our usr/src dir ... |
|
|
|
# this part is continued inside lx_injectextraversion |
|
|
|
ln -sf $PWD/${lx_tempdir} $builddir/linux-${vanilla_ver} |
|
|
|
tar -k $taropt $archdir/$srctar -C $builddir/ |
|
|
|
chown -R 0:0 ${lx_tempdir} ; chmod go=u,go-w ${lx_tempdir} |
|
|
|
tar $taropt $( match_source_file -p linux linux$treever | head -n 1 ) |
|
|
|
|
|
|
|
echo "Copying kernel patches ... " |
|
|
|
rm -rf linux$treever-patches ; mkdir -p linux$treever-patches |
|
|
|
cp -v $base/package/$repository/linux$treever/README linux$treever-patches/ |
|
|
|
cp -v $patchfiles linux$treever-patches/ |
|
|
|
|
|
|
|
cd ${lx_tempdir} |
|
|
|
chown -R 0:0 linux-$vanilla_ver; chmod go=u,go-w linux-$vanilla_ver |
|
|
|
cd linux-$vanilla_ver |
|
|
|
|
|
|
|
lx_patch |
|
|
|
lx_config |
|
|
|
|
|
|
|
patches_dir="$root/usr/src/linux-$lx_kernelrelease-patches" |
|
|
|
|
|
|
|
# remove debug configs |
|
|
|
rm -f .config.[1-9] |
|
|
|
|
|
|
|
if [ "$ROCKCFG_PKG_LINUX_CONFIG_STYLE" = none ] ; then |
|
|
|
if [ "$SDECFG_PKG_LINUX_CONFIG_STYLE" = none ] ; then |
|
|
|
# create a valid .config (new settings may be available etc.) |
|
|
|
yes '' | eval $MAKE oldconfig > /dev/null |
|
|
|
else |
|
|
|
cp -v .config_nomods ../linux$treever-patches/config_nomods.txt |
|
|
|
cp -v .config_modules ../linux$treever-patches/config_modules.txt |
|
|
|
fi |
|
|
|
|
|
|
|
# can fail in stage 0-1 ... |
|
|
|
if [ $stagelevel -gt 1 ] && [[ $treever = 24* ]] ; then |
|
|
|
echo "Creating dependencies (e.g. for versioned symbols) ..." |
|
|
|
eval $MAKE dep-files |
|
|
|
if grep -q "CONFIG_MODULES=y" .config ; then |
|
|
|
eval $MAKE $makeopt modules_prepare |
|
|
|
fi |
|
|
|
|
|
|
|
echo "Clean up the *.orig and *~ files ... " |
|
|
|
find -name '*.orig' -o -name '*~' | xargs rm -f |
|
|
|
rm -f .config.old |
|
|
|
|
|
|
|
echo "Copying kernel patches ... " |
|
|
|
rm -rf "$patches_dir"; mkdir -p "$patches_dir" |
|
|
|
|
|
|
|
cat <<-EOT > $patches_dir/README |
|
|
|
This directory contains all the applied patches, used |
|
|
|
to build the kernel (in addition to the official kernel sources). |
|
|
|
EOT |
|
|
|
|
|
|
|
for x in $patchfiles ; do |
|
|
|
# if the patch does not exist it was downloaded or so |
|
|
|
# and we just do not copy it ... |
|
|
|
[ ! -f "$x" ] || cp -v "$x" "$patches_dir" |
|
|
|
done |
|
|
|
|
|
|
|
if [ "$SDECFG_PKG_LINUX_CONFIG_STYLE" != none ] ; then |
|
|
|
cp -v .config_nomods "$patches_dir/config_nomods.txt" |
|
|
|
cp -v .config_modules "$patches_dir/config_modules.txt" |
|
|
|
fi |
|
|
|
cp -v .config "$patches_dir/config.txt" |
|
|
|
|
|
|
|
echo "Installing kernel sources [$lx_kernelrelease] " |
|
|
|
rm -rf $root/usr/src/{linux-$lx_kernelrelease,linux} |
|
|
|
mkdir -vp "$root/usr/src/linux-$lx_kernelrelease" |
|
|
|
ln -svnf "linux-$lx_kernelrelease" $root/usr/src/linux |
|
|
|
|
|
|
|
tar -cf - * | tar -C "$root/usr/src/linux-$lx_kernelrelease" -xf - |
|
|
|
cp -v .config "$root/usr/src/linux-$lx_kernelrelease/" |
|
|
|
} |
|
|
|
|
|
|
|
autoextract=0 ; createdocs=0 |
|
|
|
createdocs=0 |
|
|
|
srctar=none |
|
|
|
|
|
|
|
custmain="main_lx_src" |
|
|
|
patchfiles="`echo $base/package/$repository/linux$treever/*.patch` $patchfiles" |
|
|
|
|
|
|
|
for x in $( match_source_file -p patch-.* linux$treever | grep -v '\.tar\.' ); do |
|
|
|
var_insert patchfiles " " "$x" |
|
|
|
done |
|
|
|
for x in $( ls -1d $base/package/$repository/linux$treever/*.patch ); do |
|
|
|
var_append patchfiles " " "$x" |
|
|
|
done |