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

Similar Messages

  • [SOLVED] Problem compiling kernel for an Arch install on USB pendrive

    I've installed Arch linux to a USB pendrive and I'm building a kernel for my specific hardware (Acer Aspire One) so as there is no kernel26.img file needed. 
    I've used gothicknight's custom kernel but it doesn't work for me as it doesn't recognise my USB stick (/dev/sdb).  Instead, it just recognises the SSD (/dev/sda).  I believe the standard Arch kernel uses a "hook" called "usb" in order to work from a USB stick - at least that's how I've got the current (default) Archlinux kernel working.
    I'm not that skilled at linux and am still quite new to kernel compilation (I've done it once or twice before and, yes, I've read the ArchWiki articles - both of them).  Can anyone tell me what I should do to get things working on a USB stick install?
    Kind regards
    Last edited by Shagbag (2008-09-30 20:27:49)

    Solved it.  I didn't need to recompile.  I just needed to add 'rootdelay=5' as a kernel boot parameter.

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

  • Using custom compiled kernel from Ubuntu

    I know I could always use my config file and recompile just for Arch, but I'm wondering what the downsides might be to using my bzImage file and doing a mkinitcpio to make the initrd file? They're both 64bit, all set up to use ext4 and ntfs. I am using kernel 3.2 sources with ubuntu's patches which add their debian/debian.master stuff, but I strip out everything I don't need for my system, set to core2 for cpu, turn off unneeded debugging options, and most importantly put in a DSDT.hex file I have from when I had to patch the DSDTAll of the drivers that my system uses are compiled in. I use Ubuntu 75% of the time, Arch 20% and Windows 7 5%. (I do use a seperate Arch in VirtualBox daily when in Ubuntu so please don't be mad at me for not being a full time Arch user yet!) . Figured I'd ask and see how friendly these forums are. I might just try later to see but I don't want to be in the middle of something important a week from now and then it's like oh f*ck.

    Actually that part I did know, because I rarely use bluetooth so those drivers are modules and not compiled in. I may just wind up recompiling whenever. I'm currently chrooted into arch still working on something else.
    EDIT: It works, but it makes my arch boot time worse and it freaked out at first 'cuz I sometimes use virtualbox to boot the install on the HD install itself with a raw vmdk pointing that partition which uses a virtualbox video driver instead of nvidia's binary . I'll just have to compile my own kernel on the arch side.
    Last edited by xyzzyman (2011-12-12 05:01:02)

  • 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.

  • Why gcc compile so slow on Arch?

    That's a big project, it takes about 30 mins compile by "make -j4" on Ubuntu.
    Compare to Ubuntu, Arch take more 20 mins compile time!
    The only different thing is Arch installed in SSD (project code too), Ubuntu in traditional disk.
    Due to the project can't compile with 64bit system, Arch and Ubuntu all is 32bit OS.
    The Arch already installed PAE kernel from AUR.
    Anyone can help? Thanks in advance and sorry for my bad English.

    karol wrote:Are you compiling using the same processor? Are you doing anything else at the same time apart from compiling on this computer?
    On Arch, are you compiling using 'make -j4' or are you using makepkg and a PKGBUILD?
    I'm quit sure using 'make -j4' both on Ubuntu and Arch, and of course the same computer.
    I'm not using makepkg because we don't support yet currently .
    I've tried several times to compare build time, not occasionally.
    The project's build system is CMake, I don't think cmake is the problem.

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

  • 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.

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

  • Compiling and Installing Compiled Kernel

    Hi everyone, today i followed the "Kernel Compilation From Source" (https://wiki.archlinux.org/index.php/Ke … rom_Source) ArchWiki to compile a kernel downloaded from kernel.org. And i use the second method to compile and install with makepkg.
    When the compilation is done, it can't be installed because the name of the file.
    I know i must specify a new name for the new linux image and the System.map to have two or more kernels installed. But "where" in the PKGBUILD i must change the name of the files???
    I'm using the PKGBUILD from the wiki:
    pkgname=kernel26-my
    basekernel=2.6.32.8
    pkgver=2.6.32.8
    pkgrel=1
    pkgdesc="The Linux Kernel and modules"
    arch=('i686' 'x86_64')
    license=('GPL')
    url="http://www.kernel.org"
    depends=('module-init-tools' 'mkinitcpio')
    provides=(kernel26)
    install=kernel26.install
    build() {
    LOCAL_VERSION="$(grep "CONFIG_LOCALVERSION=" $startdir/.config | sed 's/.*"\(.*\)"/\1/')"
    cd ..
    make || return 1
    mkdir -p $startdir/pkg/{lib/modules,boot}
    make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
    # There's no separation of firmware depending on kernel version -
    # comment this line if you intend on using the built kernel exclusively,
    # otherwise there'll be file conflicts with the existing kernel
    rm -rf $startdir/pkg/lib/firmware
    install -Dm644 "System.map" "$startdir/pkg/boot/System.map26$LOCAL_VERSION"
    install -Dm644 "arch/x86/boot/bzImage" "$startdir/pkg/boot/vmlinuz26$LOCAL_VERSION"
    # Change the version strings in kernel26.install
    sed -i \
    -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=\"$basekernel\"/" \
    -e "s/LOCAL_VERSION=.*/LOCAL_VERSION=\"$LOCAL_VERSION\"/" \
    $startdir/kernel26.install
    And also the kernel26.install
    KERNEL_VERSION="2.6.32.8"
    LOCAL_VERSION="-MINE"
    post_install () {
    echo ">>> Updating module dependencies..."
    /sbin/depmod -A -v ${KERNEL_VERSION}${LOCAL_VERSION}
    echo ">>> Creating initial ramdisk..."
    mkinitcpio -k "${KERNEL_VERSION}${LOCAL_VERSION}" -g "/boot/kernel26${LOCAL_VERSION}.img"
    post_upgrade() {
    echo ">>> Updating module dependencies..."
    /sbin/depmod -A -v ${KERNEL_VERSION}${LOCAL_VERSION}
    echo ">>> Creating initial ramdisk..."
    mkinitcpio -k "${KERNEL_VERSION}${LOCAL_VERSION}" -g "/boot/kernel26${LOCAL_VERSION}.img"
    Thanks in advance.
    Last edited by Hyugga (2010-11-11 02:48:14)

    When installing the kernel there is some problem when the "mkinitcpio" is running: sd_mod error.
    I can install and boot the kernel afterwards but when i get to kdm, the keyboard and the touchpad/mouse doesn't work.
    I double checked the .config file and i have enabled the keyboard and the mouse options.
    What can i do?
    Thanks...

  • 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

  • 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.

  • Recompile a compiled kernel with ABS

    I had been compiling my own kernel with the traditional method for ages. Sometimes ago, I decided to try the ABS method, modifying properly a PKGBUILD for the kernels provided by arch. I now appreciate the provided automation and the ease in combining arch patches with the patches I need or like.
    After a deep personalization of the PKGBUILD, there is now only a feature of the old method I continue to miss. It is when I decide to change something in the configuration of a kernel I have already compiled, and I want to recompile it. If I do so with the traditional method, the previous compilation is somewaht "cached"  and only what is actually different is compiled again: thus, the recompilation time is apparently shorter than the time needed by the first compilation.
    I am not able to do the same with the ABS method. It seems that the directory with the kernel source into src/ is rewritten every time (i.e., the kernel package is untarred also when is already there). Moreover, I also need to delete completely src/ or part of his content, otherwise makepkg complains about patches already being there. Is there a way to avoid this behaviour, so to shorten the recompilation time?

    Yes, ccache drastically reduces recompilation times (for my kernel, from 30 min to 5 min). However, when you change just a couple of peripheric things in config, 5 minutes are too much. Anyway, thanks a lot.

  • Newbie to Compiling - Kernel Source folder

    Hi everyone, I'm fairly new to Arch Linux and I'm absolutely loving it, it feels like the perfect distro to me.
    I have a quick question which I feel is easy to answer yet no matter how I search, I can never see a definitive answer - so basically I compiled my own custom kernel today in Arch which I'm running on right now.
    Everything is running great, though the only real reason I did it was for the learning experience. My question is, I compiled the kernel in my home directory, and what is left over now is the source folder itself which is around 600mb and I'm running a little short on space at the moment and I'm wondering, can I safely just delete this folder? Or, even after installing the kernel is it still somehow depending on this folder?
    I thought maybe like some program compiles I have done previously I could get rid of the source/build directory after completion but I'm sure I saw the Catalyst build module utilizing my kernel folder during it's build, so I'm not so sure now lol.
    Thanks in advance, I know I'm probably missing something completely. I'm happy to learn in any case.
    Last edited by ElderSnake (2010-12-09 11:46:08)

    Hi, I think you're absolutely right, in fact I was planning too but I guess in the end as I am actually using this system I thought I'd try do it this way for the pacman integration, but certainly sometime I should do it the manual way (though it doesn't seem much harder).
    Also on a side note, I installed v86d for the framebuffer support with Splashy, but when I update my mkinitcpio for my new kernel it says 'v86d' module not found during the rebuild process, but if I do it for my original kernel there is no issue. I guess I assumed any new modules I installed would automatically point to my current running kernel (the new one). But doesn't seem so.
    Any ideas?
    Last edited by ElderSnake (2010-12-09 22:22:36)

  • 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.

Maybe you are looking for