|
|
@ -1,3 +1,4 @@ |
|
|
|
#!/bin/bash |
|
|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
|
|
|
# |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
@ -29,6 +30,8 @@ case "$xpkg-" in |
|
|
|
pkg_linux_mode=source ;; |
|
|
|
*-src-*) |
|
|
|
abort "If you want to build a source package, use '${xpkg//src/source}'.";; |
|
|
|
*-headers-*) |
|
|
|
pkg_linux_mode=headers ;; |
|
|
|
esac |
|
|
|
|
|
|
|
echo_status "Preparing to build a linux kernel $pkg_linux_mode package." |
|
|
@ -107,30 +110,21 @@ auto_config () |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
if [ -f $base/architecture/$arch/kernel$treever.conf.sh ] ; then |
|
|
|
echo " using: architecture/$arch/kernel$treever.conf.sh" |
|
|
|
. $base/architecture/$arch/kernel$treever.conf.sh > .config |
|
|
|
elif [ -f $base/architecture/$arch/kernel$treever.conf.m4 ] ; then |
|
|
|
echo " using: architecture/$arch/kernel$treever.conf.m4" |
|
|
|
m4 -I $base/architecture/$arch -I $base/architecture/share \ |
|
|
|
$base/architecture/$arch/kernel$treever.conf.m4 > .config |
|
|
|
elif [ -f $base/architecture/$arch/kernel$treever.conf ] ; then |
|
|
|
echo " using: architecture/$arch/kernel$treever.conf" |
|
|
|
cp $base/architecture/$arch/kernel$treever.conf .config |
|
|
|
elif [ -f $base/architecture/$arch/kernel.conf.sh ] ; then |
|
|
|
echo " using: architecture/$arch/kernel.conf.sh" |
|
|
|
. $base/architecture/$arch/kernel.conf.sh > .config |
|
|
|
elif [ -f $base/architecture/$arch/kernel.conf.m4 ] ; then |
|
|
|
echo " using: architecture/$arch/kernel.conf.m4" |
|
|
|
m4 -I $base/architecture/$arch -I $base/architecture/share \ |
|
|
|
$base/architecture/$arch/kernel.conf.m4 > .config |
|
|
|
elif [ -f $base/architecture/$arch/kernel.conf ] ; then |
|
|
|
echo " using: architecture/$arch/kernel.conf" |
|
|
|
cp $base/architecture/$arch/kernel.conf .config |
|
|
|
else |
|
|
|
echo " using: no rock kernel config found" |
|
|
|
cp arch/$lx_cpu/$defconfig .config |
|
|
|
fi |
|
|
|
for x in $base/architecture/$arch/kernel{$treever,}.conf{.sh,.m4,} \ |
|
|
|
arch/$lx_cpu/$defconfig |
|
|
|
do |
|
|
|
if [ -f $x ] ; then |
|
|
|
echo " using: $x" |
|
|
|
case "${x##*.}" in |
|
|
|
m4) m4 -I $base/architecture/$arch \ |
|
|
|
-I $base/architecture/share \ |
|
|
|
$x > .config ;; |
|
|
|
sh) . $x > .config ;; |
|
|
|
*) cp $x .config ;; |
|
|
|
esac |
|
|
|
break |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
echo " merging (system default): 'arch/$lx_cpu/$defconfig'" |
|
|
|
grep '^CONF.*=y' arch/$lx_cpu/$defconfig | cut -f1 -d= | \ |
|
|
@ -142,11 +136,12 @@ auto_config () |
|
|
|
echo "Enabling all modules ..." |
|
|
|
yes '' | eval $MAKE no2modconfig > /dev/null ; cp .config .config.2 |
|
|
|
|
|
|
|
if [ -f $base/target/$target/kernel$treever.conf.sh ] ; then |
|
|
|
confscripts="$base/target/$target/kernel$treever.conf.sh $confscripts" |
|
|
|
elif [ -f $base/target/$target/kernel.conf.sh ] ; then |
|
|
|
confscripts="$base/target/$target/kernel.conf.sh $confscripts" |
|
|
|
fi |
|
|
|
for x in $base/target/$target/kernel{$treever,}.conf.sh ; do |
|
|
|
if [ -f $x ] ; then |
|
|
|
confscripts="$x $confscripts" |
|
|
|
break |
|
|
|
fi |
|
|
|
done |
|
|
|
|
|
|
|
for x in $confscripts ; do |
|
|
|
echo " running: $x" |
|
|
@ -156,8 +151,7 @@ auto_config () |
|
|
|
|
|
|
|
# merge various text/plain config files |
|
|
|
for x in $base/config/$config/linux.cfg \ |
|
|
|
$base/target/$target/kernel.conf \ |
|
|
|
$base/target/$target/kernel$treever.conf ; do |
|
|
|
$base/target/$target/kernel{,$treever}.conf ; do |
|
|
|
if [ -f $x ] ; then |
|
|
|
echo " merging: '$x'" |
|
|
|
tag="$(sed '/CONFIG_/ ! d; s,.*CONFIG_\([^ =]*\).*,\1,' \ |
|
|
@ -237,12 +231,6 @@ lx_injectextraversion () { |
|
|
|
sleep 1 ; touch Makefile |
|
|
|
eval $MAKE include/linux/version.h |
|
|
|
fi |
|
|
|
|
|
|
|
# get kernel_release |
|
|
|
lx_kernelrelease="$( echo -e "#include <linux/version.h>\nUTS_RELEASE" \ |
|
|
|
> conftest.c && \ |
|
|
|
gcc -E -I./include conftest.c | tail -n 1 \ |
|
|
|
| cut -d '"' -f 2 && rm -f conftest.c )" |
|
|
|
} |
|
|
|
|
|
|
|
lx_config () |
|
|
@ -283,6 +271,17 @@ lx_config () |
|
|
|
yes '' | eval $MAKE oldconfig > /dev/null |
|
|
|
fi |
|
|
|
|
|
|
|
# get kernel_release |
|
|
|
if [ $treever == 24 ] ; then |
|
|
|
lx_kernelrelease="$( echo -e "#include <linux/version.h>\nUTS_RELEASE" \ |
|
|
|
> conftest.c && \ |
|
|
|
gcc -E -I./include conftest.c | tail -n 1 \ |
|
|
|
| cut -d '"' -f 2 && rm -f conftest.c )" |
|
|
|
else |
|
|
|
make include/config/kernel.release |
|
|
|
lx_kernelrelease="$( < include/config/kernel.release )" |
|
|
|
fi |
|
|
|
|
|
|
|
lx_cleanup |
|
|
|
|
|
|
|
echo "Generic linux source configuration finished." |
|
|
@ -328,8 +327,9 @@ main_lx_src() { |
|
|
|
|
|
|
|
echo "Copying kernel patches ... " |
|
|
|
rm -rf linux$treever-patches ; mkdir -p linux$treever-patches |
|
|
|
echo "This directory contains all the stuff used by ROCK Linux" > linux$treever-patches/README |
|
|
|
echo "to build the Kernel (in addition to the official Kernel Sources)." >> linux$treever-patches/README |
|
|
|
{ echo "This directory contains all the stuff used by ROCK Linux to" |
|
|
|
echo "build the Kernel (in addition to the official Kernel Sources)." |
|
|
|
} > linux$treever-patches/README |
|
|
|
cp -v $patchfiles linux$treever-patches/ |
|
|
|
|
|
|
|
cd linux-${lx_kernelrelease} |
|
|
@ -491,6 +491,14 @@ main_lx() { |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
main_lx_headers() { |
|
|
|
lx_source |
|
|
|
lx_config |
|
|
|
|
|
|
|
echo "Installing Linux headers in $xroot ..." |
|
|
|
eval $MAKE headers_install INSTALL_HDR_PATH=$xroot |
|
|
|
} |
|
|
|
|
|
|
|
autoextract=0 |
|
|
|
case "$pkg_linux_mode" in |
|
|
|
source) |
|
|
@ -500,6 +508,9 @@ case "$pkg_linux_mode" in |
|
|
|
image) |
|
|
|
custmain="main_lx" |
|
|
|
;; |
|
|
|
headers) |
|
|
|
custmain="main_lx_headers" |
|
|
|
;; |
|
|
|
esac |
|
|
|
|
|
|
|
# ignore pseudo-deps to other modules |
|
|
|