Make menuconfig clarification(SOLVED)

I'm trying to understand "make menuconfig" a little better.I know what driver i need for my wireless card: "Network device support --->/Wireless LAN --->/Ralink driver support --->/Ralink rt2501/rt61 (PCI/PCMCIA) support"
So can i disable everything else under "Network device support",and all the sub directories.
--- Network device support │ │
│ │ <M> Intermediate Functional Block support │ │
│ │ <M> Dummy net driver support │ │
│ │ <M> Bonding driver support │ │
│ │ <M> MAC-VLAN support (EXPERIMENTAL) │ │
│ │ <M> MAC-VLAN based tap driver (EXPERIMENTAL) │ │
│ │ <M> EQL (serial line load balancing) support │ │
│ │ <M> Universal TUN/TAP device driver support │ │
│ │ <M> Virtual ethernet pair device │ │
│ │ <M> General Instruments Surfboard 1000 │ │
│ │ < > ARCnet support ---> │ │
│ │ {M} Generic Media Independent Interface device support │ │
│ │ {M} PHY Device support and infrastructure ---> │ │
│ │ [*] Ethernet (10 or 100Mbit) ---> │ │
│ │ -*- Ethernet (1000 Mbit) ---> │ │
│ │ [*] Ethernet (10000 Mbit) ---> │ │
│ │ < > Token Ring driver support ---> │ │
│ │ [*] Wireless LAN ---> │ │
│ │ WiMAX Wireless Broadband devices ---> │ │
│ │ USB Network Adapters ---> │ │
│ │ [*] PCMCIA network device support ---> │ │
│ │ [ ] Wan interfaces support ---> │ │
│ │ [*] ATM drivers ---> │ │
│ │ <M> IEEE 802.15.4 drivers ---> │ │
│ │ *** CAIF transport drivers *** │ │
│ │ <M> CAIF TTY transport driver │ │
│ │ <M> CAIF SPI transport driver for slave interface │ │
│ │ [*] Next command and length in start of frame │ │
│ │ <M> Xen network device frontend driver | |
| | < > FDDI driver support | |
│ │ [ ] HIPPI driver support (EXPERIMENTAL) │ │
│ │ <M> PLIP (parallel port) support │ │
│ │ {M} PPP (point-to-point protocol) support │ │
│ │ [*] PPP multilink support (EXPERIMENTAL) │ │
│ │ [*] PPP filtering │ │
│ │ <M> PPP support for async serial ports │ │
│ │ <M> PPP support for sync tty ports │ │
│ │ <M> PPP Deflate compression │ │
│ │ <M> PPP BSD-Compress compression │ │
│ │ <M> PPP MPPE compression (encryption) (EXPERIMENTAL) │ │
│ │ <M> PPP over Ethernet (EXPERIMENTAL) │ │
│ │ <M> PPP over IPv4 (PPTP) (EXPERIMENTAL) │ │
│ │ <M> PPP over ATM │ │
│ │ <M> PPP over L2TP (EXPERIMENTAL) │ │
│ │ <M> SLIP (serial line) support │ │
│ │ [ ] CSLIP compressed headers │ │
│ │ [ ] Keepalive and linefill │ │
│ │ [ ] Six bit SLIP encapsulation │ │
│ │ [ ] Fibre Channel driver support │ │
│ │ <M> Network console logging support │ │
│ │ [*] Dynamic reconfiguration of logging targets │ │
│ │ [ ] Netpoll traffic trapping │ │
│ │ <M> Virtio network driver (EXPERIMENTAL) │ │
│ │ <M> VMware VMXNET3 ethernet driver
Last edited by unilx (2011-02-24 06:26:59)

You might try:
make localmodconfig
before
make menuconfig
since localmodconfig will cull unneeded modules from the build, which makes it easier to sort the cruft from the cream in menuconfig.  localmodconfig automatically makes selections of needed modules based on what is running on your system when you run the command.

Similar Messages

  • Kernel PKGBUILD force make menuconfig (SOLVED)

    Using an ABS kernel26 to build my own kernel package, but stuck on making menuconfig!
    I have my kernel, patches, PKGBUILD, etc... all collected in a directory on my desktop (ALL SET, READY TO GO)
    So, here's what i'd like to be able to do:
    #makepkg... [[ when makepkg runs i'd like to get to a terminal and make menuconfig before the process continues ]]
    Therefore i'd like the PKGBUILD file to specify that i complete make menuconfig myself before the makepkg continues:
    Okay, got it the sources have to be available to the makepkg script in order to do a make menuconfig!
    I'll collect all this together and produce a mini howto ASAP.
    Last edited by Hongkongblue (2007-08-17 04:57:48)

    There are already various wiki pages about this. If you would like to add to them, please feel free.

  • Make menuconfig

    Hey, I´m new to archlinux and I´m having some problem when it comes to configuring the kernel.
    When I go to /usr/src/linux-2.6.29-ARCH/ and type make menuconfig, this massage comes up:
    *** Unable to find the ncurses libraries or the
    *** required header files.
    *** 'make menuconfig' requires the ncurses libraries.
    *** Install ncurses (ncurses-devel) and try again.
    make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
    make: *** [menuconfig] Error 2
    I already have core/ncurses 5.7-2.1 (base) but it still won´t let me configure the kernel.
    Thanks for any response.

    Hi Iz0r,
    compiling kernel (and every other package) in arch is done with makepkg command.
    To use makepkg, you must have PKGBUILD script. In this script you specify package name, version, etc.
    The best way to compile kernel is to download PKGBUILD (and other needed files) from ABS.
    If you have yaourt installed, you can do yaourt -G kernel26, if you want to use abs switch to /var/abs/core/kernel26. Both ways will show you PKGBUILD, config, configx64 and other files needed to build.
    To configure kernel with menuconfig open PKGBUILD and find line
    #make menuconfig # CLI menu for configuration
    and uncomment this line.
    You can also use make xconfig (which uses Qt3 menus). Choose only one of them.
    Additionally you can change pkgname=kernel26 to your need (e.g. pkgname=kernel26-izor) so you end up with kernel26-izor package, and you can have this kernel alogside with the oficial arch stock kernel (just edit grub menu then).
    This is the most simple way (and the best) to compile your own kernel. But why do you need it? Perhaps it would be better to say us the reason for this. Or is it just learning?
    P.S. Don't forget that removing modules from kernel you need to boot can make your system unbootable. Therefore i suggest to change pkgname (so the arch kernel will survive on your system unless your new kernel will work).

  • Where is make menuconfig?

    I finally got arch installed and booted. I'm using a pcmcia card for network connection, and would like to compile it into my kernel. I installed the 2.6.3 kernel off of the .6 iso. I change directories and try a make menuconfig (as I've become very accustomed to doing in gentoo and slackware) and I get this error:
    #cd /usr/src/linux
    #make menuconfig
    make: *** No rule to make target 'menuconfig'. Stop.
    I am very familiar with how to recompile a kernel, and have searched the forums and docs looking for arch's way to do it. Any suggestions?

    devfs is deprecated in the 2.6 series kernel yes, but arch is still configured to use it, so you need to compile that support in, regardless.
    Thereare threads around here somewhere with a howto on converting arch to udev (nontrivial) or to the "normal" /dev filesystem (nontrivial), but I'd suggest sticking with devfs support until the developers officially change Arch.
    Of course, its your computer, so you can do what you like. (try that with any other distro! )
    Dusty

  • Error when trying to make local repository (solved)

    i'm trying to make a local repository for a laptop without internet connection.
    on my desktop, the packages are in /var/cache/pacman/pkg and the corresponding PKGBUILD in /var/lib/pacman/local. but whenever i run (as root)
    #gensync /var/lib/pacman/local /var/cache/pacman/pkg/laptop.db.tar.gz
    i get the following error:
    gensync: building database entries, generating md5sums...
    gensync: compressing to /var/cache/pacman/pkg/laptop.db.tar.gz...
    tar: *: Cannot stat: No such file or directory
    tar: Error exit delayed from previous errors
    i can see the file laptop.db.tar.gz, but it's only 45 bytes!
    Last edited by chilebiker (2007-04-18 20:52:37)

    Maybe you could describe what you are doing a bit more. What I gather is that you want to take the pacman cache from the desktop system and somehow (how?) use this to update (or install to?) a laptop.
    You can make the desktop cache into a repository with gen_repo - but I forgot to say that you need to check that only a single version of each package is present in the cache (I think pacman -Sc should do that).
    If the laptop and desktop are then connected, e.g. by lan, you can set pacman.conf on the laptop to point at this repository (e.g. using NFS). Or you can copy the repository to the laptop and set pacman.conf to point at it.
    Another possibility would be to copy the pacman db (/var/lib/pacman/) to the laptop, and the package cache, then use pacman -S to install stuff. For that you don't need gen_repo, etc. Or you could just mount the desktop cache using NFS.
    There are all sorts of possibilities ... did you have something particular in mind?

  • ]When I try to "make" nothing happens [Solved]

    I just recently installed Arch and I was following the newbie installation guide. I got to the step to configure wireless card, and I downloaded the correct .tar file for the fwcutter. I did the tar xjf thing and the next command to be issued was to Cd to that directory and make it. When I enter make nothing happens?
    Last edited by mentalhawk (2008-08-25 04:09:23)

    First of all I don't think the rudeness is necessary. This is the newbie corner and I did mention I was following the newbie guide to installing. I have little knowledge of linux and was attempting to try it out. This is the proper place for asking questions isn't it?
    Anyway back to the issue.
    ls -l returns:
    Makefile
    README
    b43-fwcutter.1
    fwcutter.c
    fwcutter.h
    cwcutter_list.h
    md5.c
    md5.h
    These were the instructions given per linuxwireless.org
    wget http://bu3sch.de/b43/fwcutter/b43-fwcutter-011.tar.bz2
    tar xjf b43-fwcutter-011.tar.bz2
    cd b43-fwcutter-011
    make
    cd ..
    I have done all of the above and stuck on the "make" part.

  • How to make posts wider - solved :)

    hi
    below is contents of GreaseMonkey http://www.greasespot.net/ script which will hide sidebar - ACTIONS and MORE LIKE THIS - and make posts wider
    // ==UserScript==
    // @name          Make Posts on forums.adobe.com Wider
    // @description   (c) www.adobescripts.com
    // @include       *forums.adobe.com*
    // ==/UserScript==
    var tabDoc = content.document;
    tabDoc.getElementById('jive-body-sidebarcol-container').style.width = 0;
    tabDoc.getElementById('jive-body-maincol').style.width = '95%';

    SuperMacGuy,
    If you are using 10.4, there is a way to force this stuff into Safari. See this post in the FAQ. (And ignore the first instance of 10.5 in the subject--should be 10.4.)
    Of course, there are some things that will be harder to reach with the "Actions" panel permanently disabled, but it depends how much you want the extra width.
    Worst case, you could just put in the full-width fix from the link above.
    As for whether Adobe will get around to patching the forums, my impression was that they are quite happy with them being fixed width because "shorter lines are more readable", which is why I started doing all these hacks on my own. No, it makes no sense to me either, but that was the impression I got. With any luck, I will be proven wrong.
    Just in case though, you guys may want to start looking into FireFox. It's pretty easy to use these days and should suck all your bookmarks out of Safari at first launch. Also, if you install the Grapple Yummy (blue) theme, you'll have a hard time distinguishing the look of it from Safari.

  • Setting up network bridge aka make-a-router [Solved]

    I have a system basically acts like a router, it has one ethernet connection which goes out to the internet and two ethernet ports that are local. How do I configure the internet to be passed through to the two ports but DHCP data be stopped as I have a dhcpd server running on the internet cards.
    Thanks.
    Last edited by Ttech (2010-02-06 05:46:23)

    Hi Terry,
    See this post: http://forums.linksysbycisco.com/linksys/board/message?board.id=Network_Magic&thread.id=18
    Network Magic should work just fine.
    thecreator - Running Network Magic version -5.5..9195.0-Pure0 on Windows XP Home Edition SP 3
    Running Network Magic version -5.5.9195.0-Pure0 on Wireless Computer with McAfee Personal Firewall Build 11.5.131 Wireless Computer has D-Link DWA-552 connecting to D-Link DIR-655 A3 Router.

  • [SOLVED] make: *** No rule to make target `kernelrelease'

    Hi guys! My problem is similar this one Please help a newbie compile a kernel
    I tried to compile kernel 2.6.33.9 by simply copying the PKGBUILD and other files into my workspace. Everything goes well but I cant make a package:
    PKGBUILD:
    pkgdesc="The Linux Kernel and modules with tuxonice support and rt-patchset"
    depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0,7')
    optdepends=('crda: to set the correct wireless channels of your country')
    pkgname=linux-rt-ice
    backup=(etc/mkinitcpio.d/$pkgname.preset)
    _kernelname=${pkgname#linux}
    _basekernel=2.6.33
    pkgver=${_basekernel}.9
    #pkgver=${_basekernel}
    pkgrel=1
    arch=('i686' 'x86_64')
    url="https://rt.wiki.kernel.org"
    license=('GPL2')
    install=$pkgname.install
    provides=('kernel26-rt-ice')
    conflicts=('kernel26-rt-ice')
    replaces=('kernel26-rt-ice')
    makedepends=('xmlto' 'docbook-xsl')
    options=('!strip')
    ### User/Environment defined variables
    enable_toi=${enable_toi:-0}
    BFQ_IO_SCHEDULER="y"
    bfs_scheduler=${bfs_scheduler:-0}
    keep_source_code=${keep_source_code:-1}
    gconfig=${gconfig:-0}
    xconfig=${xconfig:-0}
    menuconfig=${menuconfig:-1}
    realtime_patch=${realtime_patch:-1}
    local_patch_dir="${local_patch_dir:-}"
    use_config="${use_config:-}"
    use_config_gz=${use_config_gz:-0}
    enable_reiser4=${enable_reiser4:-1}
    ### Compile time defined variables
    ### Files / Versions
    #!file_rt="patch-3.0.14-rt31.patch.gz"
    #!file_reiser4="reiser4-for-2.6.31.patch.bz2"
    #file_toi="current-tuxonice-for-3.0.patch.bz2"
    #file_bfs="2.6.38.3-sched-bfs-401.patch"
    file_rt="patch-2.6.33.9-rt31.gz"
    file_reiser4="reiser4-for-2.6.33.patch.gz"
    file_bfs="2.6.33.7-sched-bfs-357.patch"
    _bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.33/"
    source=("ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2"
    "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.33/patch-2.6.33.9.gz"
    http://www.kernel.org/pub/linux/kernel/projects/rt/2.6.33/patch-2.6.33.9-rt31.gz
    # https://tglx.de/~tglx/rt/3.0/${file_rt}
    http://sourceforge.net/projects/reiser4/files/reiser4-for-linux-2.6/reiser4-for-2.6.33.patch.gz
    #http://www.tuxonice.net/files/${file_toi}
    http://ck.kolivas.org/patches/bfs/${_basekernel}/${file_bfs}
    # 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'
    #BFQ patch:
    "${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-r1.patch"
    "${_bfqpath}/0002-bfq_iosched-block-add_cgroups_kconfig_and_build_bits-v1-r1.patch"
    "${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-r1.patch")
    md5sums=('c3883760b18d50e8d78819c54d579b00'
    '6594052b26f8e79c374c278f62d3329b'
    '772776957913e76492e3547b304b75c2'
    '96f986418d1ab9b9abdcbfb2c20fdc0d'
    '3b8ef39f43a1dab60ddc703049cb8ac2'
    '540318683b69e49ab5fa629cfb32dc48'
    '74d172143d448a002834879d99c3992c'
    '7c9725208ab6834602c8b9d645ed001d'
    '9d3c56a4b999c8bfbd4018089a62f662'
    '263725f20c0b9eb9c353040792d644e5'
    '69adc7f64f4dc5b34ad1cb3825b7c0f4'
    '4146ee711eed553c024a93c766463583'
    '678c791c7df57a71cdb480fdc49aec8d')
    build() {
    cd "${srcdir}/linux-${_basekernel}"
    # add upstream patch
    patch -p1 -i "${srcdir}/patch-${pkgver}"
    if [ -n "${local_patch_dir}" ] && [ -d "${local_patch_dir}" ] ; then
    echo "Applying patches from ${local_patch_dir} ..."
    for my_patch in "${local_patch_dir}"/* ; do
    echo -e "Applying custom patch:\t'${my_patch}'" || true
    patch -Np1 -i "${my_patch}" || { echo -e "Failed custom patch:\t'${my_patch}'" ; return 1 ; }
    done
    fi
    # Applying realtime patch
    if [ "$realtime_patch" = "1" ]; then
    echo "Applying real time patch"
    # Strip './Makefile' changes
    gzip -dc ${srcdir}/${file_rt} \
    | sed '/diff --git a\/Makefile b\/Makefile/,/*DOCUMENTATION*/d' \
    | patch -Np1 || { echo "Failed Realtime patch '${file_rt}'"; return 1 ; }
    fi
    # applying reiserfs4 patch
    if [ "$enable_reiser4" = "1" ]; then
    echo "Applying ${file_reiser4%.gz}"
    gzip -dc ${srcdir}/${file_reiser4} | patch -Np1 || { echo "Failed reiser4 patch '${file_reiser4%.gz}'"; return 1 ; }
    fi
    # applying tuxonice patch
    if [ "${enable_toi}" = "1" ]; then
    echo "Applying ${file_toi%.bz2}"
    # fix to tuxonice patch to work with rt
    #if [ "$realtime_patch" = "1" ]; then
    #bzip2 -dck ${srcdir}/${file_toi} \
    #| sed '/diff --git a\/kernel\/fork.c b\/kernel\/fork.c/,/{/d' \
    #| sed 's/printk(KERN_INFO "PM: Creating hibernation image:\\n/printk(KERN_INFO "PM: Creating hibernation image: \\n/' \
    #| patch -Np1 || { echo "Failed TOI w/rt" ; return 1 ; }
    #else
    bzip2 -dck ${srcdir}/${file_toi} \
    | sed 's/printk(KERN_INFO "PM: Creating hibernation image:\\n/printk(KERN_INFO "PM: Creating hibernation image: \\n/' \
    | patch -Np1 -F4 || { echo "Failed TOI"; return 1 ; }
    #fi
    fi
    if [ "${bfs_scheduler}" = "1" ] && [ "${realtime_patch}" = "0" ]; then
    # applying BFS scheduler patch
    echo "BFS scheduler patch not available yet, sorry"
    # echo "Applying BFS scheduler patch"
    # patch -Np1 -i ${srcdir}/${file_bfs} || { echo "Failed BFS"; return 1 ; }
    fi
    # --> BFQ
    if [ $BFQ_IO_SCHEDULER = "y" ] ; then
    msg "Patching source with BFQ patches"
    for i in $(ls ${srcdir}/000*.patch); do
    patch -Np1 -i $i
    done
    fi
    # 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"
    # 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
    # use custom config instead
    if [ -n "${use_config}" ] ; then
    echo "Using config: '${use_config}'"
    cat "${use_config}" > ./.config
    make oldconfig
    fi
    # use existing config.gz
    if [ "$use_config_gz" = "1" ]; then
    zcat /proc/config.gz > ./.config
    make oldconfig
    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
    # hack to prevent output kernel from being marked as dirty or git
    #chmod +x ${srcdir}/linux-${_basekernel}/scripts/setlocalversion
    #sed 's/head=`git rev-parse --verify --short HEAD 2>\/dev\/null`/0/' \
    # ${srcdir}/linux-${_basekernel}/scripts/setlocalversion \
    # > ${srcdir}/linux-${_basekernel}/scripts/setlocalversion.new
    #mv ${srcdir}/linux-${_basekernel}/scripts/setlocalversion.new \
    # ${srcdir}/linux-${_basekernel}/scripts/setlocalversion
    # get kernel version
    make prepare
    # load configuration
    # Configure the kernel. Replace the line below with one of your choice.
    if [ "$gconfig" = "1" ]; then
    make gconfig
    else
    if [ "$xconfig" = "1" ]; then
    make xconfig
    else
    if [ "$menuconfig" = "1" ]; then
    make menuconfig
    fi
    fi
    fi
    yes "" | make config
    make prepare # Necessary in case config has been changed
    # build!
    make ${MAKEFLAGS} bzImage modules
    package_linux-rt-ice() {
    KARCH=x86
    cd ${srcdir}/linux-${_basekernel}
    if [ "$keep_source_code" = "1" ]; then
    echo -n "Copying source code..."
    # Keep the source code
    cd $startdir
    mkdir -p $pkgdir/usr/src || return 1
    cp -a ${srcdir}/linux-${_basekernel} $pkgdir/usr/src/linux-${_kernver} || return 1
    #Add a link from the modules directory
    mkdir -p $pkgdir/lib/modules/${_kernver} || return 1
    cd $pkgdir/lib/modules/${_kernver} || return 1
    rm -f source
    ln -s ../../../usr/src/linux-${_kernver} source || return 1
    echo "OK"
    fi
    # 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"
    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"
    # 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:--rt-ice}" "${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:--rt-ice}"
    echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--rt-ice}/version"
    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
    if [ "$keep_source_code" = "0" ]; then
    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}
    fi
    [ku@ku-la linux-rt-ice]$ makepkg -R
    ==> Making package: linux-rt-ice 2.6.33.9-1 (Sat Jan 21 13:33:09 NOVT 2012)
    ==> Removing existing pkg/ directory...
    ==> Entering fakeroot environment...
    ==> Starting package_linux-rt-ice()...
    Copying source code...OK
    make: *** No rule to make target `kernelrelease'. Stop.
    ==> ERROR: A failure occurred in package_linux-rt-ice().
    Aborting...
    I remounted it with defaults options as stressed above topic and try again makepkg -R but still no joy
    I looked at kernel.release
    2.6.33-1-rt-ice
    Any ideas?
    Last edited by noMaster (2012-01-21 15:35:54)

    I suggested to build package again. And finally I got it. I guess the problem was in mounting options so was needed to began from the very start

  • [Solved] Error compiling kernel 2.6.36.2 patched with MOSIX

    Hi, I'm a new user in this forum!
    I'm trying to compile manually the kernel version with MOSIX-2.29.0.1 for computer clustering. But When I try to compile it with make command there is an error:
    In file included from arch/x86/kernel/signal.c:17:0:
    include/linux/tracehook.h: In function ‘tracehook_unsafe_exec’:
    include/linux/tracehook.h:164:40: error: ‘struct task_struct’ has no member named ‘mflags’
    arch/x86/kernel/signal.c: In function ‘do_notify_resume’:
    arch/x86/kernel/signal.c:884:44: error: ‘struct task_struct’ has no member named ‘parent_waiting’
    make[2]: *** [arch/x86/kernel/signal.o] Error 1
    make[1]: *** [arch/x86/kernel] Error 2
    make: *** [arch/x86] Error 2
    I have launched make menuconfig and I have configured the kernel in this way:
    Configure the following option:
          CONFIG_FUSE_FS
            File systems  --->  FUSE (Filesystem in Userspace) support
          CONFIG_SYSVIPC
            General setup  --->  System V IPC
       But make sure that the following is NOT CONFIGURED:
       CONFIG_HEADERS_CHECK"
            'Kernel hacking' ---> 'Run 'make headers_check' when building vmlinux'
    What is the problem?
    Last edited by andychaser (2011-02-17 12:37:50)

    I've solved the issue, infact there was a problem with the patch. Now I am able to compile the kernel.
    Thanks anyway!

  • Kernel make problem

    Hi and greetings to the Arch Community!
    First of all, i have to explain myself.I switched from Gentoo, as it was great, but the compiling times convinced me of Arch!
    The installation was a piece of cake, the installation took little time.Because the kernel loads the maximum amount of modules  with ramdisk, i wanted to build my own customized Kernle.So after the first boot, i did pacman -Syu.It installed the newest kernle under /usr/src/kernel-2.6.17-arch.After i was finished with "make menuconfig".I did "make", but it was interrupted by the message "No rules to make".What the heck is going on.....
    As i was trying a downloaded kernle sources, everthing ran flawlessly?!
    As i came from Gentoo, perhaps i have a different and false thinking?

    kernel package doesn'T contain full sources, btw i would really recommend to use the stock kernel + initcpio that solves the loading of many modules and you don't need to compile the kernel yourself.
    for more information check the news and wiki about initcpio.

  • [SOLVED] Macbook 2,1 Intel 945GM: no backlight property custom kernel

    Hi,
    I just finished compiling a custom kernel for my Macbook and for the life of me cannot figure out which option enables backlight control. I'm suspecting it might be CONFIG_FB_BACKLIGHT, but I can't actually find it via 'make menuconfig.' In other words, I can grep it from the raw config, but don't know where it is:
    $ grep -A10 -B10 CONFIG_FB_BACKLIGHT .config
    CONFIG_FB_CFB_IMAGEBLIT=y
    # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
    # CONFIG_FB_SYS_FILLRECT is not set
    # CONFIG_FB_SYS_COPYAREA is not set
    # CONFIG_FB_SYS_IMAGEBLIT is not set
    # CONFIG_FB_FOREIGN_ENDIAN is not set
    # CONFIG_FB_SYS_FOPS is not set
    # CONFIG_FB_WMT_GE_ROPS is not set
    # CONFIG_FB_SVGALIB is not set
    # CONFIG_FB_MACMODES is not set
    [b]# CONFIG_FB_BACKLIGHT is not set[/b]
    # CONFIG_FB_MODE_HELPERS is not set
    # CONFIG_FB_TILEBLITTING is not set
    # Frame buffer hardware drivers
    # CONFIG_FB_CIRRUS is not set
    # CONFIG_FB_PM2 is not set
    # CONFIG_FB_CYBER2000 is not set
    # CONFIG_FB_ARC is not set
    But menuconfig is like this:
    --- Support for frame buffer
    [ ] Enable firmware EDID
    [ ] foreign endianness support --->
    [ ] Video Mode Handling Helpers
    [ ] Tile Blitting Support
    It's hard to reproduce entirely here, but the point is that the config grep returns fb_backlight just above mode helpers/tilebitting, but above those are foreign endianness, and that's not where the backlight setting is.
    The card is the Intel 945GM; on the default Arch kernel I can use xbacklight to adjust brightness. With my custom compiled one, I get "no outputs have backlight property" with xbacklight and, indeed, /sys/class/backlight is empty.
    Would someone kindly tell me which kernel option provides the backlight property for this card?
    Last edited by jwhendy (2011-10-15 16:44:30)

    @byte:
    Thanks for the suggestion, and the link to the current config. I was wondering where I might find that. Not looking so promising so far:
    $ diff --side-by-side default-config custom-config | grep BACKLIGHT
    CONFIG_FB_BACKLIGHT=y | # CONFIG_FB_BACKLIGHT is not set
    CONFIG_FB_NVIDIA_BACKLIGHT=y <
    CONFIG_FB_RIVA_BACKLIGHT=y <
    CONFIG_FB_RADEON_BACKLIGHT=y | # CONFIG_FB_ATY is not set
    CONFIG_FB_ATY128_BACKLIGHT=y | # CONFIG_FB_SIS is not set
    CONFIG_FB_ATY_BACKLIGHT=y | # CONFIG_FB_VOODOO1 is not set
    CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_LCD_SUPPORT=y
    CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_CLASS_DEVICE=y
    CONFIG_BACKLIGHT_GENERIC=m CONFIG_BACKLIGHT_GENERIC=m
    CONFIG_BACKLIGHT_PROGEAR=m | # CONFIG_BACKLIGHT_PROGEAR is not set
    CONFIG_BACKLIGHT_CARILLO_RANCH=m CONFIG_BACKLIGHT_CARILLO_RANCH=m
    CONFIG_BACKLIGHT_MBP_NVIDIA=m | # CONFIG_BACKLIGHT_MBP_NVIDIA is not set
    CONFIG_BACKLIGHT_SAHARA=m | # CONFIG_BACKLIGHT_SAHARA is not set
    CONFIG_BACKLIGHT_WM831X=m | # CONFIG_BACKLIGHT_ADP8860 is not set
    CONFIG_BACKLIGHT_ADP8860=m <
    CONFIG_BACKLIGHT_PCF50633=m <
    CONFIG_HID_PICOLCD_BACKLIGHT=y | # CONFIG_HID_ROCCAT_KONEPLUS is not set
    CONFIG_LEDS_TRIGGER_HEARTBEAT=m | # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
    CONFIG_LEDS_TRIGGER_BACKLIGHT=m | # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
    CONFIG_DRM_NOUVEAU_BACKLIGHT=y <
    I don't see much there to wonder about. CONFIG_FB_BACKLIGHT only gets triggered if certain drivers are enabled. But I don't have any of those. I'm re-compiling right now with one of them, just for kicks, to see what happens. I have the right LCD backlight options set to match the default. On the ACPI front, we have this:
    ]$ diff --side-by-side ~/def-config .config |grep ACPI
    # Power management and ACPI options # Power management and ACPI options
    CONFIG_ACPI=y CONFIG_ACPI=y
    CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP=y
    CONFIG_ACPI_PROCFS=y | # CONFIG_ACPI_PROCFS is not set
    CONFIG_ACPI_PROCFS_POWER=y | # CONFIG_ACPI_PROCFS_POWER is not set
    CONFIG_ACPI_POWER_METER=m | # CONFIG_ACPI_POWER_METER is not set
    CONFIG_ACPI_EC_DEBUGFS=m | # CONFIG_ACPI_EC_DEBUGFS is not set
    CONFIG_ACPI_PROC_EVENT=y | # CONFIG_ACPI_PROC_EVENT is not set
    CONFIG_ACPI_AC=m | CONFIG_ACPI_AC=y
    CONFIG_ACPI_BATTERY=m | CONFIG_ACPI_BATTERY=y
    CONFIG_ACPI_BUTTON=m | CONFIG_ACPI_BUTTON=y
    CONFIG_ACPI_VIDEO=m | CONFIG_ACPI_VIDEO=y
    CONFIG_ACPI_FAN=m | CONFIG_ACPI_FAN=y
    CONFIG_ACPI_DOCK=y | # CONFIG_ACPI_DOCK is not set
    CONFIG_ACPI_PROCESSOR=m | CONFIG_ACPI_PROCESSOR=y
    CONFIG_ACPI_IPMI=m <
    CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_CPU=y
    CONFIG_ACPI_PROCESSOR_AGGREGATOR=m | # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
    CONFIG_ACPI_THERMAL=m | CONFIG_ACPI_THERMAL=y
    # CONFIG_ACPI_CUSTOM_DSDT is not set # CONFIG_ACPI_CUSTOM_DSDT is not set
    CONFIG_ACPI_BLACKLIST_YEAR=0 CONFIG_ACPI_BLACKLIST_YEAR=0
    # CONFIG_ACPI_DEBUG is not set # CONFIG_ACPI_DEBUG is not set
    CONFIG_ACPI_PCI_SLOT=m | # CONFIG_ACPI_PCI_SLOT is not set
    CONFIG_ACPI_CONTAINER=m | CONFIG_ACPI_CONTAINER=y
    CONFIG_ACPI_SBS=m | # CONFIG_ACPI_SBS is not set
    CONFIG_ACPI_HED=m | # CONFIG_ACPI_HED is not set
    CONFIG_ACPI_APEI=y | # CONFIG_ACPI_APEI is not set
    CONFIG_ACPI_APEI_GHES=m | # CONFIG_SFI is not set
    CONFIG_ACPI_APEI_EINJ=m <
    CONFIG_ACPI_APEI_ERST_DEBUG=m <
    CONFIG_X86_ACPI_CPUFREQ=m | CONFIG_X86_ACPI_CPUFREQ=y
    CONFIG_X86_POWERNOW_K7_ACPI=y <
    CONFIG_CARDBUS=y | # CONFIG_HOTPLUG_PCI_ACPI is not set
    CONFIG_HOTPLUG_PCI_ACPI=m <
    CONFIG_HOTPLUG_PCI_ACPI_IBM=m <
    CONFIG_PNPACPI=y CONFIG_PNPACPI=y
    CONFIG_BLK_DEV_IDEACPI=y <
    CONFIG_ATA_ACPI=y CONFIG_ATA_ACPI=y
    CONFIG_PATA_ACPI=m | # CONFIG_PATA_ACPI is not set
    # ACPI drivers # ACPI drivers
    # ACPI drivers # ACPI drivers
    CONFIG_ACPI_QUICKSTART=m <
    CONFIG_TC1100_WMI=m | # CONFIG_THINKPAD_ACPI is not set
    CONFIG_COMPAL_LAPTOP=m | # CONFIG_ACPI_WMI is not set
    CONFIG_SONY_LAPTOP=m | # CONFIG_ACPI_ASUS is not set
    CONFIG_IDEAPAD_LAPTOP=m | # CONFIG_ACPI_TOSHIBA is not set
    CONFIG_THINKPAD_ACPI=m | # CONFIG_TOSHIBA_BT_RFKILL is not set
    CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y | # CONFIG_ACPI_CMPC is not set
    # CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set | # CONFIG_INTEL_IPS is not set
    # CONFIG_THINKPAD_ACPI_DEBUG is not set | # CONFIG_IBM_RTL is not set
    # CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set <
    CONFIG_THINKPAD_ACPI_VIDEO=y <
    CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y <
    CONFIG_ACPI_WMI=m <
    CONFIG_ACPI_ASUS=m <
    CONFIG_ACPI_TOSHIBA=m <
    CONFIG_ACPI_CMPC=m <
    Most of that seems about right, and the end stuff is all specific laptop drivers.
    I'll post back when this is done. The only other thing I can think of is the fact that I compiled in i915 and intel_agp vs. having them as modules. Should that make any difference?

  • [SOLVED]How to patch the kernel? And other questions

    Like the same user who started this thread I'm suffering from hibernation resuming troubles using kernel 2.6.38. In that thread was posted a soluttion that involves patching the kernel.
    The patch to apply is this:
    http://git.kernel.org/?p=linux/kernel/g … e3e9fc8684
    Waiting for the bug to be corrected and a new version supplied is not an option, because this laptop is my main computer and I heavly rely on hibernation.
    Here's my trouble now. I don't know if it is possible to patch without recompiling the whole kernel, or it has to be compiled with that patch applied. I have seen the archlinux's wiki guide about compiling the kernel, but found nothing about applying patches (maybe I didn't searched with enought depth).
    In case there is needed a full compilation, should I use the vanilla kernel, the Arch Linux one or any of the AUR ones (I said AUR because they're the first that came to my mind)? Should i expect a performance gain with this (apart from fixing the hibernation bug)?
    Maybe i'm just doing a bunch of dumb questions, and the only thing I need is to search deeply on the wiki. In that case, please tell me. If not, I rather get some answers around kernel patching and / or compiling questions.
    Edit: In addittion, it is possible that all this questions are just newbie ones, I don't know, but as I am willing to learn from this I will appreciate any info or documentation about it.
    Thank you.
    Last edited by ethail (2011-04-12 06:30:48)

    From the source tree (/usr/src/linux-whatever) execute
    patch -p1 < /path/to/fix.patch
    then recompile kernel from the source tree.
    Basically that consists of executing the following commands from the source tree:
    make menuconfig
    make
    make modules_install
    cp -v System.map /boot/System.map-CUSTOM
    cp -v arch/x86/boot/bzImage /boot/vmlinuz-CUSTOM
    mkinitcpio -k 2.6.38-CUSTOM -g /boot/kernel-CUSTOM.img
    and you need to add menu entry in /boot/grub/menu.lst
    -k 2.6.38-CUSTOM should corespond to /lib/modules/2.6.38-CUSTOM (replace 2.6.38-CUSTOM with the name of your module directory, name depends on the kernel version and suffix that you gave in menuconfig). Regarding kernel configuration in menuconfig - I can't help you, you could use arch stock kernel config (zcat /proc/config.gz > /usr/src/linux-whatever/.config)
    I do these kind of things this way - maybe someone else have a more elegant solution.

  • (SOLVED) 1st PKGBUILD & submission to AUR, cant do "makepkg --source"

    I'm trying to add my own Live kernel to AUR
    it is kernel 2.6.35.6 patched with Tuxonice, BFS, BFQ, Aufs2 and squashfs-lzma
    however, when I do  "makepkg --source"
    it fails saying
    PKGBUILD: line 34: syntax error near unexpected token `('
    heres my PKGBUILD; mostly taken from the AUR's kernel26-pf PKGBUILD
    # Original PKGBUILD from kernel26-pf
    # Maintainer: <thepenandpaper at gmail dot com>
    _basekernel=2.6.35
    _pkgname=kernel26-livez
    _pfrel=1
    pkgname=kernel26-livez
    pkgver=${_basekernel}
    pkgrel=${_pfrel}
    _kernelname=-livez
    arch=(i686 x86_64)
    _pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
    pkgdesc=${_pkgdesc}
    license=('GPL2')
    groups=('base')
    backup=(etc/mkinitcpio.d/${_pkgname}.preset)
    depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
    optdepends=('crda: to set the correct wireless channels of your country'
    'pm-utils: utilities and scripts for suspend and hibernate power management'
    'tuxonice-userui: TuxOnIce userspace user interface'
    'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
    # 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' 'aufs' 'rt2500')
    install='kernel26.install'
    source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64 # the main kernel config files
    kernel26.preset # standard config files for mkinitcpio ramdisk
    sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e'
    provides=(${_pkgname}=${_basekernel}) # for $pkgname-optimized
    #provides=('kernel26-headers' 'kernel26=$pkgver') # for when you have no other kernel (which is a bad idea anyway)
    build() {
    KARCH=x86
    cd ${srcdir}/linux-${_basekernel}
    bzip2 -dk ${startdir}/logo_linux_*.bz2
    mv -f ${startdir}/logo_linux_*.p?m drivers/video/logo/
    bzip2 -dc ${srcdir}/${_pfpatchname} | patch -Np1
    patch -Np1 < ${srcdir}/aufs2-sqlzma.patch
    sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
    if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    else
    cat ../config >./.config
    fi
    _arch=$CARCH
    echo
    echo "==================================================="
    echo "You might be prompted below for some config options"
    echo "==================================================="
    echo
    echo "Do you want to use your running kernel's config? (y/N)"
    echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
    echo " as root before hitting <Y>, if uncertain)"
    read answer
    shopt -s nocasematch
    if [[ "$answer" = "y" ]]; then
    if [[ -s /proc/config.gz ]]; then
    echo "Extracting config from /proc/config.gz..."
    modprobe configs
    zcat /proc/config.gz > ./.config
    else
    echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
    fi
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
    fi
    # Make some good use of MAKEFLAGS
    MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
    # get kernel version
    make ${MAKEFLAGS} prepare
    # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
    # make localmodconfig
    # allows you to edit config
    # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"
    # load configuration
    # yes "" | make config
    # This allows building cpu-optimized packages with according package names.
    # Useful for repo maintainers.
    CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
    CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
    case $CPU in
    CORE2)
    pkgname="${_pkgname}-core2"
    pkgdesc="${_pkgdesc} Intel Core2 optimized."
    K8)
    pkgname="${_pkgname}-k8"
    pkgdesc="${_pkgdesc} AMD K8 optimized."
    PSC)
    pkgname="${_pkgname}-psc"
    pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
    ATOM)
    pkgname="${_pkgname}-atom"
    pkgdesc="${_pkgdesc} Intel Atom optimized."
    K7)
    pkgname="${_pkgname}-k7"
    pkgdesc="${_pkgdesc} AMD K7 optimized."
    PENTIUMII)
    pkgname="${_pkgname}-p3"
    pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
    PENTIUMIII)
    pkgname="${_pkgname}-p2"
    pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
    PENTIUMM)
    pkgname="${_pkgname}-pm"
    pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
    PENTIUM4)
    pkgname="${_pkgname}-p4"
    pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
    default)
    pkgname="${_pkgname}"
    pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
    esac
    # build!
    _kernver="$(make kernelrelease)"
    make ${MAKEFLAGS} bzImage modules
    ### package_kernel26
    mkdir -p ${pkgdir}/{lib/modules,boot}
    make INSTALL_MOD_PATH=${pkgdir} modules_install
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # add vmlinux
    # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
    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
    # 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
    ### package_kernel26-headers
    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 generated 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/
    [[ -e 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 for 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
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    cd ${pkgdir}/lib/modules/${_kernver} && \
    (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
    # 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}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    # eof
    line #34 is the sha256sum line
    heres the contents of the source folder "kernel26-livez"
    config
    config.x86_64
    kernel26.install
    kernel26.preset
    PKGBUILD
    can anyone tell me whats wrong,etc?
    I reall hate the syntax error issues as no matter how I have edited it, the same error?
    thanks
    Last edited by 72linus (2010-09-30 00:08:28)

    yep
    thanks guys I got it!
    PKGBUILD
    # Original PKGBUILD from kernel26-pf
    # Maintainer: <thepenandpaper at gmail dot com>
    _basekernel=2.6.35
    _pkgname=kernel26-livez
    _pfrel=1
    pkgname=kernel26-livez
    pkgver=${_basekernel}
    pkgrel=${_pfrel}
    _kernelname=-livez
    arch=(i686 x86_64)
    _pkgdesc="Linux kernel and modules with patches (BFS included), tuxonice, BFQ]. Also included: aufs2 and squashfs-lzma."
    pkgdesc=${_pkgdesc}
    license=('GPL2')
    groups=('base')
    backup=(etc/mkinitcpio.d/${_pkgname}.preset)
    depends=('coreutils' 'module-init-tools' 'linux-firmware' 'mkinitcpio>=0.5.20')
    optdepends=('crda: to set the correct wireless channels of your country'
    'pm-utils: utilities and scripts for suspend and hibernate power management'
    'tuxonice-userui: TuxOnIce userspace user interface'
    'hibernate-script: set of scripts for managing TuxOnIce, hibernation and suspend to RAM')
    # 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' 'aufs' 'rt2500')
    install='kernel26.install'
    source=(http://multidistro.com/downloads/kernel26-livez/linux-2.6.35.6.tar.bz2
    config config.x86_64 # the main kernel config files
    kernel26.preset) # standard config files for mkinitcpio ramdisk
    sha256sums=('e25123d1397806015c9b480d9809834461af0aa90179d0404eae87db3598ae5e')
    provides=(${_pkgname}=${_basekernel}) # for $pkgname-optimized
    #provides=('kernel26-headers' 'kernel26=$pkgver') # for when you have no other kernel (which is a bad idea anyway)
    build() {
    KARCH=x86
    cd ${srcdir}/linux-${_basekernel}
    bzip2 -dk ${startdir}/logo_linux_*.bz2
    mv -f ${startdir}/logo_linux_*.p?m drivers/video/logo/
    bzip2 -dc ${srcdir}/${_pfpatchname} | patch -Np1
    patch -Np1 < ${srcdir}/aufs2-sqlzma.patch
    sed -i "s/EXTRAVERSION = -${_pfrel}/EXTRAVERSION = ${_kernelname}/" Makefile
    if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    else
    cat ../config >./.config
    fi
    _arch=$CARCH
    echo
    echo "==================================================="
    echo "You might be prompted below for some config options"
    echo "==================================================="
    echo
    echo "Do you want to use your running kernel's config? (y/N)"
    echo "(needs IKCONFIG and IKCONFIG_PROC, run 'modprobe configs'"
    echo " as root before hitting <Y>, if uncertain)"
    read answer
    shopt -s nocasematch
    if [[ "$answer" = "y" ]]; then
    if [[ -s /proc/config.gz ]]; then
    echo "Extracting config from /proc/config.gz..."
    modprobe configs
    zcat /proc/config.gz > ./.config
    else
    echo "You kernel was not compiled with IKCONFIG_PROC. Using stock ARCH kernel .config (with BFS and TuxOnIce enabled)"
    fi
    fi
    if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|g" ./.config
    fi
    # Make some good use of MAKEFLAGS
    MAKEFLAGS=`grep -v '#' /etc/makepkg.conf | grep MAKEFLAGS= | sed s/MAKEFLAGS=// | sed s/\"//g`
    # get kernel version
    make ${MAKEFLAGS} prepare
    # uncomment to decrease kernel size and compilation time. However, be prepared to deal with missing modules :P
    # make localmodconfig
    # allows you to edit config
    # make menuconfig && cp -v .config ${startdir}/config && msg "Stopping build"
    # load configuration
    # yes "" | make config
    # This allows building cpu-optimized packages with according package names.
    # Useful for repo maintainers.
    CPU=`egrep "MK8=y|MCORE2=y|MPSC=y|MATOM=y|MPENTIUMII=y|MPENTIUMIII=y|MPENTIUMM=y|MPENTIUM4=y|MK7=y|CONFIG_GENERIC_CPU=y|CONFIG_X86_GENERIC=y" ./.config`
    CPU=`sed -e "s/CONFIG_M\(.*\)=y/\1/" <<<$CPU`
    case $CPU in
    CORE2)
    pkgname="${_pkgname}-core2"
    pkgdesc="${_pkgdesc} Intel Core2 optimized."
    K8)
    pkgname="${_pkgname}-k8"
    pkgdesc="${_pkgdesc} AMD K8 optimized."
    PSC)
    pkgname="${_pkgname}-psc"
    pkgdesc="${_pkgdesc} Intel Pentium4/D/Xeon optimized."
    ATOM)
    pkgname="${_pkgname}-atom"
    pkgdesc="${_pkgdesc} Intel Atom optimized."
    K7)
    pkgname="${_pkgname}-k7"
    pkgdesc="${_pkgdesc} AMD K7 optimized."
    PENTIUMII)
    pkgname="${_pkgname}-p3"
    pkgdesc="${_pkgdesc} Intel Pentium3 optimized."
    PENTIUMIII)
    pkgname="${_pkgname}-p2"
    pkgdesc="${_pkgdesc} Intel Pentium2 optimized."
    PENTIUMM)
    pkgname="${_pkgname}-pm"
    pkgdesc="${_pkgdesc} Intel Pentium-M optimized."
    PENTIUM4)
    pkgname="${_pkgname}-p4"
    pkgdesc="${_pkgdesc} Intel Pentium4 optimized."
    default)
    pkgname="${_pkgname}"
    pkgdesc="Linux kernel and modules with pf-kernel patch [-ck patchset (BFS included), tuxonice, BFQ, IMQ]. Also included: aufs2 and squashfs-lzma."
    esac
    # build!
    _kernver="$(make kernelrelease)"
    make ${MAKEFLAGS} bzImage modules
    ### package_kernel26
    mkdir -p ${pkgdir}/{lib/modules,boot}
    make INSTALL_MOD_PATH=${pkgdir} modules_install
    cp System.map ${pkgdir}/boot/System.map26${_kernelname}
    cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}
    # add vmlinux
    # cp vmlinux ${pkgdir}/usr/src/linux-${_kernver}
    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
    # 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
    ### package_kernel26-headers
    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 generated 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/
    [[ -e 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 for 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
    chown -R root.root ${pkgdir}/usr/src/linux-${_kernver}
    find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    cd ${pkgdir}/lib/modules/${_kernver} && \
    (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
    # 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}
    # remove the firmware
    rm -rf ${pkgdir}/lib/firmware
    # eof
    kernel26.preset
    # mkinitcpio preset file for kernel26
    # DO NOT EDIT THIS LINE:
    source /etc/mkinitcpio.d/kernel26-livez.kver
    ALL_config="/etc/mkinitcpio.conf"
    PRESETS=('default' 'fallback')
    #default_config="/etc/mkinitcpio.conf"
    default_image="/boot/kernel26-livez.img"
    #default_options=""
    #fallback_config="/etc/mkinitcpio.conf"
    fallback_image="/boot/kernel26-livez-fallback.img"
    fallback_options="-S autodetect"
    kernel26.install
    # arg 1: the new package version
    # arg 2: the old package version
    KERNEL_NAME=-livez
    KERNEL_VERSION=2.6.35-livez
    post_install () {
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod $KERNEL_VERSION
    # generate init ramdisks
    echo ">>> MKINITCPIO SETUP"
    echo ">>> ----------------"
    echo ">>> If you use LVM2, Encrypted root or software RAID,"
    echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
    echo ">>> More information about mkinitcpio setup can be found here:"
    echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
    echo ""
    echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
    post_upgrade() {
    pacman -Q grub &>/dev/null
    hasgrub=$?
    pacman -Q grub2 &>/dev/null
    hasgrub2=$?
    pacman -Q lilo &>/dev/null
    haslilo=$?
    # reminder notices
    if [ $haslilo -eq 0 ]; then
    echo ">>>"
    if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
    echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
    else
    echo ">>> You appear to be using the LILO bootloader. You should run"
    echo ">>> 'lilo' before rebooting."
    fi
    echo ">>>"
    fi
    if grep "^[^#]*/boot" /etc/fstab 2>&1 >/dev/null; then
    if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
    echo "WARNING: /boot appears to be a seperate partition but is not mounted"
    echo " This is most likely not what you want. Please mount your /boot"
    echo " partition and reinstall the kernel unless you are sure this is OK"
    fi
    fi
    if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
    # important upgrade notice
    echo ">>>"
    echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
    echo ">>> -------------------------------"
    echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
    echo ">>> If you still use DevFS, please make the transition to uDev before"
    echo ">>> rebooting. If you really need to stay with DevFS for some reason,"
    echo ">>> then you can manually downgrade to an older version:"
    echo ">>>"
    echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
    echo ">>>"
    echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
    echo ">>> IgnorePkg list in /etc/pacman.conf"
    echo ">>>"
    echo ">>> (NOTE: The following portion applies to uDev users as well!)"
    echo ">>>"
    echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
    echo ">>> be able to boot! Change your root= parameter to use the classic"
    echo ">>> naming scheme."
    echo ">>>"
    echo ">>> EXAMPLES:"
    echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
    echo ">>> - change root=/dev/md/0 to root=/dev/md0"
    echo ">>>"
    fi
    # generate new init ramdisk
    if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> --------------------------------------------------------------"
    echo ">>> | WARNING: |"
    echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
    echo ">>> | Please change to Mkinitcpio setup. |"
    echo ">>> --------------------------------------------------------------"
    echo ">>>"
    fi
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod $KERNEL_VERSION
    echo ">>> MKINITCPIO SETUP"
    echo ">>> ----------------"
    if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
    echo ">>> Please change your bootloader config files:"
    echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
    echo "------------------------------------------------"
    echo "| - initrd26.img to kernel26${KERNEL_NAME}.img |"
    echo "| - initrd26-full.img to kernel26${KERNEL_NAME}-fallback.img |"
    echo "------------------------------------------------"
    fi
    if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    echo ""
    echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
    echo ">>> ----------"
    echo ">>> To use the new pata drivers, change the 'ide' hook "
    echo ">>> to 'pata' in /etc/mkinicpio.conf HOOKS="
    echo ">>> The new system changes: /dev/hd? to /dev/sd?"
    echo ">>> Don't forget to modify GRUB, LILO and fstab to the"
    echo ">>> new naming system. "
    echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
    echo ""
    echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
    echo "----------"
    echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf"
    echo ">>> the 'ata_piix' module will be used."
    echo ">>> This may cause your devices to shift names, eg:"
    echo ">>> - IDE: devices from hd? to sd?"
    echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
    echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix"
    echo ""
    fi
    echo ">>> If you use LVM2, Encrypted root or software RAID,"
    echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
    echo ">>> More information about mkinitcpio setup can be found here:"
    echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
    echo ""
    echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
    if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME} -m "ATTENTION:\nIf you get a kernel panic below
    and are using an Intel chipset, append 'earlymodules=piix' to the
    kernel commandline"
    else
    /sbin/mkinitcpio -p kernel26${KERNEL_NAME}
    fi
    if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
    echo ""
    echo "Important ACPI Information:"
    echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
    echo ">>> The modules are located at:"
    echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
    echo ">>> For more information about ACPI modules check this wiki page:"
    echo ">>> 'http://wiki.archlinux.org/index.php/ACPI_modules'"
    fi
    post_remove() {
    rm -f /boot/kernel26${KERNEL_NAME}.img
    rm -f /boot/kernel26${KERNEL_NAME}-fallback.img
    so, I just tar.gz the kernel26-livez folder which contains
    config
    config.x86_64
    kernel26.install
    kernel26.preset
    PKGBUILD
    and submit to AUR??
    first, I'm going to run it thru the motions on my 32bit and x86_64 arch installs to test it
    as I already have compiled it successfully, and now want to package it,etc
    thanks for all your help!
    PS
    I also have to make a AUR package for the linux-live-6.30_x86 and linux-live-6.3.0x86_64 remaster kits which this kernel is meant for
    and gotta figure out how to do that too...
    Last edited by 72linus (2010-09-27 20:26:04)

  • [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)

Maybe you are looking for