| #!/bin/sh |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| set -e |
| |
| |
| |
| |
| tmpdir="${objtree}/tar-install" |
| tarball="${objtree}/linux-${KERNELRELEASE}-${ARCH}.tar" |
| |
| |
| |
| |
| |
| case "${1}" in |
| <------>dir-pkg|tar-pkg) |
| <------><------>opts= |
| <------><------>;; |
| <------>targz-pkg) |
| <------><------>opts="-I ${KGZIP}" |
| <------><------>tarball=${tarball}.gz |
| <------><------>;; |
| <------>tarbz2-pkg) |
| <------><------>opts="-I ${KBZIP2}" |
| <------><------>tarball=${tarball}.bz2 |
| <------><------>;; |
| <------>tarxz-pkg) |
| <------><------>opts="-I ${XZ}" |
| <------><------>tarball=${tarball}.xz |
| <------><------>;; |
| <------>*) |
| <------><------>echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2 |
| <------><------>exit 1 |
| <------><------>;; |
| esac |
| |
| |
| |
| |
| |
| rm -rf -- "${tmpdir}" |
| mkdir -p -- "${tmpdir}/boot" |
| dirs=boot |
| |
| |
| |
| |
| |
| if grep -q '^CONFIG_OF_EARLY_FLATTREE=y' include/config/auto.conf; then |
| <------> |
| <------>if [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then |
| <------><------>$MAKE ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install |
| fi |
| fi |
| |
| |
| |
| |
| |
| if grep -q '^CONFIG_MODULES=y' include/config/auto.conf; then |
| <------>make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_MOD_PATH="${tmpdir}" modules_install |
| <------>dirs="$dirs lib" |
| fi |
| |
| |
| |
| |
| |
| cp -v -- "${objtree}/System.map" "${tmpdir}/boot/System.map-${KERNELRELEASE}" |
| cp -v -- "${KCONFIG_CONFIG}" "${tmpdir}/boot/config-${KERNELRELEASE}" |
| cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| |
| |
| |
| |
| |
| case "${ARCH}" in |
| <------>x86|i386|x86_64) |
| <------><------>[ -f "${objtree}/arch/x86/boot/bzImage" ] && cp -v -- "${objtree}/arch/x86/boot/bzImage" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------>;; |
| <------>alpha) |
| <------><------>[ -f "${objtree}/arch/alpha/boot/vmlinux.gz" ] && cp -v -- "${objtree}/arch/alpha/boot/vmlinux.gz" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------>;; |
| <------>parisc*) |
| <------><------>[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>[ -f "${objtree}/lifimage" ] && cp -v -- "${objtree}/lifimage" "${tmpdir}/boot/lifimage-${KERNELRELEASE}" |
| <------><------>;; |
| <------>mips) |
| <------><------>if [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.bin" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.bin" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.ecoff" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.ecoff" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.srec" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.srec" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/vmlinux.32" ]; then |
| <------><------><------>cp -v -- "${objtree}/vmlinux.32" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/vmlinux.64" ]; then |
| <------><------><------>cp -v -- "${objtree}/vmlinux.64" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/arch/mips/boot/vmlinux.bin" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/vmlinux.bin" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/arch/mips/boot/vmlinux.ecoff" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/vmlinux.ecoff" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/arch/mips/boot/vmlinux.srec" ]; then |
| <------><------><------>cp -v -- "${objtree}/arch/mips/boot/vmlinux.srec" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>elif [ -f "${objtree}/vmlinux" ]; then |
| <------><------><------>cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}" |
| <------><------>fi |
| <------><------>;; |
| <------>arm64) |
| <------><------>for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do |
| <------><------><------>if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then |
| <------><------><------><------>cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" |
| <------><------><------><------>break |
| <------><------><------>fi |
| <------><------>done |
| <------><------>;; |
| <------>*) |
| <------><------>[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}" |
| <------><------>echo "" >&2 |
| <------><------>echo '** ** ** WARNING ** ** **' >&2 |
| <------><------>echo "" >&2 |
| <------><------>echo "Your architecture did not define any architecture-dependent files" >&2 |
| <------><------>echo "to be placed into the tarball. Please add those to ${0} ..." >&2 |
| <------><------>echo "" >&2 |
| <------><------>sleep 5 |
| <------><------>;; |
| esac |
| |
| if [ "${1}" = dir-pkg ]; then |
| <------>echo "Kernel tree successfully created in $tmpdir" |
| <------>exit 0 |
| fi |
| |
| |
| |
| |
| if tar --owner=root --group=root --help >/dev/null 2>&1; then |
| <------>opts="$opts --owner=root --group=root" |
| fi |
| |
| tar cf $tarball -C $tmpdir $opts $dirs |
| |
| echo "Tarball successfully created in $tarball" |
| |
| exit 0 |
| |