CWD=$(pwd) TMP=${TMP:-/tmp/sources} OUT=${OUT:-/tmp/packages} KVERSION=${KVERSION:-2.6.34.7} ARCH=${ARCH:-x86} BUILD=${BUILD:-1} PKG=${TMP}/package-kernel-headers rm -rf $PKG mkdir -p $PKG $OUT set -e echo "Building kernel-firmware-$KVERSION..." mkdir -p ${PKG}/lib/firmware ( cd /usr/src/linux-${KVERSION} make firmware_install INSTALL_FW_PATH=${PKG}/lib/firmware ) cp -a --verbose \ /usr/src/linux-${KVERSION}/firmware/WHENCE ${PKG}/lib/firmware mkdir -p ${PKG}/description cp ${CWD}/descriptions/firmware/* ${PKG}/description/ cd $PKG makepkg -l ${OUT}/kernel-firmware-$KVERSION-$ARCH-$BUILD.tlz # Delete temporary directories: if [[ $1 = -c || $1 = --clean ]]; then rm -rf $PKG fi