/etc/makepkg.conf
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
to:
CFLAGS="-march=bdver2 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=bdver2 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
# one way to do the whole building the kernel stuff is this - this creates virutal environment and everything fancy
# in a way so it does not interfere with all the other stuff you have lying around.
# especially nice if you want to share the kernel. But in my case I somehow made it
# not work with the nvidia modules. Could have also been a fuck up on my end, I dunno. buildpkg -p /var/cache/manjaro-tools/pkg/$branch/$arch
# the other way is to use makepkg -s. As described further down.
git clone https://gitlab.manjaro.org/packages/core/linux56.git
git clone https://gitlab.manjaro.org/packages/extra/linux56-extramodules/nvidia-430xx
git clone https://gitlab.manjaro.org/packages/extra/linux56-extramodules/virtualbox-modules.git
git clone https://gitlab.manjaro.org/packages/extra/linux56-extramodules/r8168.git
# within linux56 folder create a new branch - this way i am able to pull in updates
git branch -b development
# substitute every occurence of MANJARO with GLINSI to effectively rename the kernel
# furthermore change the packet names
sed -i -e "s|-MANJARO|-GLINSI|" PKGBUILD
# within the pkgbuild change following line
pkgname=('linux56' 'linux56-headers')
# to
pkgname=('linux56-glinsi' 'linux56-headers-glinsi')
# if you change the pkgname you also need to change the build_pkg calls meaning from
package_linux56() {
# to
package_linux56-glinsi() {
# within the prepare() call in the PKGBUILD uncomment one of the make configuration files
# to call this during building
# with all this done run the following to update the sums which get checked during the process
# and create the package with makepkg
updpkgsums
makepkg -s
# This concludes the required work on the kernel package. After the compilation is finished
# just install the newly created kernel together with the headers by using pacman -U
# after this you also need to adjust the extramodules by using the sed command and fit the
# _linuxprefix variables and the depends and makedepends variables. To fit the makedepends
# I needed to create a new variable due to the naming concept. From there onward the concept
# stays roughly the same, as in: sed, vim PKGBUILD, updpkgsums, makepkg -s, pacman -U
# the next relevant step: put patches into the kernel e.g. for the piledriver architecture
# in my case. Shouldn't be that hard.
https://kernelnewbies.org/
https://forum.manjaro.org/t/how-to-compile-the-mainline-kernel-the-manjaro-way/51700/ (10 and 50 are the most relevant/informative posts)
https://gitlab.manjaro.org/packages/extra/linux56-extramodules
https://gitlab.manjaro.org/packages/core/linux56
# building nvidia stuff
https://forum.manjaro.org/t/building-your-own-nvidia-packages/28597