summaryrefslogtreecommitdiff
path: root/scripts/package
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/package')
-rwxr-xr-xscripts/package/buildtar12
-rwxr-xr-xscripts/package/mkdebian68
2 files changed, 58 insertions, 22 deletions
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index e8cc72a51b32..d624a07a4e77 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -84,10 +84,6 @@ case "${ARCH}" in
[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
[ -f "${objtree}/lifimage" ] && cp -v -- "${objtree}/lifimage" "${tmpdir}/boot/lifimage-${KERNELRELEASE}"
;;
- vax)
- [ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS"
- [ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk"
- ;;
mips)
if [ -f "${objtree}/arch/mips/boot/compressed/vmlinux.bin" ]; then
cp -v -- "${objtree}/arch/mips/boot/compressed/vmlinux.bin" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
@@ -109,6 +105,14 @@ case "${ARCH}" in
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
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 985d72d1ab34..663a7f343b42 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -6,49 +6,81 @@
set -e
+is_enabled() {
+ grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG
+}
+
+if_enabled_echo() {
+ if is_enabled "$1"; then
+ echo -n "$2"
+ elif [ $# -ge 3 ]; then
+ echo -n "$3"
+ fi
+}
+
set_debarch() {
+ if [ -n "$KBUILD_DEBARCH" ] ; then
+ debarch="$KBUILD_DEBARCH"
+ return
+ fi
+
# Attempt to find the correct Debian architecture
case "$UTS_MACHINE" in
- i386|ia64|alpha)
+ i386|ia64|alpha|m68k|riscv*)
debarch="$UTS_MACHINE" ;;
x86_64)
debarch=amd64 ;;
sparc*)
- debarch=sparc ;;
+ debarch=sparc$(if_enabled_echo 64BIT 64) ;;
s390*)
- debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
+ debarch=s390x ;;
ppc*)
- debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
+ if is_enabled 64BIT; then
+ debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el)
+ else
+ debarch=powerpc$(if_enabled_echo SPE spe)
+ fi
+ ;;
parisc*)
debarch=hppa ;;
mips*)
- debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
+ if is_enabled CPU_LITTLE_ENDIAN; then
+ debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el
+ elif is_enabled CPU_MIPSR6; then
+ debarch=mips$(if_enabled_echo 64BIT 64)r6
+ else
+ debarch=mips
+ fi
+ ;;
aarch64|arm64)
debarch=arm64 ;;
arm*)
- if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
- if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
- debarch=armhf
- else
- debarch=armel
- fi
+ if is_enabled AEABI; then
+ debarch=arm$(if_enabled_echo VFP hf el)
else
- debarch=arm
+ debarch=arm
+ fi
+ ;;
+ openrisc)
+ debarch=or1k ;;
+ sh)
+ if is_enabled CPU_SH3; then
+ debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb)
+ elif is_enabled CPU_SH4; then
+ debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb)
fi
;;
- *)
- debarch=$(dpkg --print-architecture)
+ 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 using your current userspace instead!" >&2
+ echo "Falling back to the current host architecture ($debarch)." >&2
echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
echo "" >&2
- esac
- if [ -n "$KBUILD_DEBARCH" ] ; then
- debarch="$KBUILD_DEBARCH"
fi
}