diff -ruN base-installer-1.189/debian/templates-arch base-installer-1.189.lnd.1/debian/templates-arch
--- base-installer-1.189/debian/templates-arch	2014-11-01 01:50:38.000000000 +0800
+++ base-installer-1.189.lnd.1/debian/templates-arch	2021-06-09 12:28:13.000000000 +0800
@@ -33,6 +33,7 @@
 Default[ia64]: false
 Default[mips]: false
 Default[mipsel]: false
+Default[loongarch64]: false
 Default[m68k]: false
 Default[hppa]: true
 Description: for internal use only
diff -ruN base-installer-1.189/kernel/loongarch64.sh base-installer-1.189.lnd.1/kernel/loongarch64.sh
--- base-installer-1.189/kernel/loongarch64.sh	1970-01-01 08:00:00.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/loongarch64.sh	2021-06-09 12:28:13.000000000 +0800
@@ -0,0 +1,31 @@
+arch_get_kernel_flavour () {
+	case "$SUBARCH" in
+	    loongarch64|generic)
+		subarch=`uname -r`
+		echo "$subarch"
+		return 0 ;;
+	    *)
+		warning "Unknown $ARCH subarchitecture '$SUBARCH'."
+		return 1 ;;
+	esac
+}
+
+arch_check_usable_kernel () {
+        case "$1" in
+            *-dbg)
+                return 1
+                ;;
+            *-loongson-3 | *-loongson-3-*)
+                # Allow any other hyphenated suffix
+                return 0
+                ;;
+            *)
+                return 1
+                ;;
+        esac
+}
+
+
+arch_get_kernel () {
+	echo "linux-image-$1"
+}
diff -ruN base-installer-1.189/kernel/Makefile base-installer-1.189.lnd.1/kernel/Makefile
--- base-installer-1.189/kernel/Makefile	2017-09-08 05:54:20.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/Makefile	2021-06-09 12:28:13.000000000 +0800
@@ -1,4 +1,4 @@
-ARCHES = alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips mipsel mips64el powerpc ppc64 ppc64el s390x sh4 sparc sparc64 kfreebsd-amd64 kfreebsd-i386
+ARCHES = alpha amd64 arm64 armel armhf hppa i386 ia64 m68k mips mipsel mips64el powerpc ppc64 ppc64el s390x sh4 sparc sparc64 kfreebsd-amd64 kfreebsd-i386 loongarch64
 
 test:
 	@STATUS=0; \
diff -ruN base-installer-1.189/kernel/tests/dotest base-installer-1.189.lnd.1/kernel/tests/dotest
--- base-installer-1.189/kernel/tests/dotest	2014-03-02 08:09:15.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/tests/dotest	2021-06-09 12:28:13.000000000 +0800
@@ -32,6 +32,9 @@
 		3.10)
 			WANT_KERNELS="$KERNEL_3_10"
 			;;
+		4.19)
+			WANT_KERNELS="$KERNEL_4_19"
+			;;
 		7)
 			WANT_KERNELS="$KERNEL_7"
 			;;
diff -ruN base-installer-1.189/kernel/tests/loongarch64/loongarch.cpuinfo base-installer-1.189.lnd.1/kernel/tests/loongarch64/loongarch.cpuinfo
--- base-installer-1.189/kernel/tests/loongarch64/loongarch.cpuinfo	1970-01-01 08:00:00.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/tests/loongarch64/loongarch.cpuinfo	2021-06-09 12:28:13.000000000 +0800
@@ -0,0 +1,70 @@
+system type		: generic-loongson-machine
+machine			: Unknown
+processor		: 0
+package			: 0
+core			: 0
+cpu model		: Loongson-64bit
+model name		: Loongson-3A5000
+CPU Revision		: 0x10
+FPU Revision		: 0x00
+CPU MHz			: 2500.00
+BogoMIPS		: 5000.00
+tlb_entries		: 2112
+isa			: loongarch32 loongarch64
+ASEs implemented	: cpucfg lamo lsx lasx lvz lbt
+kscratch registers	: 3
+idle instruction	: yes
+microsecond timers	: yes
+hardware watchpoint	: yes, iwatch count: 8, dwatch count: 8
+
+processor		: 1
+package			: 0
+core			: 1
+cpu model		: Loongson-64bit
+model name		: Loongson-3A5000
+CPU Revision		: 0x10
+FPU Revision		: 0x00
+CPU MHz			: 2500.00
+BogoMIPS		: 5000.00
+tlb_entries		: 2112
+isa			: loongarch32 loongarch64
+ASEs implemented	: cpucfg lamo lsx lasx lvz lbt
+kscratch registers	: 3
+idle instruction	: yes
+microsecond timers	: yes
+hardware watchpoint	: yes, iwatch count: 8, dwatch count: 8
+
+processor		: 2
+package			: 0
+core			: 2
+cpu model		: Loongson-64bit
+model name		: Loongson-3A5000
+CPU Revision		: 0x10
+FPU Revision		: 0x00
+CPU MHz			: 2500.00
+BogoMIPS		: 5000.00
+tlb_entries		: 2112
+isa			: loongarch32 loongarch64
+ASEs implemented	: cpucfg lamo lsx lasx lvz lbt
+kscratch registers	: 3
+idle instruction	: yes
+microsecond timers	: yes
+hardware watchpoint	: yes, iwatch count: 8, dwatch count: 8
+
+processor		: 3
+package			: 0
+core			: 3
+cpu model		: Loongson-64bit
+model name		: Loongson-3A5000
+CPU Revision		: 0x10
+FPU Revision		: 0x00
+CPU MHz			: 2500.00
+BogoMIPS		: 5000.00
+tlb_entries		: 2112
+isa			: loongarch32 loongarch64
+ASEs implemented	: cpucfg lamo lsx lasx lvz lbt
+kscratch registers	: 3
+idle instruction	: yes
+microsecond timers	: yes
+hardware watchpoint	: yes, iwatch count: 8, dwatch count: 8
+
diff -ruN base-installer-1.189/kernel/tests/loongarch64/loongarch.test base-installer-1.189.lnd.1/kernel/tests/loongarch64/loongarch.test
--- base-installer-1.189/kernel/tests/loongarch64/loongarch.test	1970-01-01 08:00:00.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/tests/loongarch64/loongarch.test	2021-06-09 12:28:13.000000000 +0800
@@ -0,0 +1,10 @@
+subarch generic
+cpuinfo loongarch.cpuinfo
+majors 4.19
+flavour 4.19.0-11-loongson-3
+kernel-4.19 \
+  linux-image-4.19.0-11-loongson-3
+usable \
+  linux-image-4.19.0-11-loongson-3
+unusable \
+  linux-image-4.19.0-11-loongson-3-dbg
diff -ruN base-installer-1.189/kernel/tests/runtests base-installer-1.189.lnd.1/kernel/tests/runtests
--- base-installer-1.189/kernel/tests/runtests	2014-03-02 08:09:15.000000000 +0800
+++ base-installer-1.189.lnd.1/kernel/tests/runtests	2021-06-09 12:28:13.000000000 +0800
@@ -23,7 +23,7 @@
 run_test () {
 	TEST="$1"
 
-	unset SUBARCH CPUINFO OFCPUS MACHINE FLAVOUR KERNEL_26 KERNEL_3_10 KERNEL_7 KERNEL_8 USABLE UNUSABLE \
+	unset SUBARCH CPUINFO OFCPUS MACHINE FLAVOUR KERNEL_26 KERNEL_3_10 KERNEL_4_19  KERNEL_7 KERNEL_8 USABLE UNUSABLE \
 		|| true
 	NUMCPUS=1
 	MAJORS=2.6
@@ -57,6 +57,9 @@
 			kernel-3.10)
 				KERNEL_3_10="$value"
 				;;
+			kernel-4.19)
+				KERNEL_4_19="$value"
+				;;
 			kernel-7)
 				KERNEL_7="$value"
 				;;
@@ -78,7 +81,7 @@
 	done < "$TEST"
 
 	export ARCH SUBARCH CPUINFO OFCPUS NUMCPUS MACHINE
-	export MAJORS FLAVOUR KERNEL_26 KERNEL_3_10 KERNEL_7 KERNEL_8
+	export MAJORS FLAVOUR KERNEL_26 KERNEL_3_10 KERNEL_4_19  KERNEL_7 KERNEL_8
 	export USABLE UNUSABLE
 
 	TMP="$(mktemp -t base-installer-tests.XXXXXX)"
diff -ruN base-installer-1.189/library.sh base-installer-1.189.lnd.1/library.sh
--- base-installer-1.189/library.sh	2019-06-30 23:05:34.000000000 +0800
+++ base-installer-1.189.lnd.1/library.sh	2021-06-09 12:28:13.000000000 +0800
@@ -323,7 +323,7 @@
 		else
 			exit_error base-installer/no_codename
 		fi
-
+		ln -svf /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/$DISTRIBUTION
 		mirror_error=""
 
 		db_get mirror/protocol || mirror_error=1
