@fulalas
1- I noticed that your application has /usr/local/share/mkKernel/inc/Compile.inc and /usr/local/sbin/mkKernel, and both scripts call make. Why?
[/usr/local/sbin/mkKernel]
This is a CUI (character user interface) command.
It is old version. Now it is not maintenanced.
[/usr/local/share/mkKernel/inc/Compile.inc]
This shell script is dynamically included by GUI /usr/local/sbin/guimkKernel with the dot '.' command.
guimkKernel uses '.inc' files in /usr/local/share/mkKernel/inc/.
guimkKernel creates the shell script which will do the jobs that user selected via GUI window.
The created shell script (/tmp/work$$/perform) is performed by guimkKernel.
The created shell script uses commands (shell scripts) in /usr/local/share/mkKernel/bin/.
Therefore the really used shell script to build kernel is this created shell script (/tmp/work$$/perform).
You can get this created shell script by modifying guimkKernel.
This modifying guimkKernel procedure is explained at "[Detail Explanation]" in
the top article of this thread.
-------------------------------------------
Action: Compile
by checking on "compile" item.
Code: Select all
###=== Compile ===###
cd /home/guest/porteus/kernel/v4.9.167/64/
rm -fr vmlinuz lib
cd linux-4.9.167
make oldconfig
make -j4
cp arch/x86/boot/bzImage ../vmlinuz
make modules_install INSTALL_MOD_PATH=../
make firmware_install INSTALL_MOD_PATH=../ 2>/dev/null
cp .config ../64bit.config
cd ../
if [ ! -f vmlinuz -o ! -d lib ]
then
echo "compile error" >> /tmp/work951/errorMSG
exit 1
fi
DIR=`/bin/ls lib/modules/`
rm lib/modules/$DIR/build lib/modules/$DIR/source
ln -sf /usr/src/linux lib/modules/$DIR/build
ln -sf /usr/src/linux lib/modules/$DIR/source
-------------------------------------------
[How to change "make parameters" of "Kernel Builder"]
1. Get a created shell script and then modify it directly
or
2. Modify the "make" creating routine of the function "DoCompile()" of the file "/usr/local/share/mkKernel/inc/Compile.inc".
Code: Select all
#======================================
# DoCompile
#--------------------------------------
DoCompile()
{
if [ $EXCOMP = false ]
then
return 0
fi
cat >> $WORK/perform << EOF
###=== Compile ===###
cd $KDIR/v$KVER/$COMPARCH/
rm -fr vmlinuz lib
cd linux-${KVER}
make oldconfig
CPU_THREADS=\`nproc --all\`
make -j\$CPU_THREADS
cp arch/x86/boot/bzImage ../vmlinuz
make modules_install INSTALL_MOD_PATH=../
make firmware_install INSTALL_MOD_PATH=../ 2>/dev/null
cp .config ../${COMPARCH}bit.config
cd ../
if [ ! -f vmlinuz -o ! -d lib ]
then
echo "compile error" >> $WORK/errorMSG
exit 1
fi
DIR=\`/bin/ls lib/modules/\`
rm lib/modules/\$DIR/build lib/modules/\$DIR/source
ln -sf /usr/src/linux lib/modules/\$DIR/build
ln -sf /usr/src/linux lib/modules/\$DIR/source
EOF
return 0
}
Caution
Please distinguish shell instructions for "guimkKernel" and ones for "created shell script".
example:
cd $KDIR/v$KVER/$COMPARCH/ : shell instructions for "guimkKernel"
CPU_THREADS=\`nproc --all\` : shell instructions for "created shell script"
2- when it asks for GCC plugins, what you usually answer? If I try 'yes' then comes a series of questions that I'm not sure how to answer;
I don't know "GCC plugin" functions well.
https://gcc.gnu.org/wiki/plugins
But, after build start, if it might need user's interactive response,
it might be difficult for "Kernel Builder" to use "GCC plugin" functions.
3- right now I trying without GCC plugins and adding this in your Compile.inc script before calling any make:
Code: Select all
#======================================
# DoCompile
#--------------------------------------
DoCompile()
{
if [ $EXCOMP = false ]
then
return 0
fi
cat >> $WORK/perform << EOF
###=== Compile ===###
cd $KDIR/v$KVER/$COMPARCH/
rm -fr vmlinuz lib
cd linux-${KVER}
make oldconfig
## patch by fulalas 2020.01.12 ##
export CXXFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-signed-zeros -fno-trapping-math -fassociative-math -Wl,-sort-common -fvisibility-inlines-hidden"
export CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-signed-zeros -fno-trapping-math -fassociative-math -Wl,-sort-common"
export FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition"
export KBUILD_KCONFIG="--build=x86_64-linux-gnu --disable-vtable-verify --disable-werror --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-gnu-unique-object --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --enable-libmpx --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-multiarch --enable-multilib --enable-nls --enable-objc-gc=auto --enable-offload-targets=nvptx-none --enable-plugin --enable-shared --enable-threads=posix --host=x86_64-linux-gnu --program-prefix=x86_64-linux-gnu- --target=x86_64-linux-gnu --with-abi=m64 --with-arch-32=i686 --with-default-libstdcxx-abi=new --with-gcc-major-version-only --with-multilib-list=m32,m64,mx32 --with-target-system-zlib --with-tune=generic --without-cuda-driver -v"
## end of patch ##
CPU_THREADS=\`nproc --all\`
make -j\$CPU_THREADS
cp arch/x86/boot/bzImage ../vmlinuz
make modules_install INSTALL_MOD_PATH=../
make firmware_install INSTALL_MOD_PATH=../ 2>/dev/null
cp .config ../${COMPARCH}bit.config
cd ../
if [ ! -f vmlinuz -o ! -d lib ]
then
echo "compile error" >> $WORK/errorMSG
exit 1
fi
DIR=\`/bin/ls lib/modules/\`
rm lib/modules/\$DIR/build lib/modules/\$DIR/source
ln -sf /usr/src/linux lib/modules/\$DIR/build
ln -sf /usr/src/linux lib/modules/\$DIR/source
EOF
return 0
}
"Do you wanna try?"
---->
I will try the above DoCompile() that includes your patch.
Would you tell me how to change KBUILD_KCONFIG for 32bit kernel ?
---------------------------------------------------------------
The created shell script by guimkKernel that includes your patch.
Code: Select all
#!/bin/sh
###=== Compile ===###
cd /home/guest/kernel/v5.5-rc5/64/
rm -fr vmlinuz lib
cd linux-5.5-rc5
make oldconfig
## patch by fulalas 2020.01.12 ##
export CXXFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-signed-zeros -fno-trapping-math -fassociative-math -Wl,-sort-common -fvisibility-inlines-hidden"
export CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-signed-zeros -fno-trapping-math -fassociative-math -Wl,-sort-common"
export FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition"
export KBUILD_KCONFIG="--build=x86_64-linux-gnu --disable-vtable-verify --disable-werror --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-gnu-unique-object --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --enable-libmpx --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-multiarch --enable-multilib --enable-nls --enable-objc-gc=auto --enable-offload-targets=nvptx-none --enable-plugin --enable-shared --enable-threads=posix --host=x86_64-linux-gnu --program-prefix=x86_64-linux-gnu- --target=x86_64-linux-gnu --with-abi=m64 --with-arch-32=i686 --with-default-libstdcxx-abi=new --with-gcc-major-version-only --with-multilib-list=m32,m64,mx32 --with-target-system-zlib --with-tune=generic --without-cuda-driver -v"
## end of patch ##
CPU_THREADS=`nproc --all`
make -j$CPU_THREADS
cp arch/x86/boot/bzImage ../vmlinuz
make modules_install INSTALL_MOD_PATH=../
make firmware_install INSTALL_MOD_PATH=../ 2>/dev/null
cp .config ../64bit.config
cd ../
if [ ! -f vmlinuz -o ! -d lib ]
then
echo "compile error" >> /tmp/work95953/errorMSG
exit 1
fi
DIR=`/bin/ls lib/modules/`
rm lib/modules/$DIR/build lib/modules/$DIR/source
ln -sf /usr/src/linux lib/modules/$DIR/build
ln -sf /usr/src/linux lib/modules/$DIR/source
=== RESULT ===
64bit-ALL-kernel5.5-rc5-2.tar (95 M)
http://www.mediafire.com/file/g3ot2sjwg ... -rc5-2.tar
md5sum: a2fa2a8cf057209516bf62f60ba8841a 64bit-ALL-kernel5.5-rc5-2.tar
Thanks.