[SOLVED] Building flashcache - need kernel source?

Sorry for noob question, but..
Trying to build flashcache, and it seems that kernel source is required. How do I obtain the source?
Last edited by asg1448 (2014-07-07 22:51:15)

Trilby wrote:No, 3.15.2-1
I upgraded to 3.15.2-1-ARCH and have exactly the same issue
Note, that building of flashcache itself completes fine, the issue happens when I install the built module:
loading packages...
warning: flashcache-dkms-git-1.0.r223.g304bbc1-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...
Packages (1): flashcache-dkms-git-1.0.r223.g304bbc1-1
Total Installed Size: 0.54 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [##########################################] 100%
(1/1) checking package integrity [##########################################] 100%
(1/1) loading package files [##########################################] 100%
(1/1) checking for file conflicts [##########################################] 100%
(1/1) checking available disk space [##########################################] 100%
flashcache, 1.0.r223.g304bbc1: added
Deleting module version: 1.0.r223.g304bbc1
completely from the DKMS tree.
Done.
(1/1) reinstalling flashcache-dkms-git [##########################################] 100%
>>> DKMS: Module install
dkms install -m flashcache -v 1.0.r223.g304bbc1
Creating symlink /var/lib/dkms/flashcache/1.0.r223.g304bbc1/source ->
/usr/src/flashcache-1.0.r223.g304bbc1
DKMS: add completed.
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area....
KERNEL_TREE=/usr/lib/modules/3.15.2-1-ARCH/build make modules....(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.15.2-1-ARCH (x86_64)
Consult /var/lib/dkms/flashcache/1.0.r223.g304bbc1/build/make.log for more information.
modprobe: FATAL: Module flashcache not found.

Similar Messages

  • SOLVED: Building a streamlined kernel via modprobed-db

    Hi
    I was trying to use the modprobed_db daemon (activated by systemd) to collect all used modules on my hardware in order to build a more streamlined kernel.
    Here is the wiki:
    https://wiki.archlinux.org/index.php/Modprobed-db
    I modified the arch linux PKGBUILD of the kernel by adding these two lines:
    sudo /usr/bin/modprobed-db recall
    make localmodconfig
    Unfortunately the modprobed service doesn't catch the loop module, although I'm using it.
    I then tried to simply add some modules in ~/.config/modprobed.db, but this resulted in the error "loop: module not found", when I tried to build the kernel via makepkg.
    What is the right way to manually add modules to the modprobed database?
    thanks
    gen2arch
    Last edited by gen2arch (2015-05-02 08:50:17)

    I made a huge mistake that was the reason for the abovementioned error:
    I tried to manually add modules into the modeprobed.db and then do a "recall"  during makepkg while being already in a module-wise restricted environment of a previous custom kernel build!
    It is clear that the "recall" mechanism during the build cannot work, when the booted kernel/the running system doesn't contain the searched for modules. One has to manually add and recall modules for a custom build from within a fully fledged arch linux generic kernel where everything is at disposition and can in fact be modprobed!
    sorry for the inconvenience.
    gen2arch

  • [solved] building the kernel headers for custom kernels

    well, ive been building several different kernels for my laptop, so that i can test stuff. but ive got a problem with the kernel headers.
    ive mirrored the arch kernel's PKGBUILD and modified some naming to get a custom kernel. but when i try to build a custmo module, it complains the headers are broken. (example, vbox_build_module).
    im pasting the pkgbuild here for future reference...if someone sees something thats plain wrong, please say so.
    thanks
    # $Id: PKGBUILD 60382 2009-12-04 15:31:11Z tpowa $
    # Maintainer: Tobias Powalowski <[email protected]>
    # Maintainer: Thomas Baechler <[email protected]>
    pkgbase="kernel26"
    #pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -ARCH kernel
    pkgname=('kernel26-git' 'kernel26-git-headers') # Build kernel with a different name
    _kernelname=${pkgname#kernel26}
    pkgver=2.6.34
    pkgrel=1
    _patchname=""
    _branch="linux-2.6"
    _gittag="v2.6.34-rc3"
    #_gittag="origin"
    arch=(i686 x86_64)
    license=('GPL2')
    groups=('base')
    url="http://www.kernel.org"
    source=(config
    # standard config files for mkinitcpio ramdisk
    kernel26.preset
    ${_patchname})
    build() {
    cd ${srcdir}/$_branch
    msg "Fetching branch ${_branch}"
    ## FOR BISECT, Comment these lines
    git reset --hard
    git clean -d -f
    git fetch
    msg "Cheking out tag ${_gittag}"
    git checkout $_gittag
    ### a patch
    if [ "${_patchname}" != "" ]; then
    patch -Np1 -i ${srcdir}/$_patchname || return 1
    fi
    # if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    # else
    cat ../config >./.config
    # fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    fi
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    make menuconfig # CLI menu for configuration
    #make xconfig # X-based configuration
    #make oldconfig # using old config from previous kernel version
    # ... or manually edit .config
    # stop here
    # this is useful to configure the kernel
    #msg "Stopping build"
    #return 1
    yes "" | make config
    # build!
    make bzImage modules || return 1
    package_kernel26-git() {
    pkgdesc="The Linux Kernel and modules"
    backup=(etc/mkinitcpio.d/${pkgname}.preset)
    depends=('coreutils' 'kernel26-firmware>=2.6.32' 'module-init-tools' 'mkinitcpio>=0.5.20')
    # pwc, ieee80211 and hostap-driver26 modules are included in kernel26 now
    # nforce package support was abandoned by nvidia, kernel modules should cover everything now.
    # kernel24 support is dropped since glibc24
    replaces=('kernel24' 'kernel24-scsi' 'kernel26-scsi'
    'alsa-driver' 'ieee80211' 'hostap-driver26'
    'pwc' 'nforce' 'squashfs' 'unionfs' 'ivtv'
    'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs'
    'gspcav1' 'atl2' 'wlan-ng26' 'rt2500')
    install=kernel26.install
    optdepends=('crda: to set the correct wireless channels of your country')
    KARCH=x86
    cd ${srcdir}/$_branch
    _kernver="$(make kernelrelease)"
    mkdir -p ${pkgdir}/{lib/modules,boot}
    make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # # add vmlinux
    install -m644 -D vmlinux ${pkgdir}/usr/src/linux-${_kernver}/vmlinux
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -m644 -D ${srcdir}/kernel26.preset ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset || return 1
    # set correct depmod command for install
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
    -i $startdir/kernel26.install
    sed \
    -e "s|source .*|source /etc/mkinitcpio.d/kernel26${_kernelname}.kver|g" \
    -e "s|default_image=.*|default_image=\"/boot/${pkgname}.img\"|g" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/${pkgname}-fallback.img\"|g" \
    -i ${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset
    echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
    # remove build and source links
    rm -f ${pkgdir}/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    package_kernel26-git-headers() {
    pkgdesc="Header files and scripts for building modules for kernel26"
    mkdir -p ${pkgdir}/lib/modules/${_kernver}
    cd ${pkgdir}/lib/modules/${_kernver}
    ln -sf ../../../usr/src/linux-${_kernver} build
    cd ${srcdir}/$_branch
    install -D -m644 Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Makefile
    install -D -m644 kernel/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile
    install -D -m644 .config \
    ${pkgdir}/usr/src/linux-${_kernver}/.config
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include
    for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i ${pkgdir}/usr/src/linux-${_kernver}/include/
    done
    # copy arch includes for external modules
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/x86
    cp -a arch/x86/include ${pkgdir}/usr/src/linux-${_kernver}/arch/x86/
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers ${pkgdir}/usr/src/linux-${_kernver}
    cp -a scripts ${pkgdir}/usr/src/linux-${_kernver}
    # fix permissions on scripts dir
    chmod og-w -R ${pkgdir}/usr/src/linux-${_kernver}/scripts
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel
    cp arch/$KARCH/Makefile ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/
    fi
    cp arch/$KARCH/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
    # add headers for lirc package
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
    cp drivers/media/video/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
    done
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    ${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile
    # add dm headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    cp drivers/md/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
    # add inotify.h
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/linux
    cp include/linux/inotify.h ${pkgdir}/usr/src/linux-${_kernver}/include/linux/
    # add wireless headers
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
    cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/11194
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
    # add xfs and shmem for aufs building
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/mm
    cp fs/xfs/xfs_sb.h ${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
    # add headers vor virtualbox
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/drm $pkgdir/usr/src/linux-${_kernver}/include/
    # add headers for broadcom wl
    # in reference to:
    # http://bugs.archlinux.org/task/14568
    cp -a include/trace $pkgdir/usr/src/linux-${_kernver}/include/
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i ${pkgdir}/usr/src/linux-${_kernver}/$i
    done
    cd ${pkgdir}/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
    # add header for aufs2-util
    cp -a ${srcdir}/$_branch/include/asm-generic/bitsperlong.h ${pkgdir}/usr/src/linux-${_kernver}/include/asm/
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    # remove unneeded architectures
    rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    package_kernel26-firmware() {
    pkgdesc="The included firmware files of the Linux Kernel"
    groups=('base')
    cd ${srcdir}/$_branch
    make firmware || return 1
    make INSTALL_MOD_PATH=${pkgdir} firmware_install || return 1
    Last edited by eldragon (2010-04-04 14:58:16)

    ngoonee wrote:
    Check out this line
    for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound trace video; do
    for anything that might be missing. The error message when compiling would give you more of a clue. Off-hand, you may need to add 'generated', as I recall I needed that when the kernel moved to 2.6.33.
    Problem with vbox_build_module after Kernel update.
    Would you care to elaborate for us less versed in "Linux Geek" skills?
    Thanks.......
    [root@Arch2009p2 jeff]# vbox_build_module
    Building vboxdrv for Linux 2.6.33-ARCH
    make[1]: Entering directory `/opt/VirtualBox/src/vboxdrv'
    for f in . linux r0drv r0drv/generic r0drv/linux VBox common/err common/string common/log generic math/gcc; \
    do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
    rm -rf .vboxdrv* .tmp_ver* vboxdrv.* Module.symvers Modules.symvers modules.order
    make[1]: Leaving directory `/opt/VirtualBox/src/vboxdrv'
    make[1]: Entering directory `/opt/VirtualBox/src/vboxnetflt'
    for f in . linux r0drv r0drv/linux VBox common/err common/string common/log generic math/gcc; \
    do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
    rm -rf .vboxnetflt* .tmp_ver* vboxnetflt.* Modules.symvers modules.order
    make[1]: Leaving directory `/opt/VirtualBox/src/vboxnetflt'
    make[1]: Entering directory `/opt/VirtualBox/src/vboxnetadp'
    for f in . linux r0drv r0drv/linux VBox common/err common/string common/log generic math/gcc; \
    do rm -f $f/*.o $f/.*.cmd $f/.*.flags; done
    rm -rf .vboxnetadp* .tmp_ver* vboxnetadp.* Modules.symvers modules.order
    make[1]: Leaving directory `/opt/VirtualBox/src/vboxnetadp'
    rm -f vboxdrv.ko vboxnetflt.ko vboxnetadp.ko
    *** Building 'vboxdrv' module ***
    make[1]: Entering directory `/opt/VirtualBox/src/vboxdrv'
    make KBUILD_VERBOSE= -C /lib/modules/2.6.33-ARCH/build SUBDIRS=/opt/VirtualBox/src/vboxdrv SRCROOT=/opt/VirtualBox/src/vboxdrv modules
    make[2]: Entering directory `/usr/src/linux-2.6.33-ARCH'
    CC [M] /opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.o
    In file included from /opt/VirtualBox/src/vboxdrv/include/VBox/types.h:34,
    from /opt/VirtualBox/src/vboxdrv/linux/../SUPDrvInternal.h:39,
    from /opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.c:37:
    /opt/VirtualBox/src/vboxdrv/include/iprt/types.h:100:30: error: linux/autoconf.h: No such file or directory
    make[3]: *** [/opt/VirtualBox/src/vboxdrv/linux/SUPDrv-linux.o] Error 1
    make[2]: *** [_module_/opt/VirtualBox/src/vboxdrv] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.6.33-ARCH'
    make[1]: *** [vboxdrv] Error 2
    make[1]: Leaving directory `/opt/VirtualBox/src/vboxdrv'
    make: *** [all] Error 2

  • Compiling a driver, need assistance on kernel source configuration

    Hello BBS.
    I am compiling a module for the Asus PCE N53 wireless pci-e card. I have obtained the driver source, and followed the instructions, and have gotten to the point where I need assistance. The instructions requires the kernel source, i have successfully obtained and configured it using the Command line prompt, except for one feature. I need to enable the intel IPW2200 driver code in the kernel source for this driver. What procedure do I follow to enable it?

    > I know in face value, that my request may seem odd. I just need to use the source of the kernel, not a new kernel... I have found that what I am requesting... will fix the problem, based on a Gentoo solution: http://forums.gentoo.org/viewtopic-t-93 … art-0.html. Needing to know how to configure the kernel source to enable the intel driver still stands. The source I am using is the latest arch kernel source.
    ===============
    RT5592 Linux Driver quick start       
    ====================
    Check tools: 
    ====================
    *Before install driver, please check already install compile tool and  kernel source code
    1>Install compile tool
        $yum install gcc-c++
    2>check kernel source code exists /usr/src/kernels/ "kernel name"
        Download your kernel source code
        *http://www.kernel.org/pub/linux/kernel/        
        or
        $yum install kernel-devel
    ====================
    Build Instructions: 
    ====================
    1> $tar -jxvf DPO_GPL_RT5592STA_LinuxSTA_vx.x.x.x.tar.bz2
         go to "DPO_GPL_RT5592STA_LinuxSTA_vx.x.x.x" directory.
    2> In Makefile
         set the "MODE = STA" in Makefile and chose the TARGET to Linux by set "TARGET = LINUX"
         define the linux kernel source include file path LINUX_SRC
         modify to meet your need.
    3> In os/linux/config.mk
         define the GCC and LD of the target machine
         define the compiler flags CFLAGS
         modify to meet your need.
         ** Build for being controlled by NetworkManager or wpa_supplicant wext functions
             Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
             => $wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
         ** Build for being controlled by WpaSupplicant with Ralink Driver
             Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
             => $wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d
    4> $make           
         # compile driver source code, need administrator.
         # To fix "error: too few arguments to function ¡¥iwe_stream_add_event"
            => $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c
    5> $make install
         #install driver
         #copy RT2860STA.dat to /etc/Wireless/RT2860STA/RT2860STA.dat
    6>$vi /etc/rc.d/rc.local
         #input "ifconfig ra0 up"
        $reboot
    7> unload driver   
         $ifconfig ra0 down
         $rmmod rt5592sta
    ======
    Heres the output of my error, when I compile:
    =======
    make -C tools
    make[1]: Entering directory `/home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/tools'
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/tools/bin2h
    cp -f os/linux/Makefile.6 /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/Makefile
    make -C /home/white/linux-3.2.9 SUBDIRS=/home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux modules
    make[1]: Entering directory `/home/white/linux-3.2.9'
      WARNING: Symbol version dump /home/white/linux-3.2.9/Module.symvers
               is missing; modules will have no dependencies and modversions.
      CC [M]  /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.o
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2364:2: error: unknown field ‘private’ specified in initializer
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2364:2: warning: initialization from incompatible pointer type [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2364:2: warning: (near initialization for ‘rt28xx_iw_handler_def.get_wireless_stats’) [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2365:2: error: unknown field ‘num_private’ specified in initializer
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2365:2: warning: excess elements in struct initializer [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2365:2: warning: (near initialization for ‘rt28xx_iw_handler_def’) [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2366:2: error: unknown field ‘private_args’ specified in initializer
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2366:26: warning: excess elements in struct initializer [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2366:26: warning: (near initialization for ‘rt28xx_iw_handler_def’) [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2367:2: error: unknown field ‘num_private_args’ specified in initializer
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2367:2: warning: excess elements in struct initializer [enabled by default]
    /home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.c:2367:2: warning: (near initialization for ‘rt28xx_iw_handler_def’) [enabled by default]
    make[2]: *** [/home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux/../../os/linux/sta_ioctl.o] Error 1
    make[1]: *** [_module_/home/white/driver/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/os/linux] Error 2
    make[1]: Leaving directory `/home/white/linux-3.2.9'
    make: *** [LINUX] Error 2
    Last edited by confusedoldman (2012-12-25 20:14:34)

  • [solved]kernel source

    I do apologize - but where the heck do I find the kernel source that's being used by archlinux??
    I used to roll my own sources frequently, but ever since discovering arch - I'm more than  happy to use the default ...
    I keep a local mirror of the official one - but I'm darned if I can see any kernel sources there :-(
    This time I do need to roll my own - a 'dell precision m90' does not cater for backlight (.../drivers/acpi/video.c), so I need the patched version.
    Could anyone plueeze enlighten me? (and yes, I _have_ checked /usr/src/linux-3.4.4-3-ARCH/ - no source there ...)
    Last edited by perbh (2012-07-18 13:43:04)

    You can get the PKGBUILD and local source files from here. You can find other packages by following the "Packages" link at the top of the page.
    Once you have those, just run "makepkg -o" to download and extract the upstream sources. You will then have everything (sources + patches).
    You can use pbget to automatically retrieve PKGBUILDs for packages too.
    edit:
    If you mean the headers, then check the following packages:
    linux-api-headers
    linux-headers
    Last edited by Xyne (2012-07-18 04:32:29)

  • [SOLVED] Where can I browse the Arch kernel source?

    I tried to look for the kernel source code under /usr/src/linux-3.4.9-1-ARCH but there's only a binary file (an image?) vmlinuz in there. I wanted to look for drivers concerning usb for fun, but I can't seem to find the excact location of the kernel source code.
    Last edited by burninate (2012-08-25 09:48:56)

    Sure you can, but it'll pretty much be the same as if you downloaded the code from kernel.org. You can use makepkg and the ABS to easily get the source and Arch's patch(es) on your computer.
    Edit: If you have linux-headers installed, then the path HalosGhost refers to has the headers, not the full source
    Last edited by SidK (2012-08-22 19:29:08)

  • [SOLVED] [makepkg] attempts to process source files multiple times

    OK, so I decided I was going to update the PKGBUILD for linux-lts-tresor to the new format with separate sources for different architectures and PGP keys, having successfully done it for the nvidia packages I maintain and I get the following issue when I run mkaurball on the linux-lts-tresor PKGBUILD:
    claire ~/Builds/linux-lts-tresor % mkaurball
    ==> Making package: linux-lts-tresor 3.14.28-1 (Fri 9 Jan 10:51:06 GMT 2015)
    ==> Retrieving sources...
    -> Found linux-3.14.tar.xz
    -> Found linux-3.14.tar.sign
    -> Found patch-3.14.28.xz
    -> Found patch-3.14.28.sign
    -> Found config
    -> Found config.x86_64
    -> Found linux-lts-tresor.preset
    -> Found linux-lts-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
    -> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
    -> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
    -> Found 0006-genksyms-fix-typeof-handling.patch
    -> Found tresor_sysfs.c
    -> Found tresor-patch-3.6.2_i686
    -> Found tresor-patch-3.6.2_i686.patch
    -> Found tresor-patch-3.6.2_i686.patch.sig
    -> Found patch-3.14.28.sign
    -> Found config
    -> Found config.x86_64
    -> Found linux-lts-tresor.preset
    -> Found linux-lts-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
    -> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
    -> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
    -> Found 0006-genksyms-fix-typeof-handling.patch
    -> Found tresor_sysfs.c
    -> Found tresor-patch-3.8.2_aesni
    -> Found tresor-patch-3.8.2_aesni.patch
    -> Found tresor-patch-3.8.2_aesni.patch.sig
    -> Found patch-3.14.28.sign
    -> Found config
    -> Found config.x86_64
    -> Found linux-lts-tresor.preset
    -> Found linux-lts-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Found 0001-Bluetooth-allocate-static-minor-for-vhci.patch
    -> Found 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch
    -> Found 0003-module-remove-MODULE_GENERIC_TABLE.patch
    -> Found 0006-genksyms-fix-typeof-handling.patch
    -> Found tresor_sysfs.c
    ==> Validating source files with sha256sums...
    linux-3.14.tar.xz ... Passed
    linux-3.14.tar.sign ... Skipped
    patch-3.14.28.xz ... Passed
    patch-3.14.28.sign ... Skipped
    config ... Passed
    config.x86_64 ... Passed
    linux-lts-tresor.preset ... Passed
    linux-lts-tresor.install ... Passed
    change-default-console-loglevel.patch ... Passed
    0001-Bluetooth-allocate-static-minor-for-vhci.patch ... Passed
    0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch ... Passed
    0003-module-remove-MODULE_GENERIC_TABLE.patch ... Passed
    0006-genksyms-fix-typeof-handling.patch ... Passed
    tresor_sysfs.c ... Passed
    ==> Validating source files with sha256sums...
    tresor-patch-3.6.2_i686 ... Passed
    tresor-patch-3.6.2_i686.patch ... Passed
    tresor-patch-3.6.2_i686.patch.sig ... Skipped
    ==> Validating source files with sha256sums...
    tresor-patch-3.8.2_aesni ... Passed
    tresor-patch-3.8.2_aesni.patch ... Passed
    tresor-patch-3.8.2_aesni.patch.sig ... Skipped
    ==> Verifying source file signatures with gpg...
    linux-3.14.tar ... Passed
    patch-3.14.28 ... Passed
    tresor-patch-3.6.2_i686.patch ... Passed
    patch-3.14.28 ... Passed
    tresor-patch-3.8.2_aesni.patch ... Passed
    patch-3.14.28 ... Passed
    ==> Entering fakeroot environment...
    ==> Creating source package...
    -> Adding PKGBUILD...
    -> Generating .SRCINFO file...
    -> Adding config...
    -> Adding config.x86_64...
    -> Adding linux-lts-tresor.preset...
    -> Adding linux-lts-tresor.install...
    -> Adding change-default-console-loglevel.patch...
    -> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
    -> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
    -> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
    -> Adding 0006-genksyms-fix-typeof-handling.patch...
    -> Adding tresor-patch-3.6.2_i686.patch...
    -> Adding tresor-patch-3.6.2_i686.patch.sig...
    -> Adding config...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config’: File exists
    -> Adding config.x86_64...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config.x86_64’: File exists
    -> Adding linux-lts-tresor.preset...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.preset’: File exists
    -> Adding linux-lts-tresor.install...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.install’: File exists
    -> Adding change-default-console-loglevel.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/change-default-console-loglevel.patch’: File exists
    -> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0001-Bluetooth-allocate-static-minor-for-vhci.patch’: File exists
    -> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch’: File exists
    -> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0003-module-remove-MODULE_GENERIC_TABLE.patch’: File exists
    -> Adding 0006-genksyms-fix-typeof-handling.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0006-genksyms-fix-typeof-handling.patch’: File exists
    -> Adding tresor-patch-3.8.2_aesni.patch...
    -> Adding tresor-patch-3.8.2_aesni.patch.sig...
    -> Adding config...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config’: File exists
    -> Adding config.x86_64...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/config.x86_64’: File exists
    -> Adding linux-lts-tresor.preset...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.preset’: File exists
    -> Adding linux-lts-tresor.install...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/linux-lts-tresor.install’: File exists
    -> Adding change-default-console-loglevel.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/change-default-console-loglevel.patch’: File exists
    -> Adding 0001-Bluetooth-allocate-static-minor-for-vhci.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0001-Bluetooth-allocate-static-minor-for-vhci.patch’: File exists
    -> Adding 0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch’: File exists
    -> Adding 0003-module-remove-MODULE_GENERIC_TABLE.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0003-module-remove-MODULE_GENERIC_TABLE.patch’: File exists
    -> Adding 0006-genksyms-fix-typeof-handling.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-lts-tresor/srclinks.Qb2SC9gzL/linux-lts-tresor/0006-genksyms-fix-typeof-handling.patch’: File exists
    -> Compressing source package...
    ==> Leaving fakeroot environment.
    ==> Source package created: linux-lts-tresor (Fri 9 Jan 10:51:25 GMT 2015)
    Here is the PKGBUILD:
    # Maintainers:
    # Claire Farron <[email protected]>
    # Andes Ho <[email protected]> (Secondary Package Tester)
    # Former Maintainer(s)
    # Ido Rosen <[email protected]>
    # xerc <aur[at]xerc.de>
    # Contributor: tresor-patch-3.6.2_i686.patch and consolidation of patches
    # Seth Dickson <[email protected]>
    # Contributor(s) of the linux PKGBUILD
    # Tobias Powalowski <[email protected]>
    # Thomas Baechler <[email protected]>
    ### Do not edit below this line unless you know what you're doing
    pkgbase=linux-lts-tresor # Build stock -lts kernel with TRESOR patches
    #pkgbase=linux-custom # Build kernel with a different name
    _srcname=linux-3.14
    pkgname=linux-lts-tresor # placeholder
    pkgdesc="Linux longterm stable kernel and modules with integrated TRESOR"
    pkgver=3.14.28
    pkgrel=1
    arch=('i686' 'x86_64')
    url="http://www1.informatik.uni-erlangen.de/tresor"
    license=('GPL2')
    makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
    options=('!strip')
    source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
    "https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.sign"
    "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
    "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.sign"
    # the main kernel config files
    'config' 'config.x86_64'
    # standard config files for mkinitcpio ramdisk
    "${pkgbase}.preset"
    "${pkgbase}.install"
    'change-default-console-loglevel.patch'
    '0001-Bluetooth-allocate-static-minor-for-vhci.patch'
    '0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch'
    '0003-module-remove-MODULE_GENERIC_TABLE.patch'
    '0006-genksyms-fix-typeof-handling.patch'
    'http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor_sysfs.c')
    source_i686+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.6.2_i686"
    'tresor-patch-3.6.2_i686.patch'
    'tresor-patch-3.6.2_i686.patch.sig')
    source_x86_64+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.8.2_aesni"
    'tresor-patch-3.8.2_aesni.patch'
    'tresor-patch-3.8.2_aesni.patch.sig')
    sha256sums=('61558aa490855f42b6340d1a1596be47454909629327c49a5e4e10268065dffa'
    'SKIP'
    'e3c79a30ac959c84c329be5461da88a5c79c6463da30d376c27bb103aee79b51'
    'SKIP'
    '6291d78969d8db94525d9614fa15c6a5db97b070af50d84f68d32ecd5f40fd69'
    '145a66ef4f702ed516a57d846dd00b5acac7b5cc1eff86d1e7ee6bd5a66040b2'
    '003b45593f1b5cdb81ea2da6ab67deef04402eb15aae231921ff55f65948fbdd'
    'edb6d4ed9ca2af1ffc15ddbf195152c219e77bd12da3ea176c5c24afc0a779d4'
    'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182'
    '6d72e14552df59e6310f16c176806c408355951724cd5b48a47bf01591b8be02'
    '52dec83a8805a8642d74d764494acda863e0aa23e3d249e80d4b457e20a3fd29'
    '65d58f63215ee3c5f9c4fc6bce36fc5311a6c7dbdbe1ad29de40647b47ff9c0d'
    'cf2e7a2d00787f754028e7459688c2755a406e632ce48b60952fa4ff7ed6f4b7'
    'd6fcbd0ea7a5a4c42d326286b60bbd5b1d476b8a6752046fa28133e05351c1fe')
    sha256sums_i686=('9a286a85c16ca5b6a02419af1aedbfe6e8b89bcabdcb32670ead3f26c09eadfd'
    '2fb8c26e237883f39de57a264873b21bcdfc5b6b0c1e7c60cec8d141e5db33ba'
    'SKIP')
    sha256sums_x86_64=('54009b369b95a77ab13f6dd7cdbe22b0785b6314cae3a6c39190b48f4c4b12ce'
    '6d0580f05db9cf47dd097326c2f3c0e493854493544d32692ab63290e12fc3e1'
    'SKIP')
    validpgpkeys=(
    'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
    '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
    '5F885602C7FD0951F565E27949F67298E6366A92' # Claire Farron
    [[ "$CARCH" = "i686" ]] && _tresorpatch="tresor-patch-3.6.2_i686"
    [[ "$CARCH" = "x86_64" ]] && _tresorpatch="tresor-patch-3.8.2_aesni"
    _kernelname=${pkgbase#linux}
    prepare() {
    cd "${srcdir}/${_srcname}"
    # add upstream patch
    patch -p1 -i "${srcdir}/patch-${pkgver}"
    # add latest fixes from stable queue, if needed
    # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
    # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
    # remove this when a Kconfig knob is made available by upstream
    # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
    patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
    # Fix vhci warning in kmod (to restore every kernel maintainer's sanity)
    msg "Patching source to fix vhci warning in kmod"
    patch -p1 -i "${srcdir}/0001-Bluetooth-allocate-static-minor-for-vhci.patch"
    # Fix atkbd aliases
    msg "Patching source to fix atkbd aliases"
    patch -p1 -i "${srcdir}/0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch"
    patch -p1 -i "${srcdir}/0003-module-remove-MODULE_GENERIC_TABLE.patch"
    # Fix generation of symbol CRCs
    # http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dc53324060f324e8af6867f57bf4891c13c6ef18
    msg "Patching source to fix generation of symbol CRCs"
    patch -p1 -i "${srcdir}/0006-genksyms-fix-typeof-handling.patch"
    # TRESOR Runs Encryption Securely Outside RAM
    # i.e. the purpose of this package :-)
    msg "Patching TRESOR for linux"
    # Initialized the patched TRESOR file with the upstream patch.
    cp "${srcdir}/${_tresorpatch}" "${_tresorpatch}.patched"
    patch --follow-symlinks "${_tresorpatch}.patched" "${srcdir}/${_tresorpatch}.patch"
    msg "Patching source with TRESOR"
    patch -p1 -i "${_tresorpatch}.patched"
    if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
    else
    cat "${srcdir}/config" > ./.config
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
    fi
    # set extraversion to pkgrel
    sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
    # don't run depmod on 'make install'. We'll do this ourselves in packaging
    sed -i '2iexit 0' scripts/depmod.sh
    cd "${srcdir}"
    cc tresor_sysfs.c -o tresor_sysfs
    cd "${srcdir}/${_srcname}"
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    #make menuconfig # CLI menu for configuration
    #make nconfig # new CLI menu for configuration
    #make xconfig # X-based configuration
    #make oldconfig # using old config from previous kernel version
    # ... or manually edit .config
    # rewrite configuration
    #yes "" | make config >/dev/null
    make oldconfig
    # save configuration for later reuse
    # if [ "${CARCH}" = "x86_64" ]; then
    # cat .config > "${startdir}/config.x86_64.last"
    # else
    # cat .config > "${startdir}/config.last"
    # fi
    build() {
    cd "${srcdir}/${_srcname}"
    make ${MAKEFLAGS} LOCALVERSION= bzImage modules
    _package() {
    true && pkgdesc="The ${pkgbase/linux/Linux} kernel and modules - stable longtime supported with integrated TRESOR"
    depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
    optdepends=('crda: to set the correct wireless channels of your country')
    provides=("kernel26${_kernelname}=${pkgver}")
    conflicts=("kernel26${_kernelname}")
    replaces=("kernel26${_kernelname}")
    backup=("etc/mkinitcpio.d/${pkgbase}.preset")
    install=${pkgbase}.install
    # TRESOR sysfs utility - not necessary but nice to have, in case someone
    # enables CONFIG_TRESOR_SYSFS in a fork of this PKGBUILD...
    cd "${srcdir}"
    install -D -m755 tresor_sysfs "${pkgdir}/usr/bin/tresor_sysfs"
    cd "${srcdir}/${_srcname}"
    KARCH=x86
    # get kernel version
    _kernver="$(make LOCALVERSION= kernelrelease)"
    _basekernel=${_kernver%%-*}
    _basekernel=${_basekernel%.*}
    mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
    make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
    cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
    # set correct depmod command for install
    cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
    true && install=${install}.pkg
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
    -i "${startdir}/${install}"
    # install mkinitcpio preset file for kernel
    install -D -m644 "${srcdir}/${pkgbase}.preset" \
    "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
    sed \
    -e "1s|'linux.*'|'${pkgbase}'|" \
    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
    -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
    # remove build and source links
    rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf "${pkgdir}/lib/firmware"
    # gzip -9 all modules to save 100MB of space
    find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
    # make room for external modules
    ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" \
    "${pkgdir}/lib/modules/${_kernver}/extramodules"
    # add real version for building modules and running depmod from post_install/upgrade
    mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
    echo "${_kernver}" > \
    "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
    # Now we call depmod...
    depmod -b "${pkgdir}" -F System.map "${_kernver}"
    # move module tree /lib -> /usr/lib
    mkdir -p "${pkgdir}/usr"
    mv "${pkgdir}/lib" "${pkgdir}/usr/"
    # add vmlinux
    install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
    _package-headers() {
    true && pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
    provides=("kernel26${_kernelname}-headers=${pkgver}")
    conflicts=("kernel26${_kernelname}-headers")
    replaces=("kernel26${_kernelname}-headers")
    install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
    cd "${srcdir}/${_srcname}"
    install -D -m644 Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
    install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
    install -D -m644 .config \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
    for i in acpi asm-generic config crypto drm generated keys linux math-emu \
    media net pcmcia scsi sound trace uapi video xen; do
    cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
    done
    # copy arch includes for external modules
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
    cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
    cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
    # fix permissions on scripts dir
    chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
    cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
    if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
    fi
    cp arch/${KARCH}/kernel/asm-offsets.s \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
    # add dm headers
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
    cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
    # add inotify.h
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
    cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
    # add wireless headers
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
    cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
    cp drivers/media/dvb-core/*.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
    # and...
    # http://bugs.archlinux.org/task/11194
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
    cp include/config/dvb/*.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    cp drivers/media/dvb-frontends/lgdt330x.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
    cp drivers/media/i2c/msp3400-driver.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
    # add dvb headers
    # in reference to:
    # http://bugs.archlinux.org/task/20402
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
    cp drivers/media/usb/dvb-usb/*.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
    cp drivers/media/dvb-frontends/*.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
    cp drivers/media/tuners/*.h \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
    # add xfs and shmem for aufs building
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
    cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
    # copy in Kconfig files
    for i in $(find . -name "Kconfig*"); do
    mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
    done
    chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
    find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
    # strip scripts directory
    find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
    *application/x-sharedlib*) # Libraries (.so)
    /usr/bin/strip ${STRIP_SHARED} "${binary}";;
    *application/x-archive*) # Libraries (.a)
    /usr/bin/strip ${STRIP_STATIC} "${binary}";;
    *application/x-executable*) # Binaries
    /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
    done
    # remove unneeded architectures
    rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
    _package-docs() {
    true && pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
    provides=("kernel26${_kernelname}-docs=${pkgver}")
    conflicts=("kernel26${_kernelname}-docs")
    replaces=("kernel26${_kernelname}-docs")
    cd "${srcdir}/${_srcname}"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
    cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
    find "${pkgdir}" -type f -exec chmod 444 {} \;
    find "${pkgdir}" -type d -exec chmod 755 {} \;
    # remove a file already in linux package
    rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
    # true && is a workaround for AUR problem with split packages:
    true && pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
    for _p in ${pkgname[@]}; do
    eval "package_${_p}() {
    _package${_p#${pkgbase}}
    done
    EDIT: Here is the resulting source tarball for mkaurball.
    Last edited by clfarron4 (2015-01-12 09:37:11)

    OK, so either I'm committing a huge stupid with both TRESOR packages or there is actually a problem with makepkg. I've done similar changes with the linux-tresor PKGBUILD and it's doing the same thing.
    PKGBUILD:
    # Maintainers:
    # Claire Farron <[email protected]>
    # Andes Ho <[email protected]> (Secondary Package Tester)
    # Former Maintainer(s)
    # Ido Rosen <[email protected]>
    # xerc <aur[at]xerc.de>
    # Contributor(s) of tresor-patch-3.6.2_i686.patch and consolidation of patches
    # Seth Dickson <[email protected]>
    # Contributor(s) of the linux PKGBUILD
    # Tobias Powalowski <[email protected]>
    # Thomas Baechler <[email protected]>
    ### Do not edit below this line unless you know what you're doing
    pkgbase=linux-tresor # Build stock kernel with TRESOR patches
    #pkgbase=linux-custom # Build kernel with a different name
    _srcname=linux-3.18
    pkgver=3.18.2
    pkgrel=1
    arch=('i686' 'x86_64')
    url="http://www1.informatik.uni-erlangen.de/tresor"
    license=('GPL2')
    makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
    options=('!strip')
    source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
    "https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.sign"
    "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
    "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.sign"
    # the main kernel config files
    'config' 'config.x86_64'
    # standard config files for mkinitcpio ramdisk
    "${pkgbase}.preset"
    "${pkgbase}.install"
    'change-default-console-loglevel.patch'
    'http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor_sysfs.c')
    source_i686+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.6.2_i686"
    'tresor-patch-3.6.2_i686.patch'
    'tresor-patch-3.6.2_i686.patch.sig')
    source_x86_64+=("http://www1.informatik.uni-erlangen.de/filepool/projects/tresor/tresor-patch-3.8.2_aesni"
    'tresor-patch-3.8.2_aesni.patch'
    'tresor-patch-3.8.2_aesni.patch.sig')
    sha256sums=('becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd'
    'SKIP'
    '927a30c152a193d22242de21b99c9765fb0086b0aa3fabd31938ffc6e1b3f37c'
    'SKIP'
    'b0f867da9c07d778014c52afe2df59b86122b0d4de2ea8003303855a0750e90d'
    'b76fa6691c4ab19d11e346112e8c021c88578950ed19468f115905e74cb0495e'
    'e17c0209dcb887173adbb4cc69fe0799b01ed9b9b7c487d1d023daa99ee073e1'
    '390c0b348c0f42ba760587e9df3098c62a3b6bd5d522eefb51c7a18f29069751'
    '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
    'd6fcbd0ea7a5a4c42d326286b60bbd5b1d476b8a6752046fa28133e05351c1fe')
    sha256sums_i686=('9a286a85c16ca5b6a02419af1aedbfe6e8b89bcabdcb32670ead3f26c09eadfd'
    '800f592847d2a20679630491b8f657cb912abc65f9f2daecf804b6dc2f3b9352'
    'SKIP')
    sha256sums_x86_64=('54009b369b95a77ab13f6dd7cdbe22b0785b6314cae3a6c39190b48f4c4b12ce'
    '9415840fe80f4e2f2b44c0762d8c650e5119fadc3cb494c4812406f6627f26c3'
    'SKIP')
    validpgpkeys=(
    'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
    '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
    '5F885602C7FD0951F565E27949F67298E6366A92' # Claire Farron
    [[ "$CARCH" = "i686" ]] && _tresorpatch="tresor-patch-3.6.2_i686"
    [[ "$CARCH" = "x86_64" ]] && _tresorpatch="tresor-patch-3.8.2_aesni"
    _kernelname=${pkgbase#linux}
    prepare() {
    cd "${srcdir}/${_srcname}"
    # add upstream patch
    patch -p1 -i "${srcdir}/patch-${pkgver}"
    # add latest fixes from stable queue, if needed
    # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
    # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
    # remove this when a Kconfig knob is made available by upstream
    # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
    patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
    # TRESOR Runs Encryption Securely Outside RAM
    # i.e. the purpose of this package :-)
    msg "Patching TRESOR for linux"
    # Initialized the patched TRESOR file with the upstream patch.
    cp "${srcdir}/${_tresorpatch}" "${_tresorpatch}.patched"
    patch --follow-symlinks "${_tresorpatch}.patched" "${srcdir}/${_tresorpatch}.patch"
    msg "Patching source with TRESOR"
    patch -p1 -i "${_tresorpatch}.patched"
    if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
    else
    cat "${srcdir}/config" > ./.config
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
    fi
    # set extraversion to pkgrel
    sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
    # don't run depmod on 'make install'. We'll do this ourselves in packaging
    sed -i '2iexit 0' scripts/depmod.sh
    cd "${srcdir}"
    cc tresor_sysfs.c -o tresor_sysfs
    cd "${srcdir}/${_srcname}"
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    #make menuconfig # CLI menu for configuration
    #make nconfig # new CLI menu for configuration
    #make xconfig # X-based configuration
    #make oldconfig # using old config from previous kernel version
    # ... or manually edit .config
    # rewrite configuration
    #yes "" | make config >/dev/null
    make oldconfig
    # save configuration for later reuse
    # if [ "${CARCH}" = "x86_64" ]; then
    # cat .config > "${startdir}/config.x86_64.last"
    # else
    # cat .config > "${startdir}/config.last"
    # fi
    build() {
    cd "${srcdir}/${_srcname}"
    make ${MAKEFLAGS} LOCALVERSION= bzImage modules
    _package() {
    pkgdesc="The ${pkgbase/linux/Linux} kernel and modules with integrated TRESOR"
    [ "${pkgbase}" = "linux" ] && groups=('base')
    depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
    optdepends=('crda: to set the correct wireless channels of your country')
    provides=("kernel26${_kernelname}=${pkgver}")
    conflicts=("kernel26${_kernelname}")
    replaces=("kernel26${_kernelname}")
    backup=("etc/mkinitcpio.d/${pkgbase}.preset")
    install=${pkgbase}.install
    # TRESOR sysfs utility - not necessary but nice to have, in case someone
    # enables CONFIG_TRESOR_SYSFS in a fork of this PKGBUILD...
    cd "${srcdir}"
    install -D -m755 tresor_sysfs "${pkgdir}/usr/bin/tresor_sysfs"
    cd "${srcdir}/${_srcname}"
    KARCH=x86
    # get kernel version
    _kernver="$(make LOCALVERSION= kernelrelease)"
    _basekernel=${_kernver%%-*}
    _basekernel=${_basekernel%.*}
    mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
    make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
    cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
    # set correct depmod command for install
    cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
    true && install=${install}.pkg
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
    -i "${startdir}/${install}"
    # install mkinitcpio preset file for kernel
    install -D -m644 "${srcdir}/${pkgbase}.preset" \
    "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
    sed \
    -e "1s|'linux.*'|'${pkgbase}'|" \
    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
    -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
    # remove build and source links
    rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf "${pkgdir}/lib/firmware"
    # gzip -9 all modules to save 100MB of space
    find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
    # make room for external modules
    ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
    # add real version for building modules and running depmod from post_install/upgrade
    mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
    echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
    # Now we call depmod...
    depmod -b "${pkgdir}" -F System.map "${_kernver}"
    # move module tree /lib -> /usr/lib
    mkdir -p "${pkgdir}/usr"
    mv "${pkgdir}/lib" "${pkgdir}/usr/"
    # add vmlinux
    install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
    _package-headers() {
    pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
    provides=("kernel26${_kernelname}-headers=${pkgver}")
    conflicts=("kernel26${_kernelname}-headers")
    replaces=("kernel26${_kernelname}-headers")
    install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
    cd "${srcdir}/${_srcname}"
    install -D -m644 Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
    install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
    install -D -m644 .config \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
    for i in acpi asm-generic config crypto drm generated keys linux math-emu \
    media net pcmcia scsi sound trace uapi video xen; do
    cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
    done
    # copy arch includes for external modules
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
    cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
    cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
    # fix permissions on scripts dir
    chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
    cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
    if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
    fi
    cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
    # add dm headers
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
    cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
    # add inotify.h
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
    cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"
    # add wireless headers
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
    cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
    cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
    # and...
    # http://bugs.archlinux.org/task/11194
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
    cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
    cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
    # add dvb headers
    # in reference to:
    # http://bugs.archlinux.org/task/20402
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
    cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
    cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
    cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"
    # add xfs and shmem for aufs building
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
    # removed in 3.17 series
    # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"
    # copy in Kconfig files
    for i in $(find . -name "Kconfig*"); do
    mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
    done
    chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
    find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
    # strip scripts directory
    find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
    *application/x-sharedlib*) # Libraries (.so)
    /usr/bin/strip ${STRIP_SHARED} "${binary}";;
    *application/x-archive*) # Libraries (.a)
    /usr/bin/strip ${STRIP_STATIC} "${binary}";;
    *application/x-executable*) # Binaries
    /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
    done
    # remove unneeded architectures
    rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
    _package-docs() {
    pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
    provides=("kernel26${_kernelname}-docs=${pkgver}")
    conflicts=("kernel26${_kernelname}-docs")
    replaces=("kernel26${_kernelname}-docs")
    cd "${srcdir}/${_srcname}"
    mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
    cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
    find "${pkgdir}" -type f -exec chmod 444 {} \;
    find "${pkgdir}" -type d -exec chmod 755 {} \;
    # remove a file already in linux package
    rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
    pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
    for _p in ${pkgname[@]}; do
    eval "package_${_p}() {
    $(declare -f "_package${_p#${pkgbase}}")
    _package${_p#${pkgbase}}
    done
    Running makepkg -S to build the source tarball:
    claire ~/Builds/linux-tresor % makepkg -S
    ==> Making package: linux-tresor 3.18.2-1 (Fri 9 Jan 17:24:58 GMT 2015)
    ==> Retrieving sources...
    -> Downloading linux-3.18.tar.xz...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 77.1M 100 77.1M 0 0 2852k 0 0:00:27 0:00:27 --:--:-- 5975k
    -> Downloading linux-3.18.tar.sign...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 473 100 473 0 0 1079 0 --:--:-- --:--:-- --:--:-- 1082
    -> Downloading patch-3.18.2.xz...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 40932 100 40932 0 0 48079 0 --:--:-- --:--:-- --:--:-- 48042
    -> Downloading patch-3.18.2.sign...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 819 100 819 0 0 1207 0 --:--:-- --:--:-- --:--:-- 1207
    -> Found config
    -> Found config.x86_64
    -> Found linux-tresor.preset
    -> Found linux-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Downloading tresor_sysfs.c...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 2299 100 2299 0 0 28726 0 --:--:-- --:--:-- --:--:-- 29101
    -> Downloading tresor-patch-3.6.2_i686...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 47050 100 47050 0 0 344k 0 --:--:-- --:--:-- --:--:-- 345k
    -> Found tresor-patch-3.6.2_i686.patch
    -> Found tresor-patch-3.6.2_i686.patch.sig
    -> Found patch-3.18.2.sign
    -> Found config
    -> Found config.x86_64
    -> Found linux-tresor.preset
    -> Found linux-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Found tresor_sysfs.c
    -> Downloading tresor-patch-3.8.2_aesni...
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 47192 100 47192 0 0 350k 0 --:--:-- --:--:-- --:--:-- 351k
    -> Found tresor-patch-3.8.2_aesni.patch
    -> Found tresor-patch-3.8.2_aesni.patch.sig
    -> Found patch-3.18.2.sign
    -> Found config
    -> Found config.x86_64
    -> Found linux-tresor.preset
    -> Found linux-tresor.install
    -> Found change-default-console-loglevel.patch
    -> Found tresor_sysfs.c
    ==> Validating source files with sha256sums...
    linux-3.18.tar.xz ... Passed
    linux-3.18.tar.sign ... Skipped
    patch-3.18.2.xz ... Passed
    patch-3.18.2.sign ... Skipped
    config ... Passed
    config.x86_64 ... Passed
    linux-tresor.preset ... Passed
    linux-tresor.install ... Passed
    change-default-console-loglevel.patch ... Passed
    tresor_sysfs.c ... Passed
    ==> Validating source files with sha256sums...
    tresor-patch-3.6.2_i686 ... Passed
    tresor-patch-3.6.2_i686.patch ... Passed
    tresor-patch-3.6.2_i686.patch.sig ... Skipped
    ==> Validating source files with sha256sums...
    tresor-patch-3.8.2_aesni ... Passed
    tresor-patch-3.8.2_aesni.patch ... Passed
    tresor-patch-3.8.2_aesni.patch.sig ... Skipped
    ==> Verifying source file signatures with gpg...
    linux-3.18.tar ... Passed
    patch-3.18.2 ... Passed
    tresor-patch-3.6.2_i686.patch ... Passed
    patch-3.18.2 ... Passed
    tresor-patch-3.8.2_aesni.patch ... Passed
    patch-3.18.2 ... Passed
    ==> Entering fakeroot environment...
    ==> Creating source package...
    -> Adding PKGBUILD...
    -> Generating .SRCINFO file...
    -> Adding config...
    -> Adding config.x86_64...
    -> Adding linux-tresor.preset...
    -> Adding linux-tresor.install...
    -> Adding change-default-console-loglevel.patch...
    -> Adding tresor-patch-3.6.2_i686.patch...
    -> Adding tresor-patch-3.6.2_i686.patch.sig...
    -> Adding config...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config’: File exists
    -> Adding config.x86_64...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config.x86_64’: File exists
    -> Adding linux-tresor.preset...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.preset’: File exists
    -> Adding linux-tresor.install...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.install’: File exists
    -> Adding change-default-console-loglevel.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/change-default-console-loglevel.patch’: File exists
    -> Adding tresor-patch-3.8.2_aesni.patch...
    -> Adding tresor-patch-3.8.2_aesni.patch.sig...
    -> Adding config...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config’: File exists
    -> Adding config.x86_64...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/config.x86_64’: File exists
    -> Adding linux-tresor.preset...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.preset’: File exists
    -> Adding linux-tresor.install...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/linux-tresor.install’: File exists
    -> Adding change-default-console-loglevel.patch...
    ln: failed to create symbolic link ‘/home/claire/Builds/linux-tresor/srclinks.W5jPjydXO/linux-tresor/change-default-console-loglevel.patch’: File exists
    -> Compressing source package...
    ==> Leaving fakeroot environment.
    ==> Source package created: linux-tresor (Fri 9 Jan 17:25:50 GMT 2015)
    makepkg -S 24.38s user 1.40s system 48% cpu 53.129 total
    Here is the resulting source tarball.
    As far as I can see, they should be working PKGBUILDs too which meet the standards.
    EDIT: Here's the bug report
    Last edited by clfarron4 (2015-01-09 17:42:34)

  • How to install tools to build a standard kernel module?

    Hello!
    I am a long time Fedora user trying to switch over to Arch for the ease of customization.
    I am trying to build the hybrid_wl driver for my broadcom wireless card, and the requirements section says I need to have "the proper tools, packages, header files and libraries to build a standard kernel module. This is usually done by installing the kernel developer of kernel source package and caries from distro to distro."
    I have never messed around with the kernel in Arch (or Fedora, for that matter) so I really have no clue what a standard module even is. What do I need to install to get this driver working?
    Any help is welcome!
    Thanks,
    Jim

    that is in aur.
    http://aur.archlinux.org/packages.php?ID=19514
    read about what is aur here: http://wiki.archlinux.org/index.php/AUR_User_Guidelines

  • [Solved] Compiling a new kernel with ABS

    I've made it through the whole process outlined in the wiki, up to installing with pacman.  Pacman is telling me that the stock arch kernel is a conflicting package and wants to remove it.  I want to hang on to it in case I've messed something up.  What am I doing wrong?  I know you can have two kernels installed.  Using the traditional way I can get this, but I'd rather keep to doing things The Arch Way.
    Last edited by Morrvick (2011-11-17 00:40:30)

    I double checked what I was doing, and I have done that.  Here is my modified PKGBUILD:
    # $Id: PKGBUILD 130991 2011-07-09 12:23:51Z thomas $
    # Maintainer: Tobias Powalowski <[email protected]>
    # Maintainer: Thomas Baechler <[email protected]>
    pkgbase=linux
    #pkgname=('linux' 'linux-headers' 'linux-docs') # Build stock -ARCH kernel
    pkgname=('linux-morrvick' 'linux-headers-morrvick') # Build kernel with a different name
    _kernelname=${pkgname#linux}
    _basekernel=3.1
    pkgver=${_basekernel}.1
    pkgrel=1
    arch=('i686' 'x86_64')
    url="http://www.kernel.org/"
    license=('GPL2')
    makedepends=('xmlto' 'docbook-xsl')
    options=('!strip')
    source=("http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.1.tar.xz"
    "http://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
    # the main kernel config files
    'config' 'config.x86_64'
    # standard config files for mkinitcpio ramdisk
    "${pkgname}.preset"
    'change-default-console-loglevel.patch'
    'i915-fix-ghost-tv-output.patch'
    'i915-fix-incorrect-error-message.patch'
    'usb-add-reset-resume-quirk-for-several-webcams.patch')
    md5sums=('edbdc798f23ae0f8045c82f6fa22c536'
    '2bf7eb28a58238e1a062fa7393bf7824'
    'cbaaa923f00c1935055273ccc1630144'
    '93687a4b7e1e6bcd4e7417d6e5079bc4'
    'eb14dcfd80c00852ef81ded6e826826a'
    '9d3c56a4b999c8bfbd4018089a62f662'
    '263725f20c0b9eb9c353040792d644e5'
    'a50c9076012cb2dda49952dc6ec3e9c1'
    '52d41fa61e80277ace2b994412a0c856')
    build() {
    cd "${srcdir}/linux-${_basekernel}"
    # add upstream patch
    patch -p1 -i "${srcdir}/patch-${pkgver}"
    # add latest fixes from stable queue, if needed
    # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
    # Some chips detect a ghost TV output
    # mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
    # Arch Linux bug report: FS#19234
    # It is unclear why this patch wasn't merged upstream, it was accepted,
    # then dropped because the reasoning was unclear. However, it is clearly
    # needed.
    patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
    # In 3.1.1, a DRM_DEBUG message is falsely declared as DRM_ERROR. This
    # worries users, as this message is displayed even at loglevel 4. Fix
    # this.
    patch -Np1 -i "${srcdir}/i915-fix-incorrect-error-message.patch"
    # Add the USB_QUIRK_RESET_RESUME for several webcams
    # FS#26528
    patch -Np1 -i "${srcdir}/usb-add-reset-resume-quirk-for-several-webcams.patch"
    # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
    # remove this when a Kconfig knob is made available by upstream
    # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
    patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
    if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
    else
    cat "${srcdir}/config" > ./.config
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    fi
    # set extraversion to pkgrel
    sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    #make menuconfig # CLI menu for configuration
    #make nconfig # new CLI menu for configuration
    make xconfig # X-based configuration
    #make oldconfig # using old config from previous kernel version
    # ... or manually edit .config
    # stop here
    # this is useful to configure the kernel
    #msg "Stopping build"
    #return 1
    yes "" | make config
    # build!
    make ${MAKEFLAGS} bzImage modules
    package_linux-morrvick() {
    pkgdesc="The Linux Kernel and modules"
    groups=('base')
    depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
    optdepends=('crda: to set the correct wireless channels of your country')
    provides=('kernel26')
    conflicts=('kernel26')
    replaces=('kernel26')
    backup=("etc/mkinitcpio.d/${pkgname}.preset")
    install=${pkgname}.install
    cd "${srcdir}/linux-${_basekernel}"
    KARCH=x86
    # get kernel version
    _kernver="$(make kernelrelease)"
    mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
    make INSTALL_MOD_PATH="${pkgdir}" modules_install
    cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
    # add vmlinux
    install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
    # set correct depmod command for install
    sed \
    -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
    -i "${startdir}/${pkgname}.install"
    sed \
    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
    -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
    # remove build and source links
    rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
    # remove the firmware
    rm -rf "${pkgdir}/lib/firmware"
    # gzip -9 all modules to save 100MB of space
    find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
    # make room for external modules
    ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
    # add real version for building modules and running depmod from post_install/upgrade
    mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
    echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
    package_linux-headers-morrvick() {
    pkgdesc="Header files and scripts for building modules for linux kernel"
    provides=('kernel26-headers')
    conflicts=('kernel26-headers')
    replaces=('kernel26-headers')
    mkdir -p "${pkgdir}/lib/modules/${_kernver}"
    cd "${pkgdir}/lib/modules/${_kernver}"
    ln -sf ../../../usr/src/linux-${_kernver} build
    cd "${srcdir}/linux-${_basekernel}"
    install -D -m644 Makefile \
    "${pkgdir}/usr/src/linux-${_kernver}/Makefile"
    install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
    install -D -m644 .config \
    "${pkgdir}/usr/src/linux-${_kernver}/.config"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
    for i in acpi asm-generic config crypto drm generated linux math-emu \
    media net pcmcia scsi sound trace video xen; do
    cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
    done
    # copy arch includes for external modules
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
    cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
    cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
    # fix permissions on scripts dir
    chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
    cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
    if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
    fi
    cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
    # add headers for lirc package
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
    cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
    cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
    done
    # add docbook makefile
    install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
    # add dm headers
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
    cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
    # add inotify.h
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
    cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
    # add wireless headers
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
    cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
    cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
    # and...
    # http://bugs.archlinux.org/task/11194
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
    cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
    # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
    # in reference to:
    # http://bugs.archlinux.org/task/13146
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
    cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
    cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
    # add dvb headers
    # in reference to:
    # http://bugs.archlinux.org/task/20402
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
    cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
    cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
    cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
    # add xfs and shmem for aufs building
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
    cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
    done
    chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
    find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
    # strip scripts directory
    find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
    *application/x-sharedlib*) # Libraries (.so)
    /usr/bin/strip ${STRIP_SHARED} "${binary}";;
    *application/x-archive*) # Libraries (.a)
    /usr/bin/strip ${STRIP_STATIC} "${binary}";;
    *application/x-executable*) # Binaries
    /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
    done
    # remove unneeded architectures
    rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    package_linux-docs() {
    pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel."
    provides=('kernel26-docs')
    conflicts=('kernel26-docs')
    replaces=('kernel26-docs')
    cd "${srcdir}/linux-${_basekernel}"
    mkdir -p "${pkgdir}/usr/src/linux-${_kernver}"
    cp -al Documentation "${pkgdir}/usr/src/linux-${_kernver}"
    find "${pkgdir}" -type f -exec chmod 444 {} \;
    find "${pkgdir}" -type d -exec chmod 755 {} \;
    # remove a file already in linux package
    rm -f "${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
    After the compiling is finished:
    sudo pacman -U linux-morrvick-3.1.1-1-x86_64.pkg.tar.xz
    Password:
    resolving dependencies...
    looking for inter-conflicts...
    :: linux-morrvick and linux are in conflict (kernel26). Remove linux? [y/N] n
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: linux-morrvick and linux are in conflict (kernel26)
    Any thoughts?

  • [solved]Problem compiling alsa from source

    I'm trying to install alsa-driver-1.0.18a from source because I need to compile it with snd-virtuoso.  So I run "./configure --with-cards=virtuoso --with-sequencer=yes" then when I run "make" I get this at the end of it.
    make -C /lib/modules/2.6.27-ARCH/build SUBDIRS=/usr/src/alsa/alsa-driver-1.0.18a CPP="gcc -E" CC="gcc" modules
    make[1]: Entering directory `/usr/src/linux-2.6.27-ARCH'
    CC [M] /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.o
    In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:282:1: warning: "GFP_DMA32" redefined
    In file included from include/linux/kmod.h:22,
    from include/linux/module.h:13,
    from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:57,
    from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    include/linux/gfp.h:105:1: warning: this is the location of the previous definition
    In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:831: error: static declaration of 'jiffies_to_msecs' follows non-static declaration
    include/linux/jiffies.h:286: error: previous declaration of 'jiffies_to_msecs' was here
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:850: error: static declaration of 'msecs_to_jiffies' follows non-static declaration
    include/linux/jiffies.h:288: error: previous declaration of 'msecs_to_jiffies' was here
    In file included from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:948,
    from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    include/linux/pci.h:627: error: expected identifier or '(' before numeric constant
    In file included from include/asm/pci.h:4,
    from include/linux/pci.h:989,
    from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:948,
    from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    include/linux/mm.h:261: error: conflicting types for 'snd_compat_vmalloc_to_page'
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:752: error: previous declaration of 'snd_compat_vmalloc_to_page' was here
    In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h: In function 'snd_pci_orig_save_state':
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1197: error: too many arguments to function 'pci_save_state'
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h: In function 'snd_pci_orig_restore_state':
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1201: error: too many arguments to function 'pci_restore_state'
    In file included from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:1598:1: warning: "page_to_pfn" redefined
    In file included from include/asm/page.h:196,
    from include/asm/pda.h:8,
    from include/asm/current.h:19,
    from include/asm/processor.h:15,
    from include/linux/prefetch.h:14,
    from include/linux/list.h:6,
    from include/linux/module.h:9,
    from /usr/src/alsa/alsa-driver-1.0.18a/include/adriver.h:57,
    from /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:25:
    include/asm-generic/memory_model.h:78:1: warning: this is the location of the previous definition
    /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c: In function 'snd_compat_vmalloc_to_page':
    /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:44: error: implicit declaration of function 'VMALLOC_VMADDR'
    /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:49: error: incompatible type for argument 1 of 'pud_val'
    /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:50: error: implicit declaration of function 'pte_offset'
    /usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.c:50: warning: assignment makes pointer from integer without a cast
    make[3]: *** [/usr/src/alsa/alsa-driver-1.0.18a/acore/memory_wrapper.o] Error 1
    make[2]: *** [/usr/src/alsa/alsa-driver-1.0.18a/acore] Error 2
    make[1]: *** [_module_/usr/src/alsa/alsa-driver-1.0.18a] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.27-ARCH'
    make: *** [compile] Error 2
    edit: I tried compiling it on another computer and it was able too...not sure why mine wont.  Although I do seem to remember possibly forgetting to uninstall it before making it again (after kernel upgrade)...I've tried multiple times to compile so far.  Is there someway I can get a list of things to delete to manually remove all remnants of a previous install of alsa-driver?
    Last edited by Gauvenator (2008-12-13 19:48:11)

    Ok I ended up compiling the kernel from source for something else, so I tried compiling the alsa driver from source and it worked...maybe something was leftover in the previous kernel source directory that was causing problems.

  • Error: no kernel source files found

    Trying install avira- it need's Dazuko. Installing Dazuko (yaourt -S dazuko):
    error: no kernel source files found
    Help please
    Last edited by litemotiv (2010-08-25 11:30:31)

    The package build points to a directory that doesn't exist:
    kernel source in /lib/modules/2.6.34-ARCH/source... no
    kernel build source in /lib/modules/2.6.34-ARCH/build... no
    kernel build source in /usr/src/linux... no
    kernel source in /usr/src/linux... no
    error: no kernel source files found
    This package hasn't been updated for almost 2½ years, you will have to report this to the package maintainer: http://aur.archlinux.org/packages.php?ID=3779

  • A2107 Kernel Source

    Hello... Just wondering if there is any kernel source available for the A2107... And if there isn't... Why are you guys not being GPL compliant...?

    Maybe I don't need to tell you this, but if you want to play with kernels on arch it might help you to keep things kiss if you get to learn PKGBUILDS a little. For more info check the wiki (e.g. http://wiki.archlinux.org/index.php/Bui … Arch_Linux
    Basically they make it simple to build and install stuff on arch. You can also check the default PKGBUILD for the kernel (or any other package) to see what sources it uses if you want.
    Hope this helps.

  • Reasonable to have compile kernel + source package?

    Most modules require the kernel sources in order to compile, and I thought it would be nice to have the kernel sources used for the stock kernels available as a package. I know it's possible to use the abs or to download the kernel from kernel.org, but then you must go through the hassle of compiling the same kernel.
    This isn't a big deal, just a nice kernel thing to have.
    Any thoughts?

    bardo wrote:Well, I don't use the provided PKGBUILD. The latest stable kernel is 2.6.11.11, our latest build is 2.6.11.10, at least in current. The last number increases as trivial fixes are inserted in the kernel tree, so they're not prone to vulnerabilities as other packages are. IMHO these shouldn't be treated as new releases, but as fixes, which is exactly what they are. Just like when someone releases a new build of a package. That's why the lesser minor was created, and why I think it should arrive faster than other packages in the stable repo.
    This way I could get and compile my own source without discrepancies from the headers package, often needed by other packages. Otherwise, I should have a "stable" headers package and the latest full kernel sources providing kernel26. The source is not unstable by itself. It is what I do of it that makes it a risk. But this happens with many softwares, doesn't it?
    What does that have to do with anything under discussion? We're talking about the kernel binary + kernel headers.  If you compile your own kernel of a different version, then OF COURSE your headers will be different, unless you install the headers with your new kernel as the PKGBUILD does - if you compile a new kernel because you feel the release speed isn't fast enough, do you really thing a new kernel-headers package is going to release any faster?
    using the default arch package, the kernel binary and headers are provided.  If you want to compile your own kernel, fine, do that - just provide your own headers in that case - it's not hard.
    bardo wrote:Another reason because I don't use that PKGBUILD is because abs doesn't work on my machine, but that's totally OT here
    abs is a bash script... there's no possible way it could fail unless:
    a) you don't have cvsup installed (abs will spit out a big fat error saying "install cvsup" if you don't)
    b) you don't have a network connection
    c) user error
    hell, you don't need to use abs to build a package - "man makepkg"

  • 2.4.31 kernel source / .config

    Hi,
    Please forgive me if this is posted somewhere.
    I need to build that pesky new e1000 module from Intel and I can't find the
    2.4.31 .config for zfd 4.0.1 ir7 anywhere.
    Does anyone know where I can find it? I dont have a lot of time to spend
    on this, but I also don't want to replace this kernel with my own.
    Thanks,
    -Brian

    On Tue, 18 Jul 2006 18:19:47 GMT, [email protected] wrote:
    > Also, Do you know who has built the e1000 module for 2.4.31 or are you
    > assuming that someone has done it by now?
    I read it in another thread IIRC.. you don't really need the config files..
    From: [email protected]
    Ok, so I have gotten my boot disk to work following the process below,
    which is kind of a sampling of other peoples stuff out there, which I hope
    to give credit for when I'm all done here.....
    I have not tested the PXE boot, only the bootcd.iso
    Download the 2.4.22 Linux Kernel
    wget http://www.kernel.org/pub/linux/kern...2.4.22.tar.bz2
    unpack the Source
    tar xvfj linux-2.4.22.tar.bz2
    enter the directory created
    cd linux-2.4.22
    Download the 2.4.22-ac4 patch.
    wget http://www.kernel.org/pub/linux/kern...le/alan/linux-
    2.4/2.4.22/patch-2.4.22-ac4.bz2
    Uncompress the patch
    bunzip2 patch-2.4.22-ac4.bz2
    Download the Novell ZENworks Kernel Patch
    wget http://www.novell.com/coolsolutions/...dimgkrnlpatch-
    2.4.18-4.0-p1.tgz
    Unpack the file
    tar xvfz zfdimgkrnlpatch-2.4.18-4.0-p1.tgz
    Change the Kernel version
    sed 's/2.4.18/2.4.22/' <zenpatch-2.4.18-4.0-p1.patch > zenpatch-
    2.4.22.patch
    Apply the Patches
    patch -p0 < zenpatch-2.4.22.patch
    patch -p1 < patch-2.4.22-ac4
    Configure the Kernel
    make menuconfig
    I went in and did the following
    Processor Type and Features ->
    No to Math Emulation
    SCSI Support ->
    SCSI low-level drivers->
    Yes to SATA Support
    USB Support ->
    ---USB Human Interface Devices (HID)
    Yes to USB Human Interface Device (full HID) support
    Yes to HID input Layer Support (NEW)
    Exit and Save the configuration
    Run the following
    make clean ***Note Novell Recommends this***
    make dep
    make bzImage ***Note Case does matter on the I***
    make modules
    make modules_install
    Get the ZENDist package
    wget http://www.novell.com/coolsolutions/...ist-4.0-p1.tgz
    tar zxvf zendist-4.0-p1.tgz
    cd /usr/src/build
    ../buildImages.s
    Copy the 2.4.22 kernel and modules over to our build area....
    cp /usr/src/linux-2.4.22/arch/i386/boot/bzImage bootdisk/firstdisk/kernel
    cp -r /lib/modules/2.4.22-ac4 bootdisk/thirddisk/lib/modules
    Remove old stuff
    rm -rf bootdisk/thirddisk/lib/modules/2.4.18
    ../buildImages.s
    Copy the BroadCom Driver from the Forge site into
    the /build/bootdisk/thirddisk/lib/modules/2.4.22-ac4/kernel/drivers/net
    directory and then redo the
    ../buildImages.s
    This will add-in the BroadCom drivers for the GX280 computer.
    ***NOTE*** I had to run the GX280 SATA drive in Compatability mode in the
    BIOS, otherwise the drive did not show under the img dump ******
    I should also note here that the hdparm command does nto work with this.
    Imaging my Windows XP image took about 6 minutes though.
    I also did the 2.4.22 kernel because there is a compiled BroadCom driver
    on the Forge site.
    And from Roy Erez...
    So... SATA isn't supported by this trick on the Gx280 machines.
    The only way I could get SATA to work in "normal" (not "compatibility")
    mode in these machines was using the 2.4.28 kernel.
    As of kernel 2.4.27 SATA is merged into the kernel source tree so you
    don't need Alan Cox's patch to enable SATA.
    This only patches I applied to my kernel were the zen patch and a
    broadcom 57xx patch (had to change the version string in this one).
    Although ICH6 isn't yet fully supported it does work in a "Looks like
    ICH5" mode and I'm able to successfully take and put an image in "normal
    " sata mode.
    As to USB keyboard support - after trying several combinations I think
    it's better to compile HID support using HIDBP rather than the full HID
    layer - the only HID feature needed in the imaging environment is
    keyboard support and HIDBP handles it well enough.
    If you have already compiled drivers or have linux.2 please put them on
    http://forge.novell.com/modules/xfmo...ect/?zfdimgdrv
    Live BootCd and USB Disk from Mike Charles
    http://forge.novell.com/modules/xfmod/project/?imagingx
    eZie http://forge.novell.com/modules/xfmod/project/?ezie
    Marcus Breiden
    If you are asked to email me information please change -- to - in my e-mail
    address.
    The content of this mail is my private and personal opinion.
    http://www.edu-magic.net

  • [SOLVED] Black screen after kernel boot after pacman -Syu

    Hi, after full system upgrade with pacman -Syu, I get after the kernel boot black screen and everything is freezing. Then need to manually shut down the power button!
    Normally when my system starts up after the kernel boot I get straight to the command line terminal login.
    Can anybody help me how to fix this? Any clues? Any advice is welcome!
    The problem is solved by downgrading to kernel 3.6.11.-1
    Many thanks for the help from the people on #archlinux !
    Last edited by OpenEye (2013-01-29 05:14:04)

    jasonwryan wrote:
    Please stop bumping your thread: use the edit button
    https://wiki.archlinux.org/index.php/Fo … te#Bumping
    What have you done about the errors being printed to your logs? You could start by fixing the network error and the broken udev rule...
    Are you still using intiscripts? They are no longer supported: https://www.archlinux.org/news/end-of-i … s-support/
    # edit: not a pacman issue, moving to Newbie Corner
    I have searched for many hours and days for solutions on the internet and forums, tried some things, but with no results! I don't know how to fix the errors! Do you know how to fix that? I'm a total n00b! I'm doing my best as I can! Need help, thanks!

Maybe you are looking for

  • How can you delete duplicate songs in total, not one at a time?

    How can you delete duplicate songs in total, instead of the tedious task of one at a time. I have hundreds of duplicates.

  • Help! Blackberry 8330 keeps freezing.

    I plugged my blackberry into my computer to charge and this morning I was in a rush to get to college when I just pulled the cable out and forgot to eject it. (Yeah, I know, very smart move) Now when I tried to call someone I found that it was frozen

  • Oracle UCM - 10gR3 - NOE

    Hi, In our UCM deployment, the idea is to receive the notification of expiration for a particular documents exactly on 45th day, 30th day and 15th day before expiration date. The NOE query run at default time and the documents expiration time is also

  • Ive finished my first website now my next problem, who can help?

    Hi there, With lots of help from Nadia, ive finished my website.. http://www.tlmgoldman.com/ Now ive got to move on to an other level and i hope you can help me. As you can see the website is working fine. Now ive got one new question from my client.

  • Character Viewer in Lion?

    When I opened Character Viewer in Snow-Leopard it brought up the Favorites window that was showing when I closed Character Viewer. In Lion the general window always appears and I have to switch to Favorites. I'm unable to discover how to fix this so