#!/bin/sh
#
# Copyright 2003 Wichert Akkerman <wichert@wiggy.net>
#
# Simple script to generate a debian/ directory for a Linux kernel.

set -eu

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
}

set_debarch() {
	if [ "${KBUILD_DEBARCH:+set}" ]; then
		debarch="$KBUILD_DEBARCH"
		return
	fi

	# Attempt to find the correct Debian architecture
	case "$UTS_MACHINE" in
	i386|alpha|m68k|riscv*)
		debarch="$UTS_MACHINE" ;;
	x86_64)
		debarch=amd64 ;;
	sparc*)
		debarch=sparc$(if_enabled_echo CONFIG_64BIT 64) ;;
	s390*)
		debarch=s390x ;;
	ppc*)
		if is_enabled CONFIG_64BIT; then
			debarch=ppc64$(if_enabled_echo CONFIG_CPU_LITTLE_ENDIAN el)
		else
			debarch=powerpc$(if_enabled_echo CONFIG_SPE spe)
		fi
		;;
	parisc*)
		debarch=hppa ;;
	mips*)
		if is_enabled CONFIG_CPU_LITTLE_ENDIAN; then
			debarch=mips$(if_enabled_echo CONFIG_64BIT 64)$(if_enabled_echo CONFIG_CPU_MIPSR6 r6)el
		elif is_enabled CONFIG_CPU_MIPSR6; then
			debarch=mips$(if_enabled_echo CONFIG_64BIT 64)r6
		else
			debarch=mips
		fi
		;;
	aarch64|arm64)
		debarch=arm64 ;;
	arm*)
		if is_enabled CONFIG_AEABI; then
			debarch=arm$(if_enabled_echo CONFIG_VFP hf el)
		else
			debarch=arm
		fi
		;;
	openrisc)
		debarch=or1k ;;
	sh)
		if is_enabled CONFIG_CPU_SH3; then
			debarch=sh3$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
		elif is_enabled CONFIG_CPU_SH4; then
			debarch=sh4$(if_enabled_echo CONFIG_CPU_BIG_ENDIAN eb)
		fi
		;;
	esac
	if [ -z "$debarch" ]; then
		debarch=$(dpkg-architecture -qDEB_HOST_ARCH)
		echo "" >&2
		echo "** ** **  WARNING  ** ** **" >&2
		echo "" >&2
		echo "Your architecture doesn't have its equivalent" >&2
		echo "Debian userspace architecture defined!" >&2
		echo "Falling back to the current host architecture ($debarch)." >&2
		echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
		echo "" >&2
	fi
}

# Create debian/source/ if it is a source package build
gen_source ()
{
	mkdir -p debian/source

	echo "3.0 (quilt)" > debian/source/format

	{
		echo "diff-ignore"
		echo "extend-diff-ignore = .*"
	} > debian/source/local-options

	# Add .config as a patch
	mkdir -p debian/patches
	{
		echo "Subject: Add .config"
		echo "Author: ${maintainer}"
		echo
		echo "--- /dev/null"
		echo "+++ linux/.config"
		diff -u /dev/null "${KCONFIG_CONFIG}" | tail -n +3
	} > debian/patches/config.patch
	echo config.patch > debian/patches/series

	"${srctree}/scripts/package/gen-diff-patch" debian/patches/diff.patch
	if [ -s debian/patches/diff.patch ]; then
		sed -i "
			1iSubject: Add local diff
			1iAuthor: ${maintainer}
			1i
		" debian/patches/diff.patch

		echo diff.patch >> debian/patches/series
	else
		rm -f debian/patches/diff.patch
	fi
}

rm -rf debian
mkdir debian

user=${KBUILD_BUILD_USER:-$(id -nu)}
name=${DEBFULLNAME:-${user}}
if [ "${DEBEMAIL:+set}" ]; then
	email=${DEBEMAIL}
else
	buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)}
	email="${user}@${buildhost}"
fi
maintainer="${name} <${email}>"

while [ $# -gt 0 ]; do
	case "$1" in
	--need-source)
		gen_source
		shift
		;;
	*)
		break
		;;
	esac
done

# Some variables and settings used throughout the script
version=$KERNELRELEASE
if [ "${KDEB_PKGVERSION:+set}" ]; then
	packageversion=$KDEB_PKGVERSION
else
	packageversion=$(${srctree}/scripts/setlocalversion --no-local ${srctree})-$($srctree/scripts/build-version)
fi
sourcename=${KDEB_SOURCENAME:-linux-upstream}

if [ "$ARCH" = "um" ] ; then
	packagename=user-mode-linux
else
	packagename=linux-image
fi

debarch=
set_debarch

# Try to determine distribution
if [ "${KDEB_CHANGELOG_DIST:+set}" ]; then
        distribution=$KDEB_CHANGELOG_DIST
# In some cases lsb_release returns the codename as n/a, which breaks dpkg-parsechangelog
elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then
        : # nothing to do in this case
else
        distribution="unstable"
        echo >&2 "Using default distribution of 'unstable' in the changelog"
        echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
fi

echo $debarch > debian/arch

# Generate a simple changelog template
cat <<EOF > debian/changelog
$sourcename ($packageversion) $distribution; urgency=low

  * Custom built Linux kernel.

 -- $maintainer  $(date -R)
EOF

# Generate a control file
cat <<EOF > debian/control
Source: $sourcename
Section: kernel
Priority: optional
Maintainer: $maintainer
Rules-Requires-Root: no
Build-Depends: debhelper-compat (= 12)
Build-Depends-Arch: bc, bison, cpio, flex, kmod, libelf-dev:native, libssl-dev:native, rsync
Homepage: https://www.kernel.org/

Package: $packagename-$version
Architecture: $debarch
Description: Linux kernel, version $version
 This package contains the Linux kernel, modules and corresponding other
 files, version: $version.
EOF

if [ "${SRCARCH}" != um ]; then
cat <<EOF >> debian/control

Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: $debarch
Description: Linux support headers for userspace development
 This package provides userspaces headers from the Linux kernel.  These headers
 are used by the installed headers for GNU glibc and other system libraries.
Multi-Arch: same
EOF

if is_enabled CONFIG_MODULES; then
cat <<EOF >> debian/control

Package: linux-headers-$version
Architecture: $debarch
Description: Linux kernel headers for $version on $debarch
 This package provides kernel header files for $version on $debarch
 .
 This is useful for people who need to build external modules
EOF
fi
fi

if is_enabled CONFIG_DEBUG_INFO; then
cat <<EOF >> debian/control

Package: linux-image-$version-dbg
Section: debug
Architecture: $debarch
Description: Linux kernel debugging symbols for $version
 This package will come in handy if you need to debug the kernel. It provides
 all the necessary debug symbols for the kernel and its modules.
EOF
fi

cat <<EOF > debian/rules.vars
ARCH := ${ARCH}
KERNELRELEASE := ${KERNELRELEASE}
EOF

cp "${srctree}/scripts/package/debian/copyright" debian/
cp "${srctree}/scripts/package/debian/rules" debian/

exit 0
