You are not logged in.
Using a PKGBUILD is definitely the way to go.
I have automated the process using this script and these files. Feel free to adapt for the patches you want.
Offline
klenamenis wrote:It has probably something to do with the -march=native flag for cpu specific optimization. These are my custom CFLAGS I actually use:
CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" CXXFLAGS="${CFLAGS}"Does these parameters actually interfer with the applied GCC patch?
The linux kernel build scripts don't use environment CFLAGS, it uses its own internal KCFLAGS
Flags that matter can be configured in .config - processor, optimization (-O2,-Os), and stack protection
Correct. If you want to customize the build for your specific architecture, apply my kernel_gcc_patch which will allow you select more gcc supported options where stevenh told you about.
FYI - I use the same CFLAGS in my /etc/makepkg.conf and have not experienced any problems.
Offline
If you want to customize the build for your specific architecture, apply my kernel_gcc_patch
I'm curious if you've ever benchmarked a stock Core2 optimized build against the same config, but with your patch and march=<your cpu> selected?
The graphs on github show generic vs optimized, which yes, definitely a difference
...but anything that can take advantage of SSE4.{1,2}, AVX{,2}, or AES, it looks like there's already a specific setting for
for example see options:
CONFIG_CRYPTO_AES_NI_INTEL
Use Intel AES-NI instructions for AES algorithm.or
CONFIG_CRYPTO_SHA512_SSSE3
SHA-512 secure hash standard (DFIPS 180-2) implemented using
Supplemental SSE3 (SSSE3) instructions, or Advanced Vector
Extensions version 1 (AVX1), or Advanced Vector Extensions
version 2 (AVX2) instructions, when available.Last edited by stevenhoneyman (2014-09-11 22:09:48)
My: [ GitHub | AUR Packages ]
Offline
If you want to customize the build for your specific architecture, apply my kernel_gcc_patch which will allow you select more gcc supported options where stevenh told you about.
FYI - I use the same CFLAGS in my /etc/makepkg.conf and have not experienced any problems.
That's what I'm actually doing, but I messed up something at the beginning, which caused all this "trouble". Now everything's clear, thanks to this thread ![]()
Offline
Ok, it seems that when using the custom kernel the "old" network device name scheme (eth0) gets applied, although the stock kernel runs the the new one (enp0s20) and I configured some programs for it. Is there some option in the kernel config for it?
Furthermore, is it possible to only run xconfig/menuconfig for just editing the config file? I'd really like to adjust some settings without running makepkg over again.
Offline
Ok, it seems that when using the custom kernel the "old" network device name scheme (eth0) gets applied, although the stock kernel runs the the new one (enp0s20) and I configured some programs for it. Is there some option in the kernel config for it?
That's a systemd "feature" - check in /usr/lib/udev/rules.d/ for 80-net-setup-link.rules
Furthermore, is it possible to only run xconfig/menuconfig for just editing the config file? I'd really like to adjust some settings without running makepkg over again.
Just by compiling the kernel the original way, without involving makepkg
Last edited by stevenhoneyman (2014-09-13 14:30:06)
My: [ GitHub | AUR Packages ]
Offline
I've been playing around with kernels for the past few days and found the Linux Kernel in a Nutshell helpful.
http://www.kroah.com/lkn/
Offline
I solved the naming scheme problem just by setting the kernel's boot parameter net.ifnames=1.
Offline
Hey,
in order to use VirtualBox, according to the wiki, I just replaced the package virtualbox-host-modules by virtualbox-host-dkms and got the following error when building the modules:
[klemens@arch-pc ~]$ sudo dkms install vboxhost/$(pacman -Q virtualbox|awk {'print $2'}|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')
[sudo] password for klemens:
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area....
make KERNELRELEASE=3.16.3-1-ck2-custom -C /usr/lib/modules/3.16.3-1-ck2-custom/build M=/var/lib/dkms/vboxhost/4.3.16/build.........(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.16.3-1-ck2-custom (x86_64)
Consult /var/lib/dkms/vboxhost/4.3.16/build/make.log for more information.The corresponding make.log:
DKMS make.log for vboxhost-4.3.16 for kernel 3.16.3-1-ck2-custom (x86_64)
Fri Sep 19 19:44:41 CEST 2014
make: Entering directory '/usr/lib/modules/3.16.3-1-ck2-custom/build'
LD /var/lib/dkms/vboxhost/4.3.16/build/built-in.o
LD /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/linux/SUPDrv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/SUPDrv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/SUPDrvSem.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/SUPDrvTracer.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/alloc-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/initterm-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/memobj-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/mpnotification-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/powernotification-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/process-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/semmutex-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/spinlock-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/thread-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/thread2-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/time-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/generic/semspinmutex-r0drv-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/alloc/alloc.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/checksum/crc32.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/checksum/ipv4.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/checksum/ipv6.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/err/RTErrConvertFromErrno.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/err/RTErrConvertToErrno.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/log.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/logellipsis.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/logrel.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/logrelellipsis.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/logcom.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/log/logformat.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg1Weak.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2Add.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2AddWeak.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2AddWeakV.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2Weak.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/RTAssertMsg2WeakV.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/assert.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/handletable.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/handletablectx.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/misc/thread.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/RTStrCopy.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/RTStrCopyEx.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/RTStrCopyP.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/RTStrNCmp.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/RTStrNLen.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/stringalloc.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/strformat.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/strformatrt.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/strformattype.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/strprintf.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/string/strtonum.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/table/avlpv.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/time/time.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/r0drv/linux/RTLogWriteDebugger-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTAssertShouldPanic-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTLogWriteStdErr-stub-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTLogWriteStdOut-stub-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTLogWriteUser-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTMpGetArraySize-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTMpGetCoreCount-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTSemEventWait-2-ex-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTSemEventWaitNoResume-2-ex-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTSemEventMultiWait-2-ex-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTSemEventMultiWaitNoResume-2-ex-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/RTTimerCreate-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/errvars-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/mppresent-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/generic/uuid-generic.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/VBox/log-vbox.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/common/alloc/heapsimple.o
LD [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxdrv/vboxdrv.o
LD /var/lib/dkms/vboxhost/4.3.16/build/vboxnetadp/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetadp/linux/VBoxNetAdp-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetadp/VBoxNetAdp.o
LD [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetadp/vboxnetadp.o
LD /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/linux/VBoxNetFlt-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/VBoxNetFlt.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/SUPR0IdcClient.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/SUPR0IdcClientComponent.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/linux/SUPR0IdcClient-linux.o
LD [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxnetflt/vboxnetflt.o
LD /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/linux/VBoxPci-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/VBoxPci.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/SUPR0IdcClient.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/SUPR0IdcClientComponent.o
CC [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/linux/SUPR0IdcClient-linux.o
LD [M] /var/lib/dkms/vboxhost/4.3.16/build/vboxpci/vboxpci.o
Building modules, stage 2.
MODPOST 4 modules
FATAL: vmlinux has no symtab?
scripts/Makefile.modpost:90: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1340: recipe for target 'modules' failed
make: *** [modules] Error 2
make: Leaving directory '/usr/lib/modules/3.16.3-1-ck2-custom/build'Can somebody give me a hint? I guess it's some wrong kernel configuration, but which one? Any help would be appreciated!
Last edited by klenamenis (2014-09-19 17:50:41)
Offline
Can you see if the output of:
$ file /usr/lib/modules/3.16.3-1-ck2-custom/build/vmlinux ends with "stripped" or "not stripped"?
My: [ GitHub | AUR Packages ]
Offline
Can you see if the output of:
$ file /usr/lib/modules/3.16.3-1-ck2-custom/build/vmlinuxends with "stripped" or "not stripped"?
Stripped. Does that mean I need to change the PKGBUILD option "strip" to "!strip"?
Last edited by klenamenis (2014-09-19 21:18:53)
Offline
stevenhoneyman wrote:Can you see if the output of:
$ file /usr/lib/modules/3.16.3-1-ck2-custom/build/vmlinuxends with "stripped" or "not stripped"?
Stripped. Does that mean I need to change the PKGBUILD option "strip" to "!strip"?
!strip
It needs the symbols in vmlinux to be able to compile new modules, and strip removes them ![]()
You can still strip all of the modules if you want, but vmlinux needs to be kept unstripped
My: [ GitHub | AUR Packages ]
Offline
!strip
It needs the symbols in vmlinux to be able to compile new modules, and strip removes them
You can still strip all of the modules if you want, but vmlinux needs to be kept unstripped
Thanks, dkms built everything fine. When I try to load the module, this occurs:
[klemens@arch-pc ~]$ sudo modprobe vboxdrv
[sudo] password for klemens:
modprobe: ERROR: could not insert 'vboxdrv': Exec format errorOffline
Try adding --verbose and see if it's trying to use the wrong version
My: [ GitHub | AUR Packages ]
Offline
Try adding --verbose and see if it's trying to use the wrong version
Sadly not.
[klemens@arch-pc ~]$ sudo modprobe --verbose vboxdrv
[sudo] password for klemens:
insmod /lib/modules/3.16.3-1-ck2-custom/kernel/misc/vboxdrv.ko
modprobe: ERROR: could not insert 'vboxdrv': Exec format error
[klemens@arch-pc ~]$ uname -r
3.16.3-1-ck2-customLast edited by klenamenis (2014-09-22 23:58:50)
Offline
hmmmm... maybe a silly question, but is the "build" symlink pointing to the right source dir?
ls -l /lib/modules/$(uname -r)/buildDid you try it without dkms? I only ever used that about 4 years ago for a laptop backlight module, doubt I can be much help here ![]()
Search could be
https://bbs.archlinux.org/viewtopic.php?id=184917 seems a common issue
Last edited by stevenhoneyman (2014-09-23 00:33:16)
My: [ GitHub | AUR Packages ]
Offline
modprobe: ERROR: could not insert 'vboxdrv': Exec format errorThat looks like you are trying to load a 32 bit driver on a 64 but system, or vice versa.
Remember, just because you might have a 64 bit host, the guest can still be a 32 VM.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Well... I just reinstalled virtualbox-host-dkms and rerun dkms install and everything is working now. I don't know why...
Last edited by klenamenis (2014-09-23 03:36:02)
Offline
Didn't want to open a new thread:
Why does the linux-libre kernel replace the stock one and cannot be installed besides it like my custom kernel?
Offline
In your kernel configuration, did you change the name of your kernel ?
How are you installing the kernel?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
This is rather a question unrelated to my custom kernel, but I changed it to linux-custom.
pacaur -S linux-librewants to replace linux, linux-firmware and also binutils, etc. and I ask why.
Offline
Check the "provides=" line in the PKGBUILD.
Offline
PKGBUILD
[...]
_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname
_replacesoldkernels=('kernel26%' 'kernel26-libre%') # '%' gets replaced with _kernelname
_replacesoldmodules=('linux-libre%-kmod-alx') # '%' gets replaced with _kernelname
[...]
provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}")
conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
[...]I know I could just replace or delete this in order to keep my stock linux kernel installed, but the question actually is: Why do these lines even exist, why is the stock one intended to be replaced at all?
Offline
why is the stock one intended to be replaced at all?
There's no other reason to install linux-libre. It provides nothing new, and the only reason to install it is because one dislikes the stock kernel for ideological reasons.
Offline
why is the stock one intended to be replaced at all?
There's no other reason to install linux-libre. It provides nothing new, and the only reason to install it is because one dislikes the stock kernel for ideological reasons.
Thanks for your opinion, my technical question however remains unanswered. Do mean, it's no problem to change the PKGBUILD?
Last edited by klenamenis (2015-01-09 05:20:30)
Offline