You are not logged in.
I'm using the Kernel Compilation With ABS script and most of the stuff works perfectly after I figured out how to configure everything, but Im still having a few problems with it. I'm compiling an x86_64 kernel and towards the end of the script I get these errors:
cp: cannot stat `arch/x86_64/Makefile': No such file or directory
cp: cannot stat `arch/x86_64/kernel/asm-offsets.s': No such file or directory
they exist in arch/x86 but not in arch/x86_64, should they be there or is it safe to ignore them?
The same thing happens if I reboot into my 32 bit install and change arch to i686. If I change it to x86 I get this error:
==> ERROR: kernel is not available for the 'i686' architecture. Note that many packages may need a line added to their PKGBUILD such as arch=('i686').
Last edited by brando56894 (2009-06-01 07:00:14)
Offline
I managed to fix it (or atleast I think I did, it doesnt give those errors anymore) by linking /arch/i686 to /arch/x86. Heres the updated code, my changes are in bold right after all the echos in the build function. Should I update the wiki?
#############################################
# Linux Kernel and Modules PKGBUILD prototype
#
# This PKGBUILD provides a structure to build, install, and remove
# versions of kernels from different trees and with different options
# enabled in the config file._desc="Linux Kernel and Modules"
_pkg_base="kernel"
_patchset=""
_cfgname=""
_kerver=2.6.29.4
_extraver=""
pkgrel=1
arch=('i686')
url="http://www.kernel.org"
license=('GPL')
depends=('module-init-tools')
makedepends=('bzip2' 'gcc')#
# The generated package will have the following properties:
# name: $_pkg_base-$_patchset-$_cfgname
# version: $_kerver_$_extraver-#pkgrel
# pkg: kernel-$_patchset-$_cfgname-$_kerver_$_extraver-$pkgrel.pkg.tar.gz
# vmlinuz-$_kerver-$_extraver-$_patchset-$_cfgname
# System.map-$_kerver-$_extraver-$_patchset-$_cfgname
# kconfig-$_kerver-$_extraver-$_patchset-$_cfgname
# /lib/modules/$_kerver-$_extraver-$_patchset-$_cfgname
# /usr/src/linux-$_kerver-$_extraver-$_patchset-$_cfgname
# /usr/src/linux -> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# /usr/src/linux/config.stock = a stock arch kernel config file
# A copy of the .config use to build the kernel will be copied to
# the abs build directory.
##############################################
#DO NOT CHANGE INSIDE THIS BLOCK
pkgver=$_kerverif [ ! -z "$_extraver" ]; then
_scratch="_$_extraver"
pkgver=$pkgver$_scratch
_extraver=`echo "-$_extraver" | sed 's|_|-|'`
fipkgdesc="$_desc - ver: $_kerver$_extraver;"
pkgname=$_pkg_baseif [ ! -z "$_patchset" ]; then
pkgdesc="$pkgdesc pset: $_patchset;"
_patchset="-$_patchset"
pkgname="$pkgname$_patchset"
fiif [ ! -z "$_cfgname" ]; then
pkgdesc="$pkgdesc cfg: $_cfgname;"
_cfgname="-$_cfgname"
pkgname="$pkgname$_cfgname"
fipkgdesc="$pkgdesc bld: $pkgrel"
_idstr="$_kerver$_extraver$_patchset$_cfgname"
################################################### Add patchfiles to the source array. Make sure the config file matches
###### the configuration for the kernel you intend to package. Make sure the
###### config.stock matches the .config from the current Arch stock kernel.
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kerver.tar.bz2
config
config.stock
)###### Add md5 checksums here:
md5sums=()getvar() {
old=$(cat Makefile | grep "^$1")
echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*\(.*\)[ ]*/\1/g")
return 0
}build() {
echo "_pkg_base: $_pkg_base"
echo "_patchset: $_patchset"
echo "_cfgname: $_cfgname"
echo "_kerver: $_kerver"
echo "_extraver: $_extraver"
echo "pkgrel: $pkgrel"
echo "_desc: $_desc"
echo "url: $url"
echo "license: $license"
echo "pkgver: $pkgver"
echo "pkgdesc: $pkgdesc"
echo "_idstr: $_idstr"
#read KEYcd ${srcdir}/linux-$_kerver
ln -s ${srcdir}/linux-$_kerver/arch/x86 ${srcdir}/linux-$_kerver/arch/i686
###### apply patches here
# patch -p1 < ../patch1 || return 1#get rid of i in i686 in default config
carch=`echo $CARCH | sed 's|i||'`
cat ../config | sed "s|#CARCH#|$carch|g" >./.config###### Choose one of the following configuration types
#make oldconfig || return 1
#make menuconfig || return 1
make xconfig || return 1 #### (BROKEN?)
#make gconfig || return 1#############################################
# NO CHANGES BELOW THIS POINT# Save the configuration file to a backup in the build directory
cp ./.config ../../config$_cfgname.bak# set EXTRAVERSION to help use unique /lib/modules/ subdirectories
_ker_make_ver=$(getvar "VERSION").$(getvar "PATCHLEVEL").$(getvar "SUBLEVEL")
_ker_extraver=`echo $_idstr | sed "s|^$_ker_make_ver||"`# update EXTRAVERSION in the Makefile by adding our (for modules location)
_oldline=$(cat Makefile | grep "^EXTRAVERSION")
cat Makefile | sed "s|$_oldline|EXTRAVERSION\ =\ $_ker_extraver$_patchset$_cfgname|" > tmpMake
mv tmpMake Makefilemake clean bzImage modules || return 1
mkdir -p ${pkgdir}/{lib/modules,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1# create unique names in /boot/
cp System.map ${pkgdir}/boot/System.map-$_idstr
cp arch/$arch/boot/bzImage ${pkgdir}/boot/vmlinuz-$_idstrinstall -D -m644 Makefile ${pkgdir}/usr/src/linux-$_idstr/Makefile
install -D -m644 .config ${pkgdir}/usr/src/linux-$_idstr/.config
install -D -m644 ../config.stock ${pkgdir}/usr/src/linux-$_idstr/config.stock
install -D -m644 .config ${pkgdir}/boot/kconfig-$_idstr
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/include
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/arch/$arch/kernel
for i in acpi asm-generic asm-x86 config linux math-emu net pcmcia scsi video; do
cp -a include/$i ${pkgdir}/usr/src/linux-$_idstr/include/
done# copy files necessary for later builds, like nvidia and vmware
cp -a scripts ${pkgdir}/usr/src/linux-$_idstr/
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/.tmp_versions
cp arch/$arch/Makefile ${pkgdir}/usr/src/linux-$_idstr/arch/$arch/# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-$_idstr/$i
done
cd ${pkgdir}/usr/src/linux-$_idstr/include && ln -s asm-x86 asm
chown -R root.root ${pkgdir}/usr/src/linux-$_idstrcd ${pkgdir}/lib/modules/$_idstr && \
(rm -f build; ln -sf /usr/src/linux-$_idstr build)ln -sf /usr/src/linux-$_idstr ${pkgdir}/usr/src/linux
cp ${srcdir}/config.stock ${pkgdir}/usr/src/linux-$_idstr/config.stock
}
Last edited by brando56894 (2009-06-01 08:43:13)
Offline
You know you can simply change in the official PKGBUILD:
pkgname=kernel26
to something like
pkgname=kernel26-mykernel
to build a custom kernel installable side-by-side with the official kernel?
Offline
nope i didnt know that, thanks. im still getting the hang of the aur/abs even though ive been using arch for about a year. i was messing around with this pkgbuild earlier on my 32bit test distro and couldnt figure out how to do a side by side install and not an on top one.
Offline
...and couldnt figure out how to do a side by side install and not an on top one.
It's as simple as renaming the pkgname to "kernel26-custom". If you want to add a patch, make sure you add it just after the -ARCH patch process. Also, if you want to change the configuration, you'll probably need to do it in 2 steps: run makepkg, wait for the compilation to start, then stop it with ctrl+c, go in src/linux.../ and run "make menuconfig". Don't forget after that to copy the (hidden) file ".config" back to the main dir, next to the PKGBUILD, and overwrite the file "config" with it.
Offline
if its a parallel install, it shouldnt be replacing files right?
[bubba@ra ~/abs.kernel]$ sudo pacman -U kernel-custom-test1-2.6.29.4-1-x86_64.pk
g.tar.gz
loading package data...
checking dependencies...
(1/1) checking for file conflicts [#####################] 100%
error: failed to prepare transaction (conflicting files)
kernel-custom-test1: /lib/firmware/acenic/tg1.bin exists in filesystem
kernel-custom-test1: /lib/firmware/acenic/tg2.bin exists in filesystem
kernel-custom-test1: /lib/firmware/adaptec/starfire_rx.bin exists in filesystem
kernel-custom-test1: /lib/firmware/adaptec/starfire_tx.bin exists in filesystem
kernel-custom-test1: /lib/firmware/cpia2/stv0672_vp4.bin exists in filesystem
kernel-custom-test1: /lib/firmware/dabusb/bitstream.bin exists in filesystem
kernel-custom-test1: /lib/firmware/dabusb/firmware.fw exists in filesystem
kernel-custom-test1: /lib/firmware/edgeport/boot.fw exists in filesystem
kernel-custom-test1: /lib/firmware/edgeport/boot2.fw exists in filesystem
kernel-custom-test1: /lib/firmware/edgeport/down.fw exists in filesystem
kernel-custom-test1: /lib/firmware/edgeport/down2.fw exists in filesystem
kernel-custom-test1: /lib/firmware/edgeport/down3.bin exists in filesystem
kernel-custom-test1: /lib/firmware/emi26/bitstream.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi26/firmware.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi26/loader.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi62/bitstream.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi62/loader.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi62/midi.fw exists in filesystem
kernel-custom-test1: /lib/firmware/emi62/spdif.fw exists in filesystem
kernel-custom-test1: /lib/firmware/ess/maestro3_assp_kernel.fw exists in filesys
tem
kernel-custom-test1: /lib/firmware/ess/maestro3_assp_minisrc.fw exists in filesy
stem
kernel-custom-test1: /lib/firmware/kaweth/new_code.bin exists in filesystem
kernel-custom-test1: /lib/firmware/kaweth/new_code_fix.bin exists in filesystem
kernel-custom-test1: /lib/firmware/kaweth/trigger_code.bin exists in filesystem
kernel-custom-test1: /lib/firmware/kaweth/trigger_code_fix.bin exists in filesys
tem
kernel-custom-test1: /lib/firmware/keyspan_pda/keyspan_pda.fw exists in filesyst em
kernel-custom-test1: /lib/firmware/keyspan_pda/xircom_pgs.fw exists in filesyste m
kernel-custom-test1: /lib/firmware/korg/k1212.dsp exists in filesystem
kernel-custom-test1: /lib/firmware/mts_cdma.fw exists in filesystem
kernel-custom-test1: /lib/firmware/mts_edge.fw exists in filesystem
kernel-custom-test1: /lib/firmware/mts_gsm.fw exists in filesystem
kernel-custom-test1: /lib/firmware/ti_3410.fw exists in filesystem
kernel-custom-test1: /lib/firmware/ti_5052.fw exists in filesystem
kernel-custom-test1: /lib/firmware/tigon/tg3.bin exists in filesystem
kernel-custom-test1: /lib/firmware/tigon/tg3_tso.bin exists in filesystem
kernel-custom-test1: /lib/firmware/tigon/tg3_tso5.bin exists in filesystem
kernel-custom-test1: /lib/firmware/vicam/firmware.fw exists in filesystem
kernel-custom-test1: /lib/firmware/whiteheat.fw exists in filesystem
kernel-custom-test1: /lib/firmware/whiteheat_loader.fw exists in filesystem
kernel-custom-test1: /lib/firmware/yamaha/ds1_ctrl.fw exists in filesystem
kernel-custom-test1: /lib/firmware/yamaha/ds1_dsp.fw exists in filesystem
kernel-custom-test1: /lib/firmware/yamaha/ds1e_ctrl.fw exists in filesystem
errors occurred, no packages were upgraded.
Offline
No it should not:
pacman -Qo /lib/firmware/acenic/tg1.bin
/lib/firmware/acenic/tg1.bin is owned by kernel26-firmware 2.6.29-1
Look at the last line of the kernel26's PKGBUILD. You should see:
# remove the firmware
rm -rf ${pkgdir}/lib/firmware
Do you still have that in yours?
Offline
no i dont heres the code of mine
#############################################
# Linux Kernel and Modules PKGBUILD prototype
#
# This PKGBUILD provides a structure to build, install, and remove
# versions of kernels from different trees and with different options
# enabled in the config file.
_desc="Linux Kernel and Modules"
_pkg_base="kernel"
_patchset=""
_cfgname=""
_kerver=2.6.29.4
_extraver=""
pkgrel=1
arch=('x86_64')
url="http://www.kernel.org"
license=('GPL')
depends=('module-init-tools')
makedepends=('bzip2' 'gcc')
#
# The generated package will have the following properties:
# name: $_pkg_base-$_patchset-$_cfgname
# version: $_kerver_$_extraver-#pkgrel
# pkg: kernel-$_patchset-$_cfgname-$_kerver_$_extraver-$pkgrel.pkg.tar.gz
# vmlinuz-$_kerver-$_extraver-$_patchset-$_cfgname
# System.map-$_kerver-$_extraver-$_patchset-$_cfgname
# kconfig-$_kerver-$_extraver-$_patchset-$_cfgname
# /lib/modules/$_kerver-$_extraver-$_patchset-$_cfgname
# /usr/src/linux-$_kerver-$_extraver-$_patchset-$_cfgname
# /usr/src/linux -> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# /usr/src/linux/config.stock = a stock arch kernel config file
# A copy of the .config use to build the kernel will be copied to
# the abs build directory.
#
#############################################
#DO NOT CHANGE INSIDE THIS BLOCK
pkgver=$_kerver
if [ ! -z "$_extraver" ]; then
_scratch="_$_extraver"
pkgver=$pkgver$_scratch
_extraver=`echo "-$_extraver" | sed 's|_|-|'`
fi
pkgdesc="$_desc - ver: $_kerver$_extraver;"
pkgname=$_pkg_base-custom
if [ ! -z "$_patchset" ]; then
pkgdesc="$pkgdesc pset: $_patchset;"
_patchset="-$_patchset"
pkgname="$pkgname$_patchset"
fi
if [ ! -z "$_cfgname" ]; then
pkgdesc="$pkgdesc cfg: $_cfgname;"
_cfgname="-$_cfgname"
pkgname="$pkgname$_cfgname"
fi
pkgdesc="$pkgdesc bld: $pkgrel"
_idstr="$_kerver$_extraver$_patchset$_cfgname"
#############################################
###### Add patchfiles to the source array. Make sure the config file matches
###### the configuration for the kernel you intend to package. Make sure the
###### config.stock matches the .config from the current Arch stock kernel.
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kerver.tar.bz2
config
config.stock
)
###### Add md5 checksums here:
md5sums=()
getvar() {
old=$(cat Makefile | grep "^$1")
echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*\(.*\)[ ]*/\1/g")
return 0
}
build() {
echo "_pkg_base: $_pkg_base"
echo "_patchset: $_patchset"
echo "_cfgname: $_cfgname"
echo "_kerver: $_kerver"
echo "_extraver: $_extraver"
echo "pkgrel: $pkgrel"
echo "_desc: $_desc"
echo "url: $url"
echo "license: $license"
echo "pkgver: $pkgver"
echo "pkgdesc: $pkgdesc"
echo "_idstr: $_idstr"
#read KEY
cd ${srcdir}/linux-$_kerver
###### apply patches here
# patch -p1 < ../patch1 || return 1
#get rid of i in i686 in default config
carch=`echo $CARCH | sed 's|i||'`
cat ../config | sed "s|#CARCH#|$carch|g" >./.config
###### Choose one of the following configuration types
#make oldconfig || return 1
#make menuconfig || return 1
make xconfig || return 1 #### (BROKEN?)
#make gconfig || return 1
#############################################
# NO CHANGES BELOW THIS POINT
# Save the configuration file to a backup in the build directory
cp ./.config ../../config$_cfgname.bak
# set EXTRAVERSION to help use unique /lib/modules/ subdirectories
_ker_make_ver=$(getvar "VERSION").$(getvar "PATCHLEVEL").$(getvar "SUBLEVEL")
_ker_extraver=`echo $_idstr | sed "s|^$_ker_make_ver||"`
# update EXTRAVERSION in the Makefile by adding our (for modules location)
_oldline=$(cat Makefile | grep "^EXTRAVERSION")
cat Makefile | sed "s|$_oldline|EXTRAVERSION\ =\ $_ker_extraver$_patchset$_cfgname|" > tmpMake
mv tmpMake Makefile
make clean bzImage modules || return 1
mkdir -p ${pkgdir}/{lib/modules,boot}
make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1
# create unique names in /boot/
cp System.map ${pkgdir}/boot/System.map-$_idstr
cp arch/$arch/boot/bzImage ${pkgdir}/boot/vmlinuz-$_idstr
install -D -m644 Makefile ${pkgdir}/usr/src/linux-$_idstr/Makefile
install -D -m644 .config ${pkgdir}/usr/src/linux-$_idstr/.config
install -D -m644 ../config.stock ${pkgdir}/usr/src/linux-$_idstr/config.stock
install -D -m644 .config ${pkgdir}/boot/kconfig-$_idstr
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/include
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/arch/$arch/kernel
for i in acpi asm-generic asm-x86 config linux math-emu net pcmcia scsi video; do
cp -a include/$i ${pkgdir}/usr/src/linux-$_idstr/include/
done
# copy files necessary for later builds, like nvidia and vmware
cp -a scripts ${pkgdir}/usr/src/linux-$_idstr/
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/.tmp_versions
cp arch/$arch/Makefile ${pkgdir}/usr/src/linux-$_idstr/arch/$arch/
cp arch/$arch/kernel/asm-offsets.s ${pkgdir}/usr/src/linux-$_idstr/arch/$arch/kernel/
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p ${pkgdir}/usr/src/linux-$_idstr/`echo $i | sed 's|/Kconfig.*||'`
cp $i ${pkgdir}/usr/src/linux-$_idstr/$i
done
cd ${pkgdir}/usr/src/linux-$_idstr/include && ln -s asm-x86 asm
chown -R root.root ${pkgdir}/usr/src/linux-$_idstr
cd ${pkgdir}/lib/modules/$_idstr && \
(rm -f build; ln -sf /usr/src/linux-$_idstr build)
ln -sf /usr/src/linux-$_idstr ${pkgdir}/usr/src/linux
cp ${srcdir}/config.stock ${pkgdir}/usr/src/linux-$_idstr/config.stock
}
Last edited by brando56894 (2009-06-06 23:42:03)
Offline
Then just copy PKGBUILD file form abs tree there are fine PKGBUILD with rm -rf /lib/firmware.
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
rm -rf /lib/firmware will delete all the files for my current kernel (which i still want) wont it?
Offline
rm -rf /lib/firmware will delete all the files for my current kernel (which i still want) wont it?
No, it deletes the /lib/firmware folder in the kernel package that you're building, the one that you're about to upload.
Last edited by methuselah (2009-06-07 00:32:31)
Offline
oh ok, thanks.
Im trying to merge the nvidia PKGBUILD with this PKGBUILD so it installs the nvidia modules automatically when it gets done installing the kernel but I cant really seem to figure it out. this is as far as Ive gotten (this goes at the end of the kernel PKGBUILD):
nvidia.pkgver=185.18.14
arch=('i686' 'x86_64')
[ "$CARCH" = "i686" ] && ARCH=x86
[ "$CARCH" = "x86_64" ] && ARCH=x86_64
url="http://www.nvidia.com/"
depends=('kernel26>=2.6.29' 'kernel26<2.6.30' 'nvidia-utils=185.18.14')
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install
source=("http://us.download.nvidia.com/XFree86/Linux-$ARCH/${nvidia.pkgver}/NVIDIA-Linux-$ARCH-${nvidia.pkgver}-pkg2.run")
#md5sums=('871fb27da348c71e4a97a158af80f9dd')
[ "$CARCH" = "x86_64" ] #&& md5sums=('28882531c762f5a8690b658e7e3e410f')
build() {
cd $srcdir
sh NVIDIA-Linux-$ARCH-${nvidia.pkgver}-pkg2.run --extract-only
cd NVIDIA-Linux-$ARCH-${nvidia.pkgver}-pkg2
cd usr/src/nv/
ln -s Makefile.kbuild Makefile
make SYSSRC=/lib/modules/${_kerver}/build module || return 1
mkdir -p $pkgdir/lib/modules/${_kerver}/kernel/drivers/video/
install -m644 nvidia.ko $pkgdir/lib/modules/${_kerver}/kernel/drivers/video/
sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kerver}'/" $startdir/nvidia.install
}
I have no idea if it actually works since I just copied and pasted what I though was needed from the official PKGBUILD and changed a few variable names to either use ones already defined (_kernver to _kerver) or so they wouldnt conflict with ones that were already defined (pkgver and nvidia.pkgver). I see that install is defined as the value "nvidia.install" but I have no idea where to place the functions that are defined in the nvidia.install file.
contents of nvidia.install using vars defined in the kernel PKGBUILD
post_install() {
depmod ${_kerver}
}
post_upgrade() {
post_install
rmmod nvidia || echo 'In order to use the new nvidia module, exit Xserver and unload it manually.'
}
post_remove() {
depmod ${_kerver}
}
Last edited by brando56894 (2009-06-07 07:00:51)
Offline