You are not logged in.
Hi all!
I have saw many PKGBUILDs for custom kernels. There is some on the wiki, some on the forum, others on AUR, etc. Diversity is great, as the possible choices, but it gets a bit confusing because each of these PKGBUILDs are different. It's a bit like to many forks of a project...
I sometimes want a customized kernel, but since I'm not a kernel dev/maintainer, I still want to keep the -ARCH kernel. If I break something in my own customization, I still want to be able to boot. I think others will want the same thing.
What I propose is a modification the stock PKGBUILD so a change in the pkgname variable will result in a custom kernels, installable side-by-side with Arhc's stock one.
The advantages of this approach:
1) Nothing changes for devs
2) Simplification of custom kernel building
3) Easier testing of patches
4) Easier testing of new kernels
There is not much modification for the PKGBUILD. It mainly adds the possibility to give a special name to the package like this : pkgname=kernel26-mypatchset. Then, through the LOCAVERSION in the config file, folders and files will have the "-mypatchset" suffix. For example :
/boot/vmlinuz26-mypatchset
/etc/mkinitcpio.d/kernel26-mypatchset.preset
/lib/modules/2.6.27-mypatchset/
/usr/src/linux-2.6.27-mypatchset/
etc.
To build Arch's stock kernel, just keep "pkgname=kernel26" and it will build as before.
This is something I am using right now. Would other people be interested? Could it be included included in the distribution?
I hope it will help others.
big_gie
EDITs:
2009-02-04:
-Bump version to 2.6.28.2-1 (from core)
2009-01-21:
-Added corrections from the bug report (http://bugs.archlinux.org/task/12384)
-Bump version to 2.6.28.1 (from core)
2008-12-07:
-Cleaned the patch, some comments
2008-12-01:
-Corrected problem where initrd files were overwritten
-Updated to 2.6.27.7
kernel26-2.6.28.1-1-personnal.patch REMOVED. Please check bug report at http://bugs.archlinux.org/task/12384 for the latest patch. This should prevent bad copy/paste from the forum...
Last edited by big_gie (2009-02-05 04:22:58)
Offline
Seems like a good idea, I'm not that advanced so what I saw looks like a nice idea. I do have another solution that I use if you want a kernel installed side by side in your grub list that will allow your Stock -ARCH kernel to not be ruined and still allow updates.
What I do is I have my custom PKGBUILD that I made from modifying an ABS kernel26 PKGBUILD. I give the kernel a different pkgname such as kernel26zen3.
I also change the "_patchname=-ARCH" to the name of my patchset like zen2 or zen3 so it looks like this: "_patchset=-zen3". Then I add this line to the line above "make menuconfig": "_kernver="${_basekernel}${_patchset}" so it writes "2.6.27-zen3" for the kernver.
I also include the kernel26.preset and kernel26.install and rename them to use my new pkgname so they are called: kernel26zen3.preset and kernel26zen3.install..... I also modify both of those files to use the appropriate names and versions as well as anything in the PKGBUILD.
This builds me a separate "kernel26zen3" that has a separate "vmlinuz26zen3", "System.map26zen3", "kernel26zen3.img", and "kerenl26zen3fallback.img" in the /boot directory, and a separate "2.6.27-zen3" directory in /lib/modules, and also a separate "linux-2.6.27-zen3" in /usr/src. It also adds a "kernel26zen3.kver" and "kernel26zen3.preset" to the /etc/mkinitcpio.d directory.
Then I add my kernel26zen3 kernel to my grub list, if I run into any problems with it, I can still boot into my stock -ARCH kernel or my Vista partition.
This is me using my zen3 kernel while I still have my other stock -ARCH kernel installed..... I just updated the stock kernel while logged into my kernel26zen3 that I use as my default kernel.....
[seventy3@HPdv9920us ~]$ uname -r
2.6.27-zen3
[seventy3@HPdv9920us ~]$ pacman -Q kernel26zen3
kernel26zen3 2.6.27-1
[seventy3@HPdv9920us ~]$ pacman -Q kernel26
kernel26 2.6.27.7-1
[seventy3@HPdv9920us ~]$
I also didn't mean to hijack your thread or anything.
Last edited by methuselah (2008-12-01 23:21:30)
Offline
Oh man, I was looking for something EXACTLY like this! Thanks for being so awesome big_gie. Big thumb-up from me on this. Maybe you should add it to the wiki?
[git] | [AURpkgs] | [arch-games]
Offline
Thanx you two for your feedback!
@methuselah: Both our methods are the basically the same. The main difference is that I propose that these modification be included in Arch stock kernel, so it will be really easy to grab the PKGBUILD, put a name, recompile and install. All this without overlapping. It would be way easier to hack on the kernel like this.
@Daenyth: I'm happy it is usefull to you! I wanted more support from users before pushing this to devs...
Offline
I'm in agreement with Daenyth on this. Even if it doesn't get included by default, it should be at least on the wiki. Good stuff.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
I'm all for anything to make building custom kernels easier (without stuffing the stock kernel)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I just compiled my first custom kernel with this. It works!
(unfortunately not a huge difference between the original and the new; I think I have to rip out more modules)
Offline
I just compiled my first custom kernel with this. It works!
(unfortunately not a huge difference between the original and the new; I think I have to rip out more modules)
Wow thats great news!
Any suggestion on the best way to push this to arch dev? I think I'll suggest it through the mailing list, and maybe later a bug report.
Anyone brave enought to test this? I already tested building -ARCH kernel (pkgname=kernel26), a version for my laptop and another one for my eeePC 901 (arch is soooo great on this! )
Basically I'd like to be sure the stock kernel compiled with this would be identical to the original one...
Thanx for your help !
Offline
Been looking for this! Going to try it right now to rip out some modules etc.
Offline
How well does this work when combined with for example, nvidia and madwifi? I'd love to see a whole set done in this style.
[git] | [AURpkgs] | [arch-games]
Offline
How well does this work when combined with for example, nvidia and madwifi? I'd love to see a whole set done in this style.
AFAIK you'd have to make custom PKGs of them aswell. Everything that includes kernel modules. (for example, I just rebuilt the kernel myself and had to rebuilt the vhba module to get cdemu to work).
Strangely enough, the patch above didn't apply well to the kernel26 package in ABS on my PC.
Offline
How well does this work when combined with for example, nvidia and madwifi? I'd love to see a whole set done in this style.
Good idea
The goal is that it does not change anything at all.
I'm not using nvidia, but I've been compiling a couple of kernel modules without any sort of problems. The only problematic part is installing the same module for different kernel. For example, if a module's PKGBUILD installs in /lib/modules/`uname -r`", one cannot install multiple version of the module: if you upgrade a package where files have moved from /lib/modules/2.6.27-ARCH to /lib/modules/2.6.27-mine, then the files in /lib/modules/2.6.27-ARCH will be deleted.
To correct this, one should add "-mine" in their module's pkgname.
But this "problem" is independent of the proposed patch. Everybody who install a custom kernel, with my patch or not, needs to recompile their modules.
Offline
Strangely enough, the patch above didn't apply well to the kernel26 package in ABS on my PC.
Ok thanx for reporting.
This is probably because 1) your abs tree has not been updated to the one I used to create the patch, or more plausible 2) the stock PKGBUILD has already been updated.
The third option is just that the patch is bad, my mistake
I'll verify that.
Offline
Now when you mention it, I had a problem with patching mine too. I went ahead with compiling anyway, since the error didn't appear to be a critical one.
kernel26.install.rej
***************
*** 105,111 ****
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?"
--- 106,112 ----
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?"
Offline
Ok I re-did the patch to be sure. I also made sure no white space confusions (there is some end of line white space in the core/PKGBUILD...)
I also added some simple comments.
The diff is against actual abs, or revision 19747 for i686 and 19749 for x86_64.
Offline
I opened a bug:
http://bugs.archlinux.org/task/12384
Their is also some discussion on the mailing list:
http://archlinux.org/pipermail/arch-gen … 02937.html
Offline
This is what I have been looking for
Offline
hehe, I had one of those moments of "Why didn't I think of this before?!"
For lack of better words: chair, never, toothbrush, really. Ohw, and fish!
Offline
Great idea.
By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin
Offline
Bumped version to 2.6.28.1 (from core)
Offline
Anybody tried it? Comments? Critics?
Offline
This sounds like a great idea, I'm currently a little too busy with school but when I have time I'll give it a go. The stuff about modules will still bug me though .... but hey ... still a linux newbie, I'll sort it out when I give this a go.
This will make everyone's life so much easier .... I blew an arch64 install because of a custom kernel this would have been handy
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
The stuff about modules will still bug me though ....
What do you mean? That the modules be installed in /lib/modules/2.6.28-custom ?
Offline
At least for me, patching PKGBUILD fails in the 3rd hunk using PKGBUILD from "Core": http://repos.archlinux.org/viewvc.cgi/k … iew=markup
PKGBUILD.rej:
http://arch.pastebin.com/m7a860f8a
***************
*** 39,53 ****
KARCH=x86
cd ${srcdir}/linux-$_basekernel
# Add -ARCH patches
# See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
patch -Np1 -i ${srcdir}/${_patchname} || return 1
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
# get kernel version
make prepare
_kernver="$(make kernelrelease)"
--- 45,68 ----
KARCH=x86
cd ${srcdir}/linux-$_basekernel
+ if [[ ! -e _arch_patched ]]; then
# Add -ARCH patches
# See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary
patch -Np1 -i ${srcdir}/${_patchname} || return 1
+ touch _arch_patched
+ else
+ msg "Already patched, skipping."
+ fi
+ msg "Patching done, continuating with compilation..."
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
cat ../config >./.config
fi
+ if [ "${_kernelname}" != "" ]; then
+ sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
+ fi
# get kernel version
make prepare
_kernver="$(make kernelrelease)"
I've not tried to compile yet, I just don't have the time today, sorry, I'll compile it tomorrow.
Offline
At least for me, patching PKGBUILD fails in the 3rd hunk using PKGBUILD from "Core": http://repos.archlinux.org/viewvc.cgi/k … iew=markup
I just sync my abs and tested the patch. It applies cleanly. I downloaded the pkgbuild from http://repos.archlinux.org/viewvc.cgi/k … sion=24709 and it still applied cleanly. The only difference between abs sync and websvn is "# $Id: PKGBUILD 24584 2009-01-18 19:58:10Z tpowa $" at the begining of the file.
It might just be due to a copy paste from the forum problem... I thus removed the code from the first thread and pointed to the bug report @ http://bugs.archlinux.org/task/12384 for the latest patch (scroll down to the bottom for latest...)
Offline