Compile Kernel rc - clarifying questions

Since I never compiled a kernel myself, and managed to screw up my system with far less sensitive tasks in the past:
I want to build 2.6.32-rc6, but have no interest/time to dive into custom configuration.
Is it save to download all the files for the current kernel26 package from svn, adjust the PGKBUILD for .32 (source, kernel name), build and install with pacman?
Can I substitute the arch patch in the PGKBUILD with the upstream patch for .32 (just skimmed through, but seemed to me that the only other patch was for aufs2)?
And would all this result in a "nearly" stock arch configured 2.6.32-rc6 kernel?

That should work.  You'll want to change the pkgver to 2.6.32_rc6 or something, so you might have to change some things that rely on the pkgver in the PKGBUILD.
Alternatively you can use kernel26-git from AUR.  It's a bit more bleeding edge than the -rcs, but I've been running it for a while with no problems.

Similar Messages

  • Preferred way to compile kernel?

    After the discussion here:
    http://bbs.archlinux.org/viewtopic.php?t=4057&start=30
    I'm wondering which way most people use for compiling their kernel. I've used /usr/src because its simpler and makes me feel more in control.  Having an Arch package for the custom kernel has no real value, according to apeiro.  Plus, using /usr/src has the kernel headers in place automatically, useful for programs that need it. (This offset by the fact that the kernel package copies the necessary files into place anyway). However, using ABS has the advantage of automating a lot of the task using Arch systems, rather than, for example, a custom shell script. (I'm trying an ABS version right now, for comparison).
    Both methods are described in the wiki. I'm going to be cleaning up and expanding both shortly.
    I'm asking this question in order to semi-standardize the process. Some people might say that the Arch philosophy is "There is more than one way to do everything", but I believe we could also append "but there is a best way to do it and Arch suggests that way". Now I want to find out which way is best in this case.
    I'd be most interested in "I use xyz method because... [valid reason]" statements, rather than just "I use xyz".
    Dusty

    The 'abs' way was basically my idea - or at least the first wiki entry about it, I don't know if anyone tried it that way before. I thougt it could be a nice automatism, to have a proper kernel configuration once, tweak the PGKBUILD file, and after all is set up, all I had to change was the version number of the package/kernel source or change the config, and run makepkg then. I once made it switching from kernel24 to 26, using my own config. It worked fine. So, I thought it could be helpfull writing it to the wiki.
    But this idea has some disadvantages, too. F.e., if you compile a minor upgrade, you may construct a modules mess, as a lot of files are already existing. Therefore, all cases must be thoroughly considered and configurated. Kernel addicts would prefer to patch the kernel instead of fully refetch the source.
    After playing around with the idea for a while, I decided the work of configurating all possible eventuallities in compiling kernels by using abs was to difficult. Using the standard procedures seemed straight and easy to me.
    So I removed my 'arch way' section in the kernel compiling wiki. Nevertheless, another user started an abs kernel wiki, redevelopping and enhancing my idea.
    The idea is still attractive.

  • Compiling kernel module

    Hello. I tryed to compile kernel module
    /home/das/job/C/foo.c:
    #include <linux/module.h>
    #include <linux/kernel.h>
    int init_module(void)
    printk(KERN_INFO "Hello world 1.\n");
    return 0;
    void cleanup_module(void)
    printk(KERN_INFO "Goodbye world 1.\n");
    I created /home/das/job/C/Makefile:
    obj-m += foo.o
    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
    clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
    But when i tryed to compile it with command make I take the error:
    make -C /lib/modules/2.6.33-ARCH/build M=/home/das/job/C modules
    make: *** /lib/modules/2.6.33-ARCH/build: No such file or directory. Stop.
    make: *** [all] Error 2
    My question is what is wrong and how i can compile module?
    Last edited by F1sher (2011-11-01 15:37:51)

    tomk wrote:Install it somewhere under /lib/modules/2.6.32-lts, run depmod, and modprobe it.
    After
    depmod -a
    modprobe module
    I can't start my system. GDM start but keyboard and mice don't work

  • Cant boot a compiled kernel

    Hi,
    I want to use Arch to mess with the source of linux 3.2.7. Unfortunately, I cannot even get the regular 3.2.7 kernel to boot.
    I basically followed the guide at:
    https://wiki.archlinux.org/index.php/Ke … raditional
    I downloaded the source, did make mrproper, make menuconfig, make all and make modules_install. I copied arch/x86/bzImage to /boot as well as System.map and created a cpio ramdisk using mkinitcpio using
    mkinitcpio -g /boot/initramfs-test.img -k 3.2.7-test
    In the end my /boot contained:
    initramfs-test.img
    vmlinuz-test
    System.map-test
    I tried booting with Syslinux, GRUB and GRUB2 modifying the options for all of them appropriately.
    For Syslinux and GRUB if use a UUID in the root field for their respective config files I get the error that the root device cannot be found during boot. If I use root=/dev/sda4 (which is my root partition, checked it using stat /dev/sda4) I successfully mount the root partition but get an error that /sbin/init does not exist. That's weird since /sbin/init is there. I believe both of these errors have something to do with ramdisk but not sure what.
    With GRUB2 booting just freezes at "Loading init ramdisk".
    I read a ton on these errors online and tried all kinds of stuff and could not get it to work. Any help will be greatly appreciated!
    Thanks

    Thanks tomk and sorry for the ambiguous post.
    I actually managed to get it finally running, I basically screwed up my .config file. This was not obvious to me at all (total noob at compiling kernels). I just used my current arch config file instead of messing with menuconfig myself and it worked.  I still don't know why it works, so if you could point me to a source of enlightenment I would appreciate that. Right now compilation time is atrocious even with the -j option for make.
    Regarding your question, I want to screw around with the latest pax patch and add some hooks of my own to security.h which is why I need 3.2.7.
    Thanks again

  • How to edit GRUB for boot new compile kernel?

    I compile the newest Linux kernel.
    I read Archlinux wiki about how to edit GRUB for boot new compile kernel,
    but Archlinux wiki do not reference to it.
    Who can help me, baby?

    bangkok_manouel wrote:
    how did you build your kernel? traditional way or arch way?
    if it's the arch way (TM), here's an example of a custom kernel with -mm patch.
    what I have in /boot:
    -rw-r--r-- 1 root root 4.3M 2008-12-23 09:52 kernel26mm-fallback.img
    -rw-r--r-- 1 root root 668K 2008-12-23 09:52 kernel26mm.img
    -rw-r--r-- 1 root root 764K 2008-12-22 18:44 System.map26mm
    -rw-r--r-- 1 root root 1.7M 2008-12-22 18:44 vmlinuz26mm
    now here's the /boot/grub/menu.lst related entry (you may add the fallback one):
    # (2) Arch Linux
    title  kernel26mm
    root   (hd0,0)
    kernel /vmlinuz26mm root=/dev/sda5 ro vga=773
    initrd /kernel26mm.img
    Should be traditional way.

  • [SOLVED]Compiling kernel fails with segfault

    Hi guys,
    I'm out of answers.
    The situation :
    Compiling kernel randomly stops with : "segmentation fault" and never runs through.
    Reissuing make will make it continue until it will fail at some other point.
    Background:
    The system feels completely unstable to say the least, but nothing 100 % reproduceable ( vuze(java) crash, firefox/chromuim flash sites crash every 120 seconds, X crashes once a day , for instance when moving tvtime around, kernel oops daily, sometimes hard lockups, logs of yesterdays oops : http://pastie.org/private/imrqdzdbejdb3jxn4czuw )
    But only the kernel compile is 100 % reproduceable so this must be fixed asap.
    Specs:
    intel e8400,nvidia gtx260, 2 G ddr2,Gigabyte EP45-UD3R, "gigs of space", off. arch kernel 2.6.33-ARCH , x86_64,  "bigtime" cooling :
    cpu temps 50 C° max  during compiling
    What configs/packages are important ? I got paranoid and ditched my old makgepkg.conf and used a newer *.pacnew file , I used to have  :MAKEFLAGS="-j3" but not in this config :
    http://pastie.org/private/4ryshivi2hgyqenjlkicg
    local packages:
    local/gcc 4.5.0-1 (base-devel)
        The GNU Compiler Collection
    local/gcc-libs 4.5.0-1 (base)
        Runtime libraries shipped by GCC for C and C++ languages
    Anything else updated daily.
    The blowup:
    http://pastie.org/private/hoamev0sli7zapbr0xvpbq
    What I tried:
    fsck -f: it fixed two inodes, but still the same behavior
    badblocks -nvs : three hours of badblock testing, 0 hits
    memtest : two passed runs, no errors
    stress from AUR, 15 minutes :
    stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 15m
    stress: info: [26841] dispatching hogs: 8 cpu, 4 io, 2 vm, 0 hdd
    stress: info: [26841] successful run completed in 900s
    Max coretemp was 52 C° during stress.
    The usual footnote statement ^_^ :
    On w7 _everything_ runs stable.
    And not only stable , I'm able to OC this box to 4.5 GHz and game under w7 without a prop for hours, well this is what it was build for at some point.
    Conclusion:
    So I'd say hardware wise this box kicks ass and now software wise my Arch kicks me in the a**.
    I doubt there is a faulty hardware part, but what else could it be ?
    Last edited by tuxfusion (2010-05-17 22:48:06)

    Update:
    Trying to compile another big package just to have another result, gcc itself now :
    - segfault after 4 m18 s
    - segfault after 5 m50 s
    Update²:
    I think I found a faulty BIOS setting in my non-OC profile concerning DRAM termination, which said "normal" where "auto" would be correct.
    My OC-profile has this setting correct and since I run this profile in Arch only it might explain that w7 did not fail.
    Still have to verify this but i makes perfect sense, only gcc seems to trigger this. Compiling gcc still running with over 10 minutes in the game now.
    After hitting 4.5 GHz with OC I must have reset the non OC-profile wrong.
    *slams head on desk*
    Last edited by tuxfusion (2010-05-17 13:10:04)

  • [SOLVED] error compiling kernel 2.6.29

    Hi,
    Due to having the DVD-S card mentioned here
    http://www.linuxtv.org/pipermail/linux- … 23265.html
    I am trying to compile kernel 2.6.29.6 with the above mentioned patch but get an error:
    include/sound/soc-dai.h: At top level:
    include/sound/soc-dai.h:224:25: error: duplicate member ‘codec’
    sound/soc/soc-core.c: In function ‘snd_soc_init_card’:
    sound/soc/soc-core.c:1360:18: warning: variable ‘ac97’ set but not used
    [-Wunused-but-set-variable]
    make[2]: *** [sound/soc/soc-core.o] Error 1
    make[1]: *** [sound/soc] Error 2
    make: *** [sound] Error 2
    bash: vim include/sound/soc-dai.h
            /* DAI runtime info */
            struct snd_pcm_runtime *runtime;
            struct snd_soc_codec *codec;
            unsigned int active;
            unsigned char pop_wait:1;
            void *dma_data;
            /* DAI private data */
            void *private_data;
            /* parent codec/platform */
            union {
                    struct snd_soc_codec *codec;
                    struct snd_soc_platform *platform;
    Note:
    I found a solution:
    http://mailman.alsa-project.org/piperma … 16949.html
    Last edited by casacristo (2011-10-19 07:46:01)

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

  • Update modules with compiling kernel from soure issue.

    Compiling kernel from abs or aur take me much time, so i decide compile kernel from source, compilation and installation successfully but make initial RAM disk doesn't update full modules (crypto,lvm...). I specified -c option to /etc/mkinitcpio.conf but the result is the sam, non-autodectec doesn't help too. When i look into /lib/modules directory, 3.6.6-1-ARCH folder contain "kernel" folder which has a lot of things (arch, crypto, net..) and i think this is my extra modules were declared in HOOK array's mkinitcpio.conf. The another one only contain net folder so i can't boot into this kernel without having loaded others.
    any suggestion for this problem? tks for reply.

    am sorry, i re-tried with HOOK array without autodectect and it can load modules but there are two error:
    ==> ERROR: module not found: `dm-crypt`
    ==> ERROR: modules not found: `dm-snapshot`
    ok i will try to load these modules by manually.
    EDIT: i tried to load dm-mod, dm-crypt, dm-snapshot but it isn't helpful. Errors still remain. any suggestion?
    Last edited by angelfalls (2012-11-12 23:33:53)

  • Cross compile kernel

    I have compiled a few kernels in an environment in which it's designed to run on - but cross compiling is completely new to me. However - I will persevere because I have wanted to learn this for a while now.
    The target system is an arm based board for a NAS. I am using QEMU to install and configure a Debian system but it requires a working kernel in order to boot.
    I have installed the arm-elf-gcc-base package (which I assume is the toolchain - am I wrong on this?) but I don't know where to go from there.
    How do I invoke this particular toolchain to compile a kernel for the target arch?
    Any other pointers or 'gotchas' would be greatly appreciated.
    Thank you.

    Which board is it?
    Even if you manage to cross compile, kernel will need some extra configuration or patching to boot in qemu.
    I have Raspberry Pi and qemu needs custom kernel to boot RPi images, but it's almost useless since there is
    no support for network adapter. I have never cross compiled anything for it, but you might want to read on RPi
    kernel cross compilation since there is a lot of documentation and you probably need just a different toolchain.
    What I'm doing is distributed cross compiling via distcc. That way most of work gets done on my laptop, but it's
    still quite slow because makepkg doesn't support distcc pump for distributing pre-processing.
    I'm using toolchain provided by Arch Linux ARM project because I run Arch on RPi. If you can find crosstool config for
    your board, making toolchain shouldn't be too difficult. This should get you started.

  • A PKGBUILD that helps you compile kernel from local source tree

    I don't know if someone did this beofore. Hours ago I wrote a PKGBUILD file for compiling kernel,
    it is different than the one from abs. It allows you
    compile a kernel from a exiting kernel source tree and leave it clean.
    honor the Archway, this means you have a clean filesystem
    It is acutally because I'm currently playing with The Eudyptula Challenge.
    and I'm tied our compress/decompress a kernel tree all the time. If you are kernel developer, you
    may also find it useful.
    The PKGBUILD file worked on my machine, I will add headers and docs later.
    Oh, almost forgot: here is my PKGBUILD:
    #So we will have a clean src tree
    pkgbase=linux-test
    _kernel_bin=kernel_build
    #the variable you have to provide
    _builddir=kernel_build
    kernel_src_dir='/home/developer/Courses/kernel-base'
    _srcname=kernel_tree
    #end the variable you have to provide
    pkgver=3.8.1
    pkgrel=1
    pkgdesc="The Linux kernel and modules"
    depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
    makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
    optdepends=('crda: to set the correct wireless channels of your country')
    provides=("kernel26${_kernelname}=${pkgver}")
    conflicts=("kernel26${_kernelname}")
    replaces=("kernel26${_kernelname}")
    arch=('i686' 'x86_64')
    url="http://www.kernel.org/"
    license=('GPL2')
    source=(#if we provide this, means kernel compile progress is already done
    "${_kernel_bin}.tar.xz"
    'linux.preset'
    sha256sums=('65847bc847344434657db729d2dde4a408e303ea29ae1409520cecee8da6fc3d'
    '2c2e8428e2281babcaf542e246c2b63dea599abb7ae086fa482081580f108a98')
    #this one strip the linux off
    _kernelname=${pkgbase#linux}
    prepare() {
    #XXX:checked
    #build dir has to be the same as kernel_bin files, then builddir is created
    #automatically by tar
    if [ "${kernel_src_dir}" == "" ];then
    return 1
    fi
    #provide kernel source tree for compile and move modules
    ln -s ${kernel_src_dir} ${srcdir}/${_srcname}
    mkdir -p "${srcdir}/${_srcname}"
    #we need to check here if there exist kernel bin files
    if [ "${_kernel_bin}" == "" ]; then
    make O="${srcdir}/${_builddir}" menuconfig
    fi
    build() {
    #XXX:checked
    cd "${srcdir}/${_srcname}"
    #we need to check here if there exist kernel bin files
    if [ "${_kernel_bin}" == "" ]; then
    #return 1
    make O="${srcdir}/${_builddir}" bzImage modules
    fi
    #otherwise this step is done already done
    _package() {
    #we dont need to worry about mkinitcpio, depmod thing, They are done by
    #install script, we need to provide a preset and install file instead.
    #we build kernel objs on _builddir, and install them in pkgdir
    #install binary files, this means we have a compiled binary tree
    cd "${srcdir}/${_srcname}"
    #echo "$(pwd)"
    KARCH=x86
    install=linux.install
    # get kernel version
    _kernver="$(make O="${srcdir}/${_builddir}" kernelrelease)"
    _kernver=$(echo "${_kernver}" | sed -n 2p -)
    #strip the -dirty away
    _kernver=${_kernver%-*}
    _basekernel=${_kernver%%-*}
    _basekernel=${_basekernel%.*}
    mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
    make O="${srcdir}/${_builddir}" INSTALL_MOD_PATH="${pkgdir}" modules_install
    cp "${srcdir}/${_builddir}"/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}/" -i "${startdir}/${install}"
    sed "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" -i "${startdir}/${install}"
    # install mkinitcpio preset file for kernel
    install -D -m644 "${srcdir}/linux.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\"|" \
    -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...
    #echo "Call Depmod"
    cp "${srcdir}/${_builddir}/System.map" System.map
    depmod -b "${pkgdir}" -F System.map "${_kernver}"
    #echo "Called Depmod"
    # move module tree /lib -> /usr/lib
    mkdir -p "${pkgdir}/usr"
    mv "${pkgdir}/lib" "${pkgdir}/usr/"
    # add vmlinux
    install -D -m644 "${srcdir}/${_builddir}/"vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
    pkgname=("${pkgbase}")
    for _p in ${pkgname[@]}; do
    eval "package_${_p}() {
    _package${_p#${pkgbase}}
    done
    and here is the address of it on github
    Last edited by xedchou (2014-12-23 12:41:55)

    Based on the title alone I almost reflexively binned this thread.  Please rename this thread to *something* relating to what you're actually posting.

  • Questions about compiling kernel on archlinux

    hi...i'm new of this forum and new of archlinux
    i'm tryng to compiling a custom kernel in order not to replace the kernel26 package.. i prefere to make it with abs for managing it with pacman.. i followed the wiki but something went wrong.... i used both the pkgbuild i found on the wiki but nothing...can someone help me please??

    if it can be of any help, this works for me too. actually, it's the official arch kernel PKGBUILD (maybe not the latest one) that I've just changed according to my needs:
    # $Id: PKGBUILD 17203 2008-10-26 20:28:29Z tpowa $
    # Maintainer: Tobias Powalowski <[email protected]>
    # Maintainer: Thomas Baechler <[email protected]>
    pkgname=kernel26mm
    _basekernel=2.6.27
    pkgver=2.6.28
    pkgrel=5
    _patchname="patch-${pkgver}-${pkgrel}-ARCH"
    pkgdesc="The Linux Kernel and modules"
    arch=(i686 x86_64)
    license=('GPL2')
    groups=('base')
    url="http://www.kernel.org"
    backup=(etc/mkinitcpio.d/${pkgname}.preset)
    depends=('coreutils' 'module-init-tools' 'mkinitcpio>=0.5.18')
    # 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')
    install=kernel26mm.install
    source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
    ftp://ftp.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.28-rc2.bz2
    http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.28-rc2/2.6.28-rc2-mm1/2.6.28-rc2-mm1.bz2
    # the main kernel config files
    config config.x86_64
    iosched-bfq-03-update-kconfig-kbuild.patch
    iosched-bfq-02-add-bfq-scheduler.patch
    iosched-bfq-01-prepare-iocontext-handling.patch
    zen.git-aircrack.patch
    march-native.patch
    # standard config files for mkinitcpio ramdisk
    kernel26mm.preset)
    build() {
    KARCH=x86
    cd $startdir/src/linux-$_basekernel
    # Add -ARCH patches
    # See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
    patch -Np1 -i $startdir/src/patch-2.6.28-rc2 || return 1
    patch -Np1 -i $startdir/src/2.6.28-rc2-mm1 || return 1
    patch -Np1 -i $startdir/src/iosched-bfq-01-prepare-iocontext-handling.patch || return 1
    patch -Np1 -i $startdir/src/iosched-bfq-02-add-bfq-scheduler.patch || return 1
    patch -Np1 -i $startdir/src/iosched-bfq-03-update-kconfig-kbuild.patch || return 1
    patch -Np1 -i $startdir/src/zen.git-aircrack.patch || return 1
    patch -Np1 -i $startdir/src/march-native.patch || return 1
    sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION =|g' Makefile
    if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
    else
    cat ../config >./.config
    fi
    # build the full kernel version to use in pathnames
    . ./.config
    ### next line is only needed for rc kernels
    #_kernver="2.6.25${CONFIG_LOCALVERSION}"
    _kernver="2.6.28${CONFIG_LOCALVERSION}"
    # load configuration
    make menuconfig
    # build!
    # stop here
    # this is useful to configure the kernel
    #msg "Stopping build"
    #return 1
    make bzImage modules || return 1
    mkdir -p $startdir/pkg/{lib/modules,boot}
    make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
    cp System.map $startdir/pkg/boot/System.map26mm
    cp arch/$KARCH/boot/bzImage $startdir/pkg/boot/vmlinuz26mm
    install -D -m644 Makefile \
    $startdir/pkg/usr/src/linux-${_kernver}/Makefile
    install -D -m644 kernel/Makefile \
    $startdir/pkg/usr/src/linux-${_kernver}/kernel/Makefile
    install -D -m644 .config \
    $startdir/pkg/usr/src/linux-${_kernver}/.config
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/include
    for i in acpi asm-{generic,x86} config linux math-emu media net pcmcia scsi sound video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-${_kernver}/include/
    done
    # copy files necessary for later builds, like nvidia and vmware
    cp Module.symvers $startdir/pkg/usr/src/linux-${_kernver}
    cp -a scripts $startdir/pkg/usr/src/linux-${_kernver}
    # fix permissions on scripts dir
    chmod og-w -R $startdir/pkg/usr/src/linux-${_kernver}/scripts
    #mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/.tmp_versions
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/kernel
    cp arch/$KARCH/Makefile $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/
    if [ "$CARCH" = "i686" ]; then
    cp arch/$KARCH/Makefile_32.cpu $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/
    fi
    cp arch/$KARCH/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-${_kernver}/arch/$KARCH/kernel/
    # add headers for lirc package
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/drivers/media/video
    cp drivers/media/video/*.h $startdir/pkg/usr/src/linux-${_kernver}/drivers/media/video/
    for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/drivers/media/video/$i
    cp -a drivers/media/video/$i/*.h $startdir/pkg/usr/src/linux-${_kernver}/drivers/media/video/$i
    done
    # add dm headers
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/drivers/md
    cp drivers/md/*.h $startdir/pkg/usr/src/linux-${_kernver}/drivers/md
    # add inotify.h
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/include/linux
    cp include/linux/inotify.h $startdir/pkg/usr/src/linux-${_kernver}/include/linux/
    # add CLUSTERIP file for iptables
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/net/ipv4/netfilter/
    # add wireless headers
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/net/mac80211/
    cp net/mac80211/*.h $startdir/pkg/usr/src/linux-${_kernver}/net/mac80211/
    # add dvb headers for external modules
    # in reference to:
    # http://bugs.archlinux.org/task/9912
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
    cp drivers/media/dvb/dvb-core/*.h $startdir/pkg/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 $startdir/pkg/usr/src/linux-${_kernver}/include/config/dvb/
    cp include/config/dvb/*.h $startdir/pkg/usr/src/linux-${_kernver}/include/config/dvb/
    # add xfs and shmem for aufs building
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/fs/xfs
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/mm
    cp fs/xfs/xfs_sb.h $startdir/pkg/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h
    # add vmlinux
    cp vmlinux $startdir/pkg/usr/src/linux-${_kernver}
    # copy in Kconfig files
    for i in `find . -name "Kconfig*"`; do
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-${_kernver}/$i
    done
    cd $startdir/pkg/usr/src/linux-${_kernver}/include && ln -s asm-$KARCH asm
    chown -R root.root $startdir/pkg/usr/src/linux-${_kernver}
    find $startdir/pkg/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
    cd $startdir/pkg/lib/modules/${_kernver} && \
    (rm -f source build; ln -sf ../../../usr/src/linux-${_kernver} build)
    # install fallback mkinitcpio.conf file and preset file for kernel
    install -m644 -D $startdir/src/${pkgname}.preset $startdir/pkg/etc/mkinitcpio.d/${pkgname}.preset || return 1
    # set correct depmod command for install
    sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" $startdir/kernel26mm.install
    echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${startdir}/pkg/etc/mkinitcpio.d/${pkgname}.kver
    # remove unneeded architectures
    rm -rf $startdir/pkg/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
    just replace all the kernel26mm by kernel26mycustomkernelname. same below with the install file and of course in your kernel config.
    # arg 1: the new package version
    # arg 2: the old package version
    KERNEL_VERSION=2.6.28-mm
    post_install () {
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod $KERNEL_VERSION > /dev/null 2>&1
    # 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 kernel26mm
    post_upgrade() {
    pacman -Q grub &>/dev/null
    hasgrub=$?
    pacman -Q lilo &>/dev/null
    haslilo=$?
    # reminder notices
    if [ $haslilo -eq 0 ]; then
    echo ">>>"
    if [ $hasgrub -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
    # updating module dependencies
    echo ">>> Updating module dependencies. Please wait ..."
    depmod -v $KERNEL_VERSION > /dev/null 2>&1
    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..."
    if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
    /sbin/mkinitcpio -p kernel26mm -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 kernel26mm
    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
    op=$1
    shift
    $op $*
    Last edited by bangkok_manouel (2009-01-27 13:55:34)

  • Self-compiled kernel wont boot [solved]

    Hey, I compiled a kernel yesterday using the PKGBUILD from http://wiki.archlinux.org/index.php/Ker … n_with_ABS
    All went fine, i made a init thing with mkinitcpio -g /boot/mykernel.img -k 2.6.18.1-mykernel and it went fine, i added it to menu.lst (grub) and rebooted,
    at first it says it can't parse block device name for '/dev/sda6' (wich is my root partition) then i added rootfstype=ext3/ext2 (I tried both since i know i have one of them but cfdisk shows amoeba =/ )
    but i still get the error 'cannot open root device dev(0,0)' (and also 'kinit: init not found') and then a kernel panic.
    This is the boot part of menu.lst for the kernel
    title [Arch mykernel]
    root (hd0,0)
    kernel /vmlinuz-2.6.18.1-mykernel root=/dev/sda6 rootfstype=ext3 ro
    initrd /mykernel.img
    and this is the hook line from mkinitcpio.conf (all other lines where either comments or ="" so i decided to exclude them).
    HOOKS="base udev autodetect usb ide scsi sata filesystems"
    also, i have some trouble with ata2.01 "qc timeout (cmd 0xa1)" something, is there a way to save the output of a boot?
    --SOLVED--
    I forgot -ARCH in the mkinitcpio -k argument.

    tomk wrote:
    firedance wrote:I do feel as you are treating me like i would treat an idiot  :?
    Perhaps somebody else should help you, in that case.
    I answered you original post with the understanding that you had chosen to use mkinitcpio, and were therefore familiar with the way it worked. Your follow-up suggested that this might not be the case, so I clarified my original answer.
    firedance wrote:I'm not sure if that's so smart tho if i load a module thats also in the kernel
    Given your previous reaction, I won't comment on whether it's smart or not - I will simply say that it won't work.
    firedance wrote:when i used the right parameter it started complaining about missing modules.
    Which missing modules did it complain about?
    As topic states this is solved, it complained about usb-storage (wich i had compiled into the kernel) It didn't complain about ext2 since i had allready been messing around with the kernel and recompiled it with ext2 as a module. It did work to just do make modules and make modules_install for the usb-storage. But then again, maybe i was very lucky and accedently made it a module on the same time as making ext2 a module 
    I will recompile the kernel tonight so i am sure it is with ext2 and usb-storage only as modules.

  • Compiling kernel archlinux [SOLVED]

    Hi everybody, I have just registered on the forum and I'm a new arch user.
    I have a couple of problems that I would like to discuss about:
    First problem: I downloaded all the base sistem and linux headers to make a new compilation of the kernel and after having prepared my configuration file, when I hit make, I get this message:
    linux-3.8.11-1-ARCH]# make -j2
    scripts/kconfig/conf --silentoldconfig Kconfig
    # configuration written to .config
    scripts/Makefile.build:44:
    /usr/src/linux-3.8.11-1-ARCH/arch/x86/syscalls/Makefile: No such file or
    directory
    make[1]: *** No rule to make target
    `/usr/src/linux-3.8.11-1-ARCH/arch/x86/syscalls/Makefile'.  Stop.
    make: *** [archheaders] Error 2
    make: *** Waiting for unfinished jobs....
    I checked the configuration of the kernel and I tried to remove every voice which has something to do with syscalls, but I still get the mistake.
    Do you have any idea of the problem?
    Second problem:
    My boot manager is lilo and the system unfortunaly is configure this way:
       Name        Flags      Part Type  FS Type          [Label]        Size (MB)
        sda1        Boot        Primary   ext4                            104858.65*
        sda3                        Primary   ext4                             39999.54*
        sda5                        Logical   swap                              1998.75*
        sda6                        Logical   ntfs                            173213.40*
                                        Pri/Log   Free Space                           2.62*
    sda1 is arch linux and the kernel of the other linux distro is basically copied is in /boot of the sda1 partition. <-- is this a good way of operating for booting sda3?
    Third problem:
    When I boot arch linux I can't see the booting process and this annoy me tremendously, I checked on the the arch wiki for changing the boot debugging optionsbut I think I misunderstood something.
    Should I only add this line udev.log_priority=8  to /etc/udev/udev.conf to see the boot debugging?
    Thanks guys!
    Last edited by johnpuppa (2013-05-13 17:08:23)

    For the first problem, don't do that. You should never build and install packages directly on an Arch system.  Read up on makepkg and PKGBUILDs to learn how to build packages the right way now. It will make your life easier later.
    https://wiki.archlinux.org/index.php/Makepkg
    https://wiki.archlinux.org/index.php/Pkgbuild
    You can get the PKGBUILD for the kernel here (or by using one of the PKGBUILD retriever utilities, e.g. pbget:
    i686
    x86_64
    Aside from ensuring that the resulting file are properly managed by pacman (file tracking, dependency resolution), the PKGBUILD contains the full set of build instructions and will provide a good place to start if you want to customize them.
    For the second question, having multiple kernels in the same boot partition is fine, but you need to be careful to prevent one distribution from messing around with the files of the other, e.g. when updating your boot loader. I would probably let one distro fully manage the boot directory and manually copy in kernel images from the other when I need to.
    For the third question, does the following answer it? https://wiki.archlinux.org/index.php/Di … t_messages

  • Compile kernel 2.4 arch

    Hi guys, I need to compile manually the kernel 2.4 on archlinux. I need to do that for an university course I'm following. I did that several time with version 2.6 on gentoo, but now with version 2.4 on arch I got a problem: it seems I'm missing "genksyms" (I don't know exactly what it is). Can you tell me how to find and install it? Any other suggestion to deal with the compile process of kernel 2.4?? Thanks

    .:B:. wrote:
    Raffo wrote:
    .:B:. wrote:
    Are you aware that there are certain intricacies involved in building a 2.4 kernel on a system that is tuned for a 2.6 kernel?
    Does the word 'toolchain' mean anything to you without having to resort to google? If not, how about 'glibc'?
    I.e. do you know what you are trying to accomplish?
    I believe it's better to give informations in a post instead of writing questions to someone who's looking for a solution to his problem. However, I know that there can be differences, but since I never used the kernel 2.4 I don't know about the consequences. Again, it would have been better for me to learn something from your post.
    While it might not be what you were looking for, there is some very constructive material in my post. My questions - when answered - would have allowed you to put your own question in perspective.
    I did not say that I wouldn't try to answer to your questions, but I just believe that yours is not the way to help an user. Asking to "google it" is not very kind to me. However I can find all the other informations I need by myself, obviously, I was just talking about the way you answered. Sorry for the OT, this OT ends here, for me.
    If you refuse to do that, that's your choice. I'm trying to make you think about the ramifications of your little project.
    People who say or think complicated things are easy usually don't know anything about it .
    I'm not refusing to do that

  • Compiling kernel module on 64bit Solaris10  amd64 platform

    Hi,
    i m compiling my kernel module in Solaris10 booted in 64bit on amd64 platform.
    i m using two extra flags: -xarch=amd64 -xmodel=kernel
    But i m getting error s as follows:
    ld: fatal: file -c : open failed: No sich file or directory.
    ld: fatal: symbol '_fini' is multiply defined.
    (file /opt/SUNWspro/prod/lib/ctri.o type=FUNC; file bcmod.o type=FUNC) ;
    ld: fatal: symbol '_init' is multiply defined.
    (file /opt/SUNWspro/prod/lib/ctri.o type=FUNC; file bcmod.o type=FUNC) ;
    ld: fatal: file processing errors: No output written to a.out
    can somebody give hint .

    I think you need to take this question to an Open Solaris community forum at http://www.opensolaris.org
    Your question is not about the C compiler, but about how to build the Solaris kernel.

Maybe you are looking for

  • I can't buy any music because it tells me that my session has timed out!

    When it comes to confirme=ing my details - it always tells me that my session has timed out even though I have gone through all the pages so quickly!!

  • Move 10.5 Server HD from one G5 to another?

    Wow, I can't believe I'm posting this, but let's pretend it's 2007 and roll with it. So, I have a legacy FileMaker Server (FileMaker Server v10) running on a dual 2.3Ghz Power Mac G5 with Leopard Server (10.5.8). Aside from FileMaker Server, the only

  • No warning before moving the ~/Library folder...

    OSX 10.7.3 on Macbook Air 13.3' i5 1.7Ghz 128GB. Yesterday I was working on a Finder window opened on my ~/Library. As I accidentally dragged the icon displayed in the Title area, the OS lost my user settings... I quickly realized that my action caus

  • Emptied trash.. now I need to retrieve a .doc

    Deleted a MS word doc by accident (obviously). called Apple Cust Service a few times this afternoon hoping for advice. They offered forward me to Tech Support and/or Sales each time. Each time I was disconnected but not before it being suggested that

  • How to Import One Library (contents) to a New Library ?

    I have my Aperture Library on Computer 1 ( the library is backed up via Vault on my External HD )( note: computer 1 is going back to the store ) I want Computer #2 to use the Library thats on the External HD ( the same library from computer 1 ) I kno