#!/bin/sh
#
# builddeb 1.3
# Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
#
# Simple script to generate a deb package for a Linux kernel. All the
# complexity of what to do with a kernel after it is installed or removed
# is left to other scripts and packages: they can install scripts in the
# /etc/kernel/{pre,post}{inst,rm}.d/ directories (or an alternative location
# specified in KDEB_HOOKDIR) that will be called on package install and
# removal.

set -e

is_enabled() {
	grep -q "^$1=y" include/config/auto.conf
}

if_enabled_echo() {
	if is_enabled "$1"; then
		echo -n "$2"
	elif [ $# -ge 3 ]; then
		echo -n "$3"
	fi
}

create_package() {
	local pname="$1" pdir="$2"
	local dpkg_deb_opts

	mkdir -m 755 -p "$pdir/DEBIAN"
	mkdir -p "$pdir/usr/share/doc/$pname"
	cp debian/copyright "$pdir/usr/share/doc/$pname/"
	cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
	gzip -n -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
	sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
		| xargs -r0 md5sum > DEBIAN/md5sums"

	# Fix ownership and permissions
	if [ "$DEB_RULES_REQUIRES_ROOT" = "no" ]; then
		dpkg_deb_opts="--root-owner-group"
	else
		chown -R root:root "$pdir"
	fi
	# a+rX in case we are in a restrictive umask environment like 0077
	# ug-s in case we build in a setuid/setgid directory
	chmod -R go-w,a+rX,ug-s "$pdir"

	# Create the package
	dpkg-gencontrol -p$pname -P"$pdir"
	dpkg-deb $dpkg_deb_opts ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
}

install_linux_image () {
	pdir=$1
	pname=$2

	rm -rf ${pdir}

	# Only some architectures with OF support have this target
	if is_enabled CONFIG_OF_EARLY_FLATTREE && [ -d "${srctree}/arch/${SRCARCH}/boot/dts" ]; then
		${MAKE} -f ${srctree}/Makefile INSTALL_DTBS_PATH="${pdir}/usr/lib/linux-image-${KERNELRELEASE}" dtbs_install
	fi

	if is_enabled CONFIG_MODULES; then
		${MAKE} -f ${srctree}/Makefile INSTALL_MOD_PATH="${pdir}" modules_install
		rm -f "${pdir}/lib/modules/${KERNELRELEASE}/build"
		rm -f "${pdir}/lib/modules/${KERNELRELEASE}/source"
		if [ "${SRCARCH}" = um ] ; then
			mkdir -p "${pdir}/usr/lib/uml/modules"
			mv "${pdir}/lib/modules/${KERNELRELEASE}" "${pdir}/usr/lib/uml/modules/${KERNELRELEASE}"
		fi
	fi

	# Install the kernel
	if [ "${ARCH}" = um ] ; then
		mkdir -p "${pdir}/usr/bin" "${pdir}/usr/share/doc/${pname}"
		cp System.map "${pdir}/usr/lib/uml/modules/${KERNELRELEASE}/System.map"
		cp ${KCONFIG_CONFIG} "${pdir}/usr/share/doc/${pname}/config"
		gzip "${pdir}/usr/share/doc/${pname}/config"
	else
		mkdir -p "${pdir}/boot"
		cp System.map "${pdir}/boot/System.map-${KERNELRELEASE}"
		cp ${KCONFIG_CONFIG} "${pdir}/boot/config-${KERNELRELEASE}"
	fi

	# Not all arches have the same installed path in debian
	# XXX: have each arch Makefile export a variable of the canonical image install
	# path instead
	case "${SRCARCH}" in
	um)
		installed_image_path="usr/bin/linux-${KERNELRELEASE}";;
	parisc|mips|powerpc)
		installed_image_path="boot/vmlinux-${KERNELRELEASE}";;
	*)
		installed_image_path="boot/vmlinuz-${KERNELRELEASE}";;
	esac
	cp "$(${MAKE} -s -f ${srctree}/Makefile image_name)" "${pdir}/${installed_image_path}"

	# Install the maintainer scripts
	# Note: hook scripts under /etc/kernel are also executed by official Debian
	# kernel packages, as well as kernel packages built using make-kpkg.
	# make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and
	# so do we; recent versions of dracut and initramfs-tools will obey this.
	debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
	for script in postinst postrm preinst prerm; do
		mkdir -p "${pdir}${debhookdir}/${script}.d"

		mkdir -p "${pdir}/DEBIAN"
		cat <<-EOF > "${pdir}/DEBIAN/${script}"

		#!/bin/sh

		set -e

		# Pass maintainer script parameters to hook scripts
		export DEB_MAINT_PARAMS="\$*"

		# Tell initramfs builder whether it's wanted
		export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)

		test -d ${debhookdir}/${script}.d && run-parts --arg="${KERNELRELEASE}" --arg="/${installed_image_path}" ${debhookdir}/${script}.d
		exit 0
		EOF
		chmod 755 "${pdir}/DEBIAN/${script}"
	done
}

install_linux_image_dbg () {
	pdir=$1
	image_pdir=$2

	rm -rf ${pdir}

	for module in $(find ${image_pdir}/lib/modules/ -name *.ko -printf '%P\n'); do
		module=lib/modules/${module}
		mkdir -p $(dirname ${pdir}/usr/lib/debug/${module})
		# only keep debug symbols in the debug file
		${OBJCOPY} --only-keep-debug ${image_pdir}/${module} ${pdir}/usr/lib/debug/${module}
		# strip original module from debug symbols
		${OBJCOPY} --strip-debug ${image_pdir}/${module}
		# then add a link to those
		${OBJCOPY} --add-gnu-debuglink=${pdir}/usr/lib/debug/${module} ${image_pdir}/${module}
	done

	# re-sign stripped modules
	if is_enabled CONFIG_MODULE_SIG_ALL; then
		${MAKE} -f ${srctree}/Makefile INSTALL_MOD_PATH="${image_pdir}" modules_sign
	fi

	# Build debug package
	# Different tools want the image in different locations
	# perf
	mkdir -p ${pdir}/usr/lib/debug/lib/modules/${KERNELRELEASE}/
	cp vmlinux ${pdir}/usr/lib/debug/lib/modules/${KERNELRELEASE}/
	# systemtap
	mkdir -p ${pdir}/usr/lib/debug/boot/
	ln -s ../lib/modules/${KERNELRELEASE}/vmlinux ${pdir}/usr/lib/debug/boot/vmlinux-${KERNELRELEASE}
	# kdump-tools
	ln -s lib/modules/${KERNELRELEASE}/vmlinux ${pdir}/usr/lib/debug/vmlinux-${KERNELRELEASE}
}

install_kernel_headers () {
	pdir=$1
	version=$2

	rm -rf $pdir

	(
		cd $srctree
		find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
		find include scripts -type f -o -type l
		find arch/$SRCARCH -name Kbuild.platforms -o -name Platform
		find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f
	) > debian/hdrsrcfiles

	{
		if is_enabled CONFIG_OBJTOOL; then
			echo tools/objtool/objtool
		fi

		find arch/$SRCARCH/include Module.symvers include scripts -type f

		if is_enabled CONFIG_GCC_PLUGINS; then
			find scripts/gcc-plugins -name \*.so
		fi
	} > debian/hdrobjfiles

	destdir=$pdir/usr/src/linux-headers-$version
	mkdir -p $destdir
	tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir
	tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir
	rm -f debian/hdrsrcfiles debian/hdrobjfiles

	# copy .config manually to be where it's expected to be
	cp $KCONFIG_CONFIG $destdir/.config

	mkdir -p $pdir/lib/modules/$version/
	ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
}

install_libc_headers () {
	pdir=$1

	rm -rf $pdir

	$MAKE -f $srctree/Makefile headers
	$MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr

	# move asm headers to /usr/include/<libc-machine>/asm to match the structure
	# used by Debian-based distros (to support multi-arch)
	host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
	mkdir $pdir/usr/include/$host_arch
	mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/
}

rm -f debian/files

packages_enabled=$(dh_listpackages)

for package in ${packages_enabled}
do
	case ${package} in
	*-dbg)
		# This must be done after linux-image, that is, we expect the
		# debug package appears after linux-image in debian/control.
		install_linux_image_dbg debian/linux-image-dbg debian/linux-image;;
	linux-image-*|user-mode-linux-*)
		install_linux_image debian/linux-image ${package};;
	linux-libc-dev)
		install_libc_headers debian/linux-libc-dev;;
	linux-headers-*)
		install_kernel_headers debian/linux-headers ${package#linux-headers-};;
	esac
done

for package in ${packages_enabled}
do
	case ${package} in
	*-dbg)
		create_package ${package} debian/linux-image-dbg;;
	linux-image-*|user-mode-linux-*)
		create_package ${package} debian/linux-image;;
	linux-libc-dev)
		create_package ${package} debian/linux-libc-dev;;
	linux-headers-*)
		create_package ${package} debian/linux-headers;;
	esac
done

exit 0
