You are not logged in.
Hi guys! My problem is similar this one Please help a newbie compile a kernel
I tried to compile kernel 2.6.33.9 by simply copying the PKGBUILD and other files into my workspace. Everything goes well but I cant make a package:
PKGBUILD:
pkgdesc="The Linux Kernel and modules with tuxonice support and rt-patchset"
depends=('coreutils' 'linux-firmware' 'module-init-tools>=3.16' 'mkinitcpio>=0,7')
optdepends=('crda: to set the correct wireless channels of your country')
pkgname=linux-rt-ice
backup=(etc/mkinitcpio.d/$pkgname.preset)
_kernelname=${pkgname#linux}
_basekernel=2.6.33
pkgver=${_basekernel}.9
#pkgver=${_basekernel}
pkgrel=1
arch=('i686' 'x86_64')
url="https://rt.wiki.kernel.org"
license=('GPL2')
install=$pkgname.install
provides=('kernel26-rt-ice')
conflicts=('kernel26-rt-ice')
replaces=('kernel26-rt-ice')
makedepends=('xmlto' 'docbook-xsl')
options=('!strip')
### User/Environment defined variables
enable_toi=${enable_toi:-0}
BFQ_IO_SCHEDULER="y"
bfs_scheduler=${bfs_scheduler:-0}
keep_source_code=${keep_source_code:-1}
gconfig=${gconfig:-0}
xconfig=${xconfig:-0}
menuconfig=${menuconfig:-1}
realtime_patch=${realtime_patch:-1}
local_patch_dir="${local_patch_dir:-}"
use_config="${use_config:-}"
use_config_gz=${use_config_gz:-0}
enable_reiser4=${enable_reiser4:-1}
### Compile time defined variables
###
### Files / Versions
#!file_rt="patch-3.0.14-rt31.patch.gz"
#!file_reiser4="reiser4-for-2.6.31.patch.bz2"
#file_toi="current-tuxonice-for-3.0.patch.bz2"
#file_bfs="2.6.38.3-sched-bfs-401.patch"
file_rt="patch-2.6.33.9-rt31.gz"
file_reiser4="reiser4-for-2.6.33.patch.gz"
file_bfs="2.6.33.7-sched-bfs-357.patch"
_bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/2.6.33/"
###
source=("ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${_basekernel}.tar.bz2"
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.33/patch-2.6.33.9.gz"
http://www.kernel.org/pub/linux/kernel/projects/rt/2.6.33/patch-2.6.33.9-rt31.gz
# https://tglx.de/~tglx/rt/3.0/${file_rt}
http://sourceforge.net/projects/reiser4/files/reiser4-for-linux-2.6/reiser4-for-2.6.33.patch.gz
#http://www.tuxonice.net/files/${file_toi}
http://ck.kolivas.org/patches/bfs/${_basekernel}/${file_bfs}
# the main kernel config files
'config' 'config.x86_64'
# standard config files for mkinitcpio ramdisk
"${pkgname}.preset"
'change-default-console-loglevel.patch'
'i915-fix-ghost-tv-output.patch'
#BFQ patch:
"${_bfqpath}/0001-bfq_iosched-block-prepare_IO_context_code-v1-r1.patch"
"${_bfqpath}/0002-bfq_iosched-block-add_cgroups_kconfig_and_build_bits-v1-r1.patch"
"${_bfqpath}/0003-bfq_iosched-block-introduce_BFQ-v1-r1.patch")
md5sums=('c3883760b18d50e8d78819c54d579b00'
'6594052b26f8e79c374c278f62d3329b'
'772776957913e76492e3547b304b75c2'
'96f986418d1ab9b9abdcbfb2c20fdc0d'
'3b8ef39f43a1dab60ddc703049cb8ac2'
'540318683b69e49ab5fa629cfb32dc48'
'74d172143d448a002834879d99c3992c'
'7c9725208ab6834602c8b9d645ed001d'
'9d3c56a4b999c8bfbd4018089a62f662'
'263725f20c0b9eb9c353040792d644e5'
'69adc7f64f4dc5b34ad1cb3825b7c0f4'
'4146ee711eed553c024a93c766463583'
'678c791c7df57a71cdb480fdc49aec8d')
build() {
cd "${srcdir}/linux-${_basekernel}"
# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"
if [ -n "${local_patch_dir}" ] && [ -d "${local_patch_dir}" ] ; then
echo "Applying patches from ${local_patch_dir} ..."
for my_patch in "${local_patch_dir}"/* ; do
echo -e "Applying custom patch:\t'${my_patch}'" || true
patch -Np1 -i "${my_patch}" || { echo -e "Failed custom patch:\t'${my_patch}'" ; return 1 ; }
done
fi
# Applying realtime patch
if [ "$realtime_patch" = "1" ]; then
echo "Applying real time patch"
# Strip './Makefile' changes
gzip -dc ${srcdir}/${file_rt} \
| sed '/diff --git a\/Makefile b\/Makefile/,/*DOCUMENTATION*/d' \
| patch -Np1 || { echo "Failed Realtime patch '${file_rt}'"; return 1 ; }
fi
# applying reiserfs4 patch
if [ "$enable_reiser4" = "1" ]; then
echo "Applying ${file_reiser4%.gz}"
gzip -dc ${srcdir}/${file_reiser4} | patch -Np1 || { echo "Failed reiser4 patch '${file_reiser4%.gz}'"; return 1 ; }
fi
# applying tuxonice patch
if [ "${enable_toi}" = "1" ]; then
echo "Applying ${file_toi%.bz2}"
# fix to tuxonice patch to work with rt
#if [ "$realtime_patch" = "1" ]; then
#bzip2 -dck ${srcdir}/${file_toi} \
#| sed '/diff --git a\/kernel\/fork.c b\/kernel\/fork.c/,/{/d' \
#| sed 's/printk(KERN_INFO "PM: Creating hibernation image:\\n/printk(KERN_INFO "PM: Creating hibernation image: \\n/' \
#| patch -Np1 || { echo "Failed TOI w/rt" ; return 1 ; }
#else
bzip2 -dck ${srcdir}/${file_toi} \
| sed 's/printk(KERN_INFO "PM: Creating hibernation image:\\n/printk(KERN_INFO "PM: Creating hibernation image: \\n/' \
| patch -Np1 -F4 || { echo "Failed TOI"; return 1 ; }
#fi
fi
if [ "${bfs_scheduler}" = "1" ] && [ "${realtime_patch}" = "0" ]; then
# applying BFS scheduler patch
echo "BFS scheduler patch not available yet, sorry"
# echo "Applying BFS scheduler patch"
# patch -Np1 -i ${srcdir}/${file_bfs} || { echo "Failed BFS"; return 1 ; }
fi
# --> BFQ
if [ $BFQ_IO_SCHEDULER = "y" ] ; then
msg "Patching source with BFQ patches"
for i in $(ls ${srcdir}/000*.patch); do
patch -Np1 -i $i
done
fi
# Some chips detect a ghost TV output
# mailing list discussion: http://lists.freedesktop.org/archives/intel-gfx/2011-April/010371.html
# Arch Linux bug report: FS#19234
#
# It is unclear why this patch wasn't merged upstream, it was accepted,
# then dropped because the reasoning was unclear. However, it is clearly
# needed.
#patch -Np1 -i "${srcdir}/i915-fix-ghost-tv-output.patch"
# set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
# remove this when a Kconfig knob is made available by upstream
# (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
# use custom config instead
if [ -n "${use_config}" ] ; then
echo "Using config: '${use_config}'"
cat "${use_config}" > ./.config
make oldconfig
fi
# use existing config.gz
if [ "$use_config_gz" = "1" ]; then
zcat /proc/config.gz > ./.config
make oldconfig
fi
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
fi
# set extraversion to pkgrel
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
# hack to prevent output kernel from being marked as dirty or git
#chmod +x ${srcdir}/linux-${_basekernel}/scripts/setlocalversion
#sed 's/head=`git rev-parse --verify --short HEAD 2>\/dev\/null`/0/' \
# ${srcdir}/linux-${_basekernel}/scripts/setlocalversion \
# > ${srcdir}/linux-${_basekernel}/scripts/setlocalversion.new
#mv ${srcdir}/linux-${_basekernel}/scripts/setlocalversion.new \
# ${srcdir}/linux-${_basekernel}/scripts/setlocalversion
# get kernel version
make prepare
# load configuration
# Configure the kernel. Replace the line below with one of your choice.
if [ "$gconfig" = "1" ]; then
make gconfig
else
if [ "$xconfig" = "1" ]; then
make xconfig
else
if [ "$menuconfig" = "1" ]; then
make menuconfig
fi
fi
fi
yes "" | make config
make prepare # Necessary in case config has been changed
# build!
make ${MAKEFLAGS} bzImage modules
}
package_linux-rt-ice() {
KARCH=x86
cd ${srcdir}/linux-${_basekernel}
if [ "$keep_source_code" = "1" ]; then
echo -n "Copying source code..."
# Keep the source code
cd $startdir
mkdir -p $pkgdir/usr/src || return 1
cp -a ${srcdir}/linux-${_basekernel} $pkgdir/usr/src/linux-${_kernver} || return 1
#Add a link from the modules directory
mkdir -p $pkgdir/lib/modules/${_kernver} || return 1
cd $pkgdir/lib/modules/${_kernver} || return 1
rm -f source
ln -s ../../../usr/src/linux-${_kernver} source || return 1
echo "OK"
fi
# get kernel version
_kernver="$(make kernelrelease)"
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
make INSTALL_MOD_PATH="${pkgdir}" modules_install
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
# add vmlinux
install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux"
# install fallback mkinitcpio.conf file and preset file for kernel
install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
# set correct depmod command for install
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/g" \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i "${startdir}/${pkgname}.install"
sed \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
echo -e "# DO NOT EDIT THIS FILE\nALL_kver='${_kernver}'" > ${pkgdir}/etc/mkinitcpio.d/${pkgname}.kver
# 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:--rt-ice}" "${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:--rt-ice}"
echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--rt-ice}/version"
mkdir -p "${pkgdir}/lib/modules/${_kernver}"
cd "${pkgdir}/lib/modules/${_kernver}"
ln -sf ../../../usr/src/linux-${_kernver} build
cd "${srcdir}/linux-${_basekernel}"
install -D -m644 Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Makefile"
install -D -m644 kernel/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/kernel/Makefile"
install -D -m644 .config \
"${pkgdir}/usr/src/linux-${_kernver}/.config"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include"
for i in acpi asm-generic config crypto drm generated linux math-emu \
media net pcmcia scsi sound trace video xen; do
cp -a include/${i} "${pkgdir}/usr/src/linux-${_kernver}/include/"
done
# copy arch includes for external modules
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86"
cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/"
# copy files necessary for later builds, like nvidia and vmware
cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}"
cp -a scripts "${pkgdir}/usr/src/linux-${_kernver}"
# fix permissions on scripts dir
chmod og-w -R "${pkgdir}/usr/src/linux-${_kernver}/scripts"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/.tmp_versions"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel"
cp arch/${KARCH}/Makefile "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
if [ "${CARCH}" = "i686" ]; then
cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/"
fi
cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/src/linux-${_kernver}/arch/${KARCH}/kernel/"
# add headers for lirc package
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video"
cp drivers/media/video/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/"
for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102; do
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
cp -a drivers/media/video/${i}/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/${i}"
done
# add docbook makefile
install -D -m644 Documentation/DocBook/Makefile \
"${pkgdir}/usr/src/linux-${_kernver}/Documentation/DocBook/Makefile"
# add dm headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
cp drivers/md/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/md"
# add inotify.h
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/linux"
cp include/linux/inotify.h "${pkgdir}/usr/src/linux-${_kernver}/include/linux/"
# add wireless headers
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
cp net/mac80211/*.h "${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/"
# add dvb headers for external modules
# in reference to:
# http://bugs.archlinux.org/task/9912
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core"
cp drivers/media/dvb/dvb-core/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/"
# and...
# http://bugs.archlinux.org/task/11194
#mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
#cp include/config/dvb/*.h "${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/"
# add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
# in reference to:
# http://bugs.archlinux.org/task/13146
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/dvb/frontends/lgdt330x.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
cp drivers/media/video/msp3400-driver.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
# add dvb headers
# in reference to:
# http://bugs.archlinux.org/task/20402
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb"
cp drivers/media/dvb/dvb-usb/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-usb/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends"
cp drivers/media/dvb/frontends/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners"
cp drivers/media/common/tuners/*.h "${pkgdir}/usr/src/linux-${_kernver}/drivers/media/common/tuners/"
# add xfs and shmem for aufs building
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs"
mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/mm"
cp fs/xfs/xfs_sb.h "${pkgdir}/usr/src/linux-${_kernver}/fs/xfs/xfs_sb.h"
# copy in Kconfig files
for i in `find . -name "Kconfig*"`; do
mkdir -p "${pkgdir}"/usr/src/linux-${_kernver}/`echo ${i} | sed 's|/Kconfig.*||'`
cp ${i} "${pkgdir}/usr/src/linux-${_kernver}/${i}"
done
chown -R root.root "${pkgdir}/usr/src/linux-${_kernver}"
find "${pkgdir}/usr/src/linux-${_kernver}" -type d -exec chmod 755 {} \;
# strip scripts directory
find "${pkgdir}/usr/src/linux-${_kernver}/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "${binary}")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip ${STRIP_SHARED} "${binary}";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip ${STRIP_STATIC} "${binary}";;
*application/x-executable*) # Binaries
/usr/bin/strip ${STRIP_BINARIES} "${binary}";;
esac
done
# remove unneeded architectures
if [ "$keep_source_code" = "0" ]; then
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
fi
}
[ku@ku-la linux-rt-ice]$ makepkg -R
==> Making package: linux-rt-ice 2.6.33.9-1 (Sat Jan 21 13:33:09 NOVT 2012)
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
==> Starting package_linux-rt-ice()...
Copying source code...OK
make: *** No rule to make target `kernelrelease'. Stop.
==> ERROR: A failure occurred in package_linux-rt-ice().
Aborting...
I remounted it with defaults options as stressed above topic and try again makepkg -R but still no joy
I looked at kernel.release
2.6.33-1-rt-ice
Any ideas?
Last edited by noMaster (2012-01-21 15:35:54)
Offline
I suggested to build package again. And finally I got it. I guess the problem was in mounting options so was needed to began from the very start
Offline