You are not logged in.
I tried several times building a custom 2.6.8.1 kernel with makepkg and the PKGBUILD file obtained from http://wiki.archlinux.org/index.php/Ker … with%20ABS. Unfortionately, the process allways ends with the following error:
ln: when making multiple links, last argument must be a directory
make: *** [_modinst_] Error 1
==> ERROR: Build Failed. Aborting...
Is there something wrong with the build file posted on the wiki or am I doing something stupid?
Offline
If you updated abs, you could just copy your custom config to /var/abs/kernels/kernel26 then run makepkg there - the pkgbuild in that directory should already be updated to latest version, rather than editing the one from wiki.
Offline
Okay, building with the modded official PKGBUILD file worked.... but for some reason there is a mismatch between the kernel version and the directory the kernel installs its modules into.
uname -r produces: 2.6.8- .1
while the modules are placed in: /lib/modules/2.6.8.1
As you can imagine, this tends to be problematic on boot, as the new kernel can't update its module dependencies, or load any modules.
Offline
I tried several times building a custom 2.6.8.1 kernel with makepkg and the PKGBUILD file obtained from http://wiki.archlinux.org/index.php/Ker … with%20ABS.
[...]
Is there something wrong with the build file posted on the wiki or am I doing something stupid?
Yes, there is something wrong with the build posted on the wiki - I had a similar problem.
I'm currently working on an improved version.
If you want to build a plain kernel (no addons such as mm,ck, etc) use kernel26 PKGBUILD from abs.
:: / my web presence
Offline
I'll look into it. I've got so many kernels installed on this computer it isn't funny...
AFAIK, the build worked with 2.6.7. I haven't gotten around to updating yet.
Dusty
Offline
hiho.
i had the very same problems. it's the EXTRAVERSION-string, set by the
PKGBUILD, 'cause 2.6.8.1 already sets one.
--- edit ---
iceram's fix does the trick ... so this line is no longer necessary.
--- edit ---
mak.
$ wget -c -r -l inf -i what_the_hel.l
Offline
Err... I might have done a small mistake in my previous post.
I didn't try to build the kernel using the Wiki page above.
I've used http://wiki.archlinux.org/index.php/Bui … with%20ABS
You can find below the revised PKGBUILD for that page. It might look weird, but it's very functional. It should also work with the stock kernels.
This PKGBUILD includes kernel version/revision autodetection. This helps when you apply patches which change those variables (such as ck, mm etc.). The changes I've made automatically change the package details (pkgname, pkgver, pkgdesc) to reflect the kernel changes.
Please test because I've made some cosmetic changes lately which might have scrambled something around there. If you find it working, please post here and I'll put it in the Wiki page above. Maybe it could also be used as a base for building kernels with the ABS.
Any feedback is welcomed. Enjoy.
# ChangeLog
#
# v0.3 2004/08/19 - Mircea Ionut Bardac (IceRAM)
# Updated the PKGBUILD for autodetection of the kernel version and kernel revision
#
# v0.2 2004/07/23 - Wojciech Szlachta
# Modified from official PKGBUILD for kernel26-scsi by judd <jvinet@zeroflux.org>
# and from custom PKGBUILD to support multiple installed kernels by jea.
# you can leave kerrev empty if you don't want to name the kernel in any way
kerrev=
pkgname=kernel26
pkgver=2.6.7
pkgrel=1
pkgdesc="Custom Linux Kernel and modules"
url="http://www.kernel.org"
depends=('module-init-tools')
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2
config
)
md5sums=('a74671ea68b0e3c609e8785ed8497c14'
'4da09ca74deafb3c6769b8de895e089b'
)
getvar() {
old=$(cat Makefile | grep "^$1")
echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*(.*)[ ]*/1/g")
return 0
}
build() {
cd $startdir/src/linux-$pkgver
# apply patches here
# patch -p1 < ../patch1
# get rid of the 'i' in i686
carch=`echo $CARCH | sed 's|i||'`
cat ../config | sed "s|#CARCH#|$carch|g" >./.config
# make changes in kernel configuration
make oldconfig || return 1
cp ./.config ../../config.new
#use the following line instead of the 2 lines above for default config
#yes "" | make config || return 1
# set EXTRAVERSION to create unique /lib/modules/ subdirectories
_ker_extraversion=$(getvar "EXTRAVERSION")
# update EXTRAVERSION in the Makefile
_oldline=$(cat Makefile | grep "^EXTRAVERSION")
if [ $kerrev != "" ]; then
_ker_extraversion="$_ker_extraversion-$kerrev"
cat Makefile | sed "s|$_oldline|EXTRAVERSION = $_ker_extraversion|" > tmpMake
mv tmpMake Makefile
fi
kerrev=$_ker_extraversion
kerver=$(getvar "VERSION").$(getvar "PATCHLEVEL").$(getvar "SUBLEVEL")
# update the package information from the kernel Makefile
pkgver=$kerver$(echo $_ker_extraversion | sed -e 's/-/./g')
# removing patches versions from the revision string
_n1=$(expr match $kerrev '([.][0-9]*)')
_n21=$(expr match $q '[.][0-9]*(.*)')
_n2=$(echo $_n21 | sed -e "s/[0-9]*-/-/g")
pkgname=kernel26$_n1$_n2
pkgdesc="Custom Linux Kernel ($kerver) and modules - revision $kerrev / package version: $pkgver build: $pkgrel"
echo "- Package information ----------------"
echo " Package name: $pkgname"
echo " Package version: $pkgver"
echo " Package release: $pkgrel"
echo " Kernel version: $kerver"
echo " Kernel revision: $kerrev"
echo "--------------------------------------"
make clean bzImage modules || return 1
mkdir -p $startdir/pkg/{lib/modules,boot}
make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
# create unique names in /boot/
cp System.map $startdir/pkg/boot/System.map26$kerrev
cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26$kerrev
install -D -m644 Makefile $startdir/pkg/usr/src/linux-$kerver/Makefile
install -D -m644 .config $startdir/pkg/usr/src/linux-$kerver/.config
install -D -m644 .config $startdir/pkg/boot/kconfig26$kerrev
mkdir -p $startdir/pkg/usr/src/linux-$kerver/include
mkdir -p $startdir/pkg/usr/src/linux-$kerver/arch/i386/kernel
for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
cp -a include/$i $startdir/pkg/usr/src/linux-$kerver/include/
done
# copy files necessary for later builds, like nvidia and vmware
cp -a scripts $startdir/pkg/usr/src/linux-$kerver/
mkdir -p $startdir/pkg/usr/src/linux-$kerver/.tmp_versions
cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$kerver/arch/i386/
cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$kerver/arch/i386/kernel/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p $startdir/pkg/usr/src/linux-$kerver/`echo $i | sed 's|/Kconfig.*||'`
cp $i $startdir/pkg/usr/src/linux-$kerver/$i
done
cd $startdir/pkg/usr/src/linux-$kerver/include && ln -s asm-i386 asm
chown -R root.root $startdir/pkg/usr/src/linux-$kerver
# create a unique subdirectory under /usr/src/
cd $startdir/pkg/usr/src
mv linux-$kerver linux-$kerver$kerrev
cd $startdir/pkg/lib/modules/$kerver$kerrev &&
(rm -f build; ln -sf /usr/src/linux-$kerver$kerrev build)
}
:: / my web presence
Offline
I've updated the above PKGBUILD to allow any kind of EXTRAVERSION string, including ".1" (as it is in 2.6.8.1). It is still untested.
Please provide feedback. Thanks.
:: / my web presence
Offline
Works like a charm. Thanks for researching this, I really wasn't up to it.
I updated the wiki:
http://wiki.archlinux.org/index.php/Ker … with%20ABS
My PKGBUILD is a somewhat simplified version of yours, but the differences are mainly cosmetic.
Hopefully it works unedited for a few revisions, eh?
Dusty
Offline
Works like a charm. Thanks for researching this, I really wasn't up to it.
What is the Arch community for?
I updated the wiki:
http://wiki.archlinux.org/index.php/Ker … with%20ABS
The page below might as well be removed, because it says the same thing but it doesn't work in every case: http://wiki.archlinux.org/index.php/Bui … with%20ABS (I used it as a base for the PKGBUILD above)
Hopefully it works unedited for a few revisions, eh?
What versions (&extra versions have you tested)?
dp could try to build his mm kernel with it, I might try others.
Also, I think I'll make some small changes to the text in the Wiki page, because I don't think I've put enough comments in the PKGBUILD.
Oh, I've seen you have removed some lines out of it.
Let me explain a little... (the following piece of code is updated to refflect your changes in the PKGBUILD)
# removing patches versions from the revision string
_n1=$(expr match $_kerrev '([.][0-9]*)')
_n21=$(expr match $_kerrev '[.][0-9]*(.*)')
_n2=$(echo $_n21 | sed -e "s/[0-9]*-/-/g")
pkgname=kernel26$_n1$_n2
Let's assume kerrev=".1-mm1-ck6-win4lin" (this is only an example) & kerver = "2.6.8"
_n1 - contains the .1 from the kernel extra version
_n21 - contains "-mm1-ck6-win4lin" (there was a small mistake in it)
_n2 - contains only the name of the patches applied, without their versions ("-mm-ck-win4lin").
Now that I think of it, _n1 could be dropped (it has no use here).
Why this?
The line bellow (which you already included) will make the correct pkgver.
pkgver=$kerver$(echo $_ker_extraversion | sed -e 's/-/./g')
[you can change the above line with pkgver=$kerver$(echo $_kerrev | sed -e 's/-/./g') - will be easier to understand]
In our case, pkgver = 2.6.8.1.mm1.ck6.win4lin (all the dashes are replaced with dots).
Well, let's assume there is also mm2... kerrev will be ".1-mm2-ck6-win4lin". Why I've chosen to remove the patches version? Because the pkgname of the package in our last case (mm2) will be the same as in the previous case (only pkgver different) and pacman will see it as an upgrade.
The resulting package will be named
in our 1st case: kernel26-mm-ck-win4lin-2.6.8.1.mm1.ck6.win4lin-1.pkg.tar.gz
in our 2nd case: kernel26-mm-ck-win4lin-2.6.8.1.mm2.ck6.win4lin-1.pkg.tar.gz
The correct code that will change the pkgname correctly follows:
# removing patches versions from the revision string
_t=$(expr match $_kerrev '[.][0-9]*(.*)')
pkgname=kernel26$(echo $_t | sed -e "s/[0-9]*-/-/g")
If you have any questions, please ask.
IceRAM
:: / my web presence
Offline
I'll remove the multiple kernels howto later.
I don't have time to delve into the code you're suggesting right now, but feel free to make any changes in the wiki PKGBUILD. You do good work.
Dusty
Offline
Wow!
That's one intense PKGBUILD...
John E. A.
Offline
I updated http://wiki.archlinux.org/index.php/Ker … with%20ABS to reflect my previous post.
:: / my web presence
Offline
with regard to this step:
A screen will come up telling you to select kernel options. It will be qt, gtk, or ncurses based, depending on which config option you chose. (You could also edit the PKGBUILD to use a default config file of your choice)
but as it is supposed to be a guide it is weird it doesn't tell you HOW or WHERE to edit the PKGBUILD. could the PKGBUILD please be updated so that if you have a config already included in your source array you can just uncomment a line to allow you to use it - in the same way the other config methods are available?
e.g.
###### Choose one of the following configuration types
#make oldconfig || return 1
#make menuconfig
#make xconfig
make gconfig
to
###### Choose one of the following configuration types
###### Use first option for config in source array
#yes "" | make config
#make oldconfig || return 1
#make menuconfig
#make xconfig
make gconfig
not sure if that is actually correct - is a complete guess based on Judd's PKGBUILD
Offline
Offline
yay! i contibuted something useful!
Offline
does this only work with 2.6 kernels or should it wokr with any kernel?
cos i have found references to thinsg like this:
install -D -m644 .config $startdir/pkg/boot/kconfig26$_suf
i have altered them in my PKGBUILD to 24 but it exits with errors re:no rule to make gconfig - i assume this is not available for 24 kernels so maybe the this PKGBUILD could be updated to be more generic for both kernel branches?
Offline
Well, I haven't tested it with 2.4 but.. it might work.
That error you're getting reffers to the fact that "gconfig" is not working with the 2.4 Makefile (not implemented). Try one of the other config methods "oldconfig", "menuconfig" etc.
An update for the PKGBUILD to be more generic... hmm.. haven't thought of that. I haven't actually used 2.4 at all. Did you only change 26 to 24 and it simply worked (besides that "make gconfig" error)? If there are no differences between the files structure in 2.4 it might work only renaming 24 to 26.
Anyhow, I'll change that to "make menuconfig" because I *think* it should work in 2.4 also.
:: / my web presence
Offline
make menuconfig does work - but the build method is different i think (compare the stock 2.6 and 2.4 configs)
however - if one of the var can be set at the start e.g kerbranch=24 or 26
then all the refs to 26 could be changed to $kerbranch and you could add an if statement that uses one build method for kerbranch=24 and one for kerbranch=26
would that work? i would do it myself but i am unsure about adding the customization vars to the 24 stock PKGBUILD steps.
would be fantastic if this PKGBUILD worked for both main branches
of course i'll be happy to test it!
Offline
I was thinking of adding such a variable (kerbranch) also, but I'm more concerned about the building process. I'll have a look over the 2.4 PKGBUILD and see what resembles. Adding some ifs wouldn't hurt, but I think it might get the PKGBUILD a little bit bloated.
:: / my web presence
Offline
in that case would an alternative PKGBUILD for 24 kernels be possible?
i think, after you look at the 24 PKGBUILD, you will be able to set this up very quickly - which makes me very happy!
Offline
Or an alternative...
I'll have a look later this day.
IceRAM
:: / my web presence
Offline
that's fantastic RAM - thanks very much
Offline
i had a go at perverting the custom build to wrok with both 24 and 26 but is pointless - the deps, source and build method are all different - it just needs a separate custom PKGBUILD.
the version i ended up with didn't result in the expected file names tho. the 26 build results in nice clear nameing with "-" 's - mine (with a kerbranch) just resulted in files called vmlinuz24bspl rather than vmlinuz-26-bspl etc
i think it needs an expert eye
Offline
I had a look over them and I got to the same conclusion.
Unfortunately, I wasn't able to create anything functional since I had to prepare a one-week holiday abroad. I'll be out for a couple of days. The core commands for building a package are quite few, both in 2.6 and in 2.4. Converting might not be very difficult.
The thing you got there might have been the right one. If EXTRAVERSION returns "bspl" with no "-" before, it will be added as is. The 2.6 PKGBUILD does not add by itself dashes. It worked this way for a while until Linus introduced 2.6.8 + EXTRAVERSION=".1" which totally messed it. After a fix, I have made it dash-independant
If you ignore the naming problem, does the kernel work?
:: / my web presence
Offline