You are not logged in.

#1 2007-12-03 12:09:21

wavenator
Member
Registered: 2007-12-03
Posts: 62

compile a kernel for arch

hi
i want to compile a kernel for my system
i am not new to linux but i've never compiled a kernel and only in this way you learn

i took from the aur the zen git kernel rc3

i started to compile it
and got to the configuration section

shall i leave it like it is
or change somethings there?

what another things i got to do after it got compiled

Offline

#2 2007-12-03 12:29:26

IsSuE
Member
Registered: 2006-04-29
Posts: 309

Re: compile a kernel for arch

The config included in the package is a good start. You dont really need to change anything. But you can tune the kernel if you want to. Or if you got any special requirements in your kernel feel free to change your .config. If that is not the fact, just compile the kernel smile
After compilation a package will be made which you can install by typing pacman -A packagename.
Then just edit your /boot/grub/menu.lst that it contains vmlinuz26zen and kernel26zen.img as initrd. you are done, reboot and enjoy your compiled kernel smile

Offline

#3 2007-12-03 12:36:22

wavenator
Member
Registered: 2007-12-03
Posts: 62

Re: compile a kernel for arch

thx a lot bro
u lmade me feel great
really thx ill write a topic with the new kernel after it finishs

Offline

#4 2007-12-03 13:19:51

wavenator
Member
Registered: 2007-12-03
Posts: 62

Re: compile a kernel for arch

ok the kernel works great
load up very very fast

but a problem occured with the nvidia driver
it sayd something about the modules and unload something

what do i suppose to do?

Offline

#5 2007-12-03 14:01:36

kakTuZ
Member
From: Hannover, Germany
Registered: 2007-10-20
Posts: 86

Re: compile a kernel for arch

wavenator wrote:

it sayd something about the modules and unload something

what do i suppose to do?

please post, what it says (e.g. from running 'dmesg')

Offline

#6 2007-12-03 14:16:51

wavenator
Member
Registered: 2007-12-03
Posts: 62

Re: compile a kernel for arch

Error: Module nvidia does not exist in /prov/modules

and it says to unload it

Offline

#7 2007-12-03 15:38:01

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: compile a kernel for arch

Run "abs", then:  "cp -r /var/abs/extra/x11/nvidia /var/abs/local/", then edit /var/abs/local/nvidia/PKGBUILD to set _kernver to your kernel, then "makepkg -fi".

nvidia-utils is also needed.

Edit: The script I use is:

cd /var/abs/local/nvidia
rm -rf pkg src

# Old:  V=$(cat /usr/src/linux/include/config/kernel.release) || exit 1
V=$(cd /usr/src/linux && make kernelversion) || exit 1
sed -i -e "/^_kernver=/s/.*/_kernver=${V}/" PKGBUILD || exit 1
echo "Compiling"
makepkg -fic --asroot || exit 1

Edit:  Updated $V so it works with beta kernels.

Last edited by brebs (2008-04-24 00:39:51)

Offline

#8 2007-12-03 15:59:25

wavenator
Member
Registered: 2007-12-03
Posts: 62

Re: compile a kernel for arch

hehe
i did what u sayd at the beginning
and it works
damn man thanks a lot
i prefer to do it manually and not to edit the script
thx a lot man

Offline

#9 2008-02-21 15:02:23

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: compile a kernel for arch

Here's my "compilekernel" script, which includes the recompilation of the nvidia kernel module.

#!/bin/bash

# "x86_64"
ARCH=$(uname -m)

# Posted at http://bbs.archlinux.org/viewtopic.php?id=40585

cd /usr/src/linux || exit 1
[[ -e .config ]] || cp /boot/config .config

make oldconfig || exit 1

# Clear out old modules
# In kernel 2.6.24:  V=$(cat /usr/src/linux/include/config/kernel.release)
V=$(cd /usr/src/linux && make kernelversion) || exit 1
[[ -z "${V}" ]] && exit 1
rm -rf /lib/modules/linux-${V} || exit 1

# Parallel make seems safe
make clean || exit 1
make -j8 bzImage modules || exit 1
make modules_install || exit 1

# For stupid setups that mount boot
[[ -d /boot/grub ]] || mount /boot

# Uses my setup, rather than "make install"
[[ -e /boot/kernel ]] && cp -p /boot/kernel /boot/kernel-prev
cp arch/${ARCH}/boot/bzImage /boot/kernel || exit 1
[[ -e /boot/System.map ]] && cp -p /boot/System.map /boot/System.map-prev
cp System.map /boot/System.map || exit 1
[[ -e /boot/config ]] && cp -p /boot/config /boot/config-prev
cp .config /boot/config || exit 1

# Compile external kernel modules
echo "Nvidia"
cd /var/abs/local/nvidia || exit 1
rm -rf pkg src
sed -i -e "/^_kernver=/s/.*/_kernver=${V}/" PKGBUILD || exit 1
makepkg -fic --asroot || exit 1

Edit: Updated assignation of $V for kernel 2.6.25

Last edited by brebs (2008-04-21 11:48:14)

Offline

#10 2008-08-16 02:22:21

symbol
Member
Registered: 2008-08-15
Posts: 3

Re: compile a kernel for arch

hey all, i wish to compile my own kernel for arch. the current kernel loads many things and modules i don't need. i am ver used to compiling kernels on gentoo. i wish to know is it necessary to use the inittrd thing?
regards

Offline

#11 2008-08-16 02:28:26

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: compile a kernel for arch

symbol wrote:

hey all, i wish to compile my own kernel for arch. the current kernel loads many things and modules i don't need. i am ver used to compiling kernels on gentoo. i wish to know is it necessary to use the inittrd thing?
regards

It's not necessary if you compile everything you system needs in order to boot directly into the kernel.

Last edited by fwojciec (2008-08-16 02:29:51)

Offline

Board footer

Powered by FluxBB