kernel: switch to /usr.

This commit is contained in:
Juan RP 2012-07-09 20:06:40 +02:00
parent ed6fe78492
commit 3f9271ec45
2 changed files with 21 additions and 12 deletions

View File

@ -8,7 +8,7 @@ long_desc="
external 3rd party binary modules."
do_install() {
vmove usr
vmove lib/modules/${_kernver}/build lib/modules/${_kernver}
vmove usr/src usr
vmove usr/lib/modules/${_kernver}/build usr/lib/modules/${_kernver}
}

View File

@ -3,7 +3,7 @@
pkgname=kernel
_kmajorver=3.4
version=${_kmajorver}.4
revision=5
revision=6
nostrip=yes
noverifyrdeps=yes
preserve=yes
@ -25,13 +25,13 @@ _kernver="${version}_${revision}"
# These files could be modified when an external module is built.
mutable_files="
/lib/modules/${_kernver}/modules.dep
/lib/modules/${_kernver}/modules.dep.bin
/lib/modules/${_kernver}/modules.symbols
/lib/modules/${_kernver}/modules.symbols.bin
/lib/modules/${_kernver}/modules.alias
/lib/modules/${_kernver}/modules.alias.bin
/lib/modules/${_kernver}/modules.devname"
/usr/lib/modules/${_kernver}/modules.dep
/usr/lib/modules/${_kernver}/modules.dep.bin
/usr/lib/modules/${_kernver}/modules.symbols
/usr/lib/modules/${_kernver}/modules.symbols.bin
/usr/lib/modules/${_kernver}/modules.alias
/usr/lib/modules/${_kernver}/modules.alias.bin
/usr/lib/modules/${_kernver}/modules.devname"
do_configure() {
# If there's a file called <arch>-dotconfig, use it to
@ -71,6 +71,9 @@ do_install() {
arch=x86_64
fi
# Run depmod after compressing modules.
sed -i '2iexit 0' scripts/depmod.sh
# Install kernel, firmware and modules
make INSTALL_MOD_PATH=${DESTDIR} modules_install
@ -81,9 +84,14 @@ do_install() {
${DESTDIR}/boot/vmlinuz-${_kernver}
install -Dm644 System.map \
${DESTDIR}/boot/System.map-${_kernver}
cd ${DESTDIR}/lib/modules/${_kernver} && \
# Switch to /usr.
vmkdir usr
vmove lib usr
cd ${DESTDIR}/usr/lib/modules/${_kernver} && \
rm -f source build && \
ln -sf ../../../usr/src/kernel-headers-${_kernver} build
ln -sf ../../../src/kernel-headers-${_kernver} build
cd ${wrksrc}
# Install required headers to build external modules
@ -205,6 +213,7 @@ do_install() {
# Compress all modules with xz to save a few MBs.
msg_normal "$pkgver: compressing kernel modules with xz, please wait...\n"
find ${DESTDIR} -name '*.ko' -exec xz -9 {} \;
# ... and run depmod again.
depmod -b ${DESTDIR} ${_kernver}
}