Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > 6b593dc1d73ad5d495e47eabd5dfbc07 > files > 2

kernel-userspace-headers-5.1.18-1.mga7.src.rpm

#!/bin/bash
# grab version info from kernel makefile
KVER=$(grep ^VERSION Makefile |cut -c 11-)
KPAT=$(grep ^PATCHLEVEL Makefile |cut -c 14-)
KSUB=$(grep ^SUBLEVEL Makefile |cut -c 12-)
# path to headers
KDIR=../kernel-userspace-headers-$KVER.$KPAT.$KSUB
# prep
rm -f include/uapi/linux/Kbuild
# export headers
make INSTALL_HDR_PATH=$KDIR headers_install_all
find $KDIR -name ..install.cmd -exec rm -f {} \;
find $KDIR -name .install -exec rm -f {} \;
cp --parents include/linux/pci_ids.h $KDIR
# package headers
tar -cJvf kernel-userspace-headers-$KVER.$KPAT.$KSUB.tar.xz $KDIR