Description: convert containerd to loong-containerd 
 loong-containerd.io (1.4.3-3.lnd.1) release; urgency=high
    convert containerd to loong-containerd 
Author: wanghuaiqing <wanghuaiqing@loongson.cn>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2022-08-08

--- /dev/null
+++ lcf/src/loong-containerd.io-1.4.3/common/loong-containerd.service
@@ -0,0 +1,40 @@
+# Copyright The containerd Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[Unit]
+Description=containerd container runtime
+Documentation=https://containerd.io
+After=network.target local-fs.target
+
+[Service]
+ExecStartPre=-/sbin/modprobe overlay
+ExecStart=/usr/bin/loong-containerd
+
+Type=notify
+Delegate=yes
+KillMode=process
+Restart=always
+RestartSec=5
+# Having non-zero Limit*s causes performance problems due to accounting overhead
+# in the kernel. We recommend using cgroups to do container-local accounting.
+LimitNPROC=infinity
+LimitCORE=infinity
+LimitNOFILE=infinity
+# Comment TasksMax if your systemd version does not supports it.
+# Only systemd 226 and above support this version.
+TasksMax=infinity
+OOMScoreAdjust=-999
+
+[Install]
+WantedBy=multi-user.target
--- lcf/src/loong-containerd.io-1.4.3.orig/src/github.com/containerd/containerd/Makefile
+++ lcf/src/loong-containerd.io-1.4.3/src/github.com/containerd/containerd/Makefile
@@ -69,7 +69,7 @@ RELEASE=containerd-$(VERSION:v%=%).${GOO
 PKG=github.com/containerd/containerd
 
 # Project binaries.
-COMMANDS=ctr containerd containerd-stress
+COMMANDS=loong-ctr loong-containerd loong-containerd-stress
 MANPAGES=ctr.8 containerd.8 containerd-config.8 containerd-config.toml.5
 
 ifdef BUILDTAGS
@@ -199,32 +199,56 @@ endef
 bin/%: cmd/% FORCE
 	$(BUILD_BINARY)
 
-bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
-
-bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim-runc-v1"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
-
-bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim-runc-v2"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
+bin/loong-ctr: cmd/ctr FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-ctr"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o bin/loong-ctr ${GO_LDFLAGS} ${GO_TAGS}  ./cmd/ctr
+
+bin/loong-containerd: cmd/containerd FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-containerd"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o bin/loong-containerd ${GO_LDFLAGS} ${GO_TAGS}  ./cmd/containerd
+
+bin/loong-containerd-stress: cmd/containerd-stress FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-containerd-stress"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o bin/loong-containerd-stress ${GO_LDFLAGS} ${GO_TAGS}  ./cmd/containerd-stress
+
+bin/loong-containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-containerd-shim"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/loong-containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
+
+bin/loong-containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-containerd-shim-runc-v1"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/loong-containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
+
+bin/loong-containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) bin/loong-containerd-shim-runc-v2"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/loong-containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
 
 static-bin/%: cmd/% FORCE
 	$(BUILD_STATIC_BINARY)
 
-static-bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o staic-bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
-
-static-bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim-runc-v1"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o static-bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
-
-static-bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
-	@echo "$(WHALE) bin/containerd-shim-runc-v2"
-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o static-bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
+static-bin/loong-ctr: cmd/ctr FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-ctr"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o static-bin/loong-ctr ${GO_STATIC_LDFLAGS} ${GO_TAGS}  ./cmd/ctr
+
+static-bin/loong-containerd: cmd/containerd FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-containerd"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o static-bin/loong-containerd ${GO_STATIC_LDFLAGS} ${GO_TAGS}  ./cmd/containerd
+
+static-bin/loong-containerd-stress: cmd/containerd-stress FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-containerd-stress"
+	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o static-bin/loong-containerd-stress ${GO_STATIC_LDFLAGS} ${GO_TAGS}  ./cmd/containerd-stress
+
+static-bin/loong-containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-containerd-shim"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o static-bin/loong-containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
+
+static-bin/loong-containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-containerd-shim-runc-v1"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o static-bin/loong-containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
+
+static-bin/loong-containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
+	@echo "$(WHALE) static-bin/loong-containerd-shim-runc-v2"
+	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o static-bin/loong-containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
 
 binaries: $(BINARIES) ## build binaries
 	@echo "$(WHALE) $@"
--- lcf/src/loong-containerd.io-1.4.3.orig/src/github.com/containerd/containerd/Makefile.linux
+++ lcf/src/loong-containerd.io-1.4.3/src/github.com/containerd/containerd/Makefile.linux
@@ -16,7 +16,7 @@
 #linux specific settings
 WHALE="+"
 ONI="-"
-COMMANDS += containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2
+COMMANDS += loong-containerd-shim loong-containerd-shim-runc-v1 loong-containerd-shim-runc-v2
 
 # check GOOS for cross compile builds
 ifeq ($(GOOS),linux)
--- lcf/src/loong-containerd.io-1.4.3.orig/src/github.com/containerd/containerd/defaults/defaults_unix.go
+++ lcf/src/loong-containerd.io-1.4.3/src/github.com/containerd/containerd/defaults/defaults_unix.go
@@ -21,17 +21,17 @@ package defaults
 const (
 	// DefaultRootDir is the default location used by containerd to store
 	// persistent data
-	DefaultRootDir = "/var/lib/containerd"
+	DefaultRootDir = "/var/lib/loong-containerd"
 	// DefaultStateDir is the default location used by containerd to store
 	// transient data
-	DefaultStateDir = "/run/containerd"
+	DefaultStateDir = "/run/loong-containerd"
 	// DefaultAddress is the default unix socket address
-	DefaultAddress = "/run/containerd/containerd.sock"
+	DefaultAddress = "/run/loong-containerd/containerd.sock"
 	// DefaultDebugAddress is the default unix socket address for pprof data
-	DefaultDebugAddress = "/run/containerd/debug.sock"
+	DefaultDebugAddress = "/run/loong-containerd/debug.sock"
 	// DefaultFIFODir is the default location used by client-side cio library
 	// to store FIFOs.
-	DefaultFIFODir = "/run/containerd/fifo"
+	DefaultFIFODir = "/run/loong-containerd/fifo"
 	// DefaultRuntime is the default linux runtime
 	DefaultRuntime = "io.containerd.runc.v2"
 )
--- lcf/src/loong-containerd.io-1.4.3.orig/src/github.com/containerd/containerd/runtime/v2/shim/util_unix.go
+++ lcf/src/loong-containerd.io-1.4.3/src/github.com/containerd/containerd/runtime/v2/shim/util_unix.go
@@ -36,7 +36,7 @@ import (
 )
 
 const (
-	shimBinaryFormat = "containerd-shim-%s-%s"
+	shimBinaryFormat = "loong-containerd-shim-%s-%s"
 	socketPathLimit  = 106
 )
 
--- lcf/src/loong-containerd.io-1.4.3.orig/src/github.com/opencontainers/runc/Makefile
+++ lcf/src/loong-containerd.io-1.4.3/src/github.com/opencontainers/runc/Makefile
@@ -33,16 +33,16 @@ GO_BUILD_STATIC := CGO_ENABLED=1 $(GO) b
 .DEFAULT: runc
 
 runc:
-	$(GO_BUILD) -o runc .
+	$(GO_BUILD) -o loong-runc .
 
 all: runc recvtty
 
 recvtty:
-	$(GO_BUILD) -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
+	$(GO_BUILD) -o contrib/cmd/recvtty/loong-recvtty ./contrib/cmd/recvtty
 
 static:
-	$(GO_BUILD_STATIC) -o runc .
-	$(GO_BUILD_STATIC) -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
+	$(GO_BUILD_STATIC) -o loong-runc .
+	$(GO_BUILD_STATIC) -o contrib/cmd/recvtty/loong-recvtty ./contrib/cmd/recvtty
 
 release:
 	script/release.sh -r release/$(VERSION) -v $(VERSION)
@@ -104,18 +104,18 @@ shell: runcimage
 		$(RUNC_IMAGE) bash
 
 install:
-	install -D -m0755 runc $(DESTDIR)$(BINDIR)/runc
+	install -D -m0755 loong-runc $(DESTDIR)$(BINDIR)/loong-runc
 
 install-bash:
-	install -D -m0644 contrib/completions/bash/runc $(DESTDIR)$(PREFIX)/share/bash-completion/completions/runc
+	install -D -m0644 contrib/completions/bash/loong-runc $(DESTDIR)$(PREFIX)/share/bash-completion/completions/loong-runc
 
 install-man: man
 	install -d -m 755 $(DESTDIR)$(MANDIR)/man8
 	install -D -m 644 man/man8/*.8 $(DESTDIR)$(MANDIR)/man8
 
 clean:
-	rm -f runc runc-*
-	rm -f contrib/cmd/recvtty/recvtty
+	rm -f loong-runc loong-runc-*
+	rm -f contrib/cmd/recvtty/loong-recvtty
 	rm -rf release
 	rm -rf man/man8
 
@@ -151,10 +151,10 @@ cross: runcimage
 		$(RUNC_IMAGE) make localcross
 
 localcross:
-	CGO_ENABLED=1 GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc   $(GO_BUILD) -o runc-armel .
-	CGO_ENABLED=1 GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc $(GO_BUILD) -o runc-armhf .
-	CGO_ENABLED=1 GOARCH=arm64 CC=aarch64-linux-gnu-gcc         $(GO_BUILD) -o runc-arm64 .
-	CGO_ENABLED=1 GOARCH=ppc64le CC=powerpc64le-linux-gnu-gcc   $(GO_BUILD) -o runc-ppc64le .
+	CGO_ENABLED=1 GOARCH=arm GOARM=6 CC=arm-linux-gnueabi-gcc   $(GO_BUILD) -o loong-runc-armel .
+	CGO_ENABLED=1 GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc $(GO_BUILD) -o loong-runc-armhf .
+	CGO_ENABLED=1 GOARCH=arm64 CC=aarch64-linux-gnu-gcc         $(GO_BUILD) -o loong-runc-arm64 .
+	CGO_ENABLED=1 GOARCH=ppc64le CC=powerpc64le-linux-gnu-gcc   $(GO_BUILD) -o loong-runc-ppc64le .
 
 .PHONY: runc all recvtty static release dbuild lint man runcimage \
 	test localtest unittest localunittest integration localintegration \
--- lcf/src/loong-containerd.io-1.4.3.orig/static-compile/static-compile.sh
+++ lcf/src/loong-containerd.io-1.4.3/static-compile/static-compile.sh
@@ -12,6 +12,9 @@ VERSION=$(cat VERSION)
 PACKAGE=${PACKAGE:-containerd.io}
 GO_SRC_PATH=$(pwd)/src/github.com/containerd/containerd
 GO_RUNC_SRC_PATH=$(pwd)/src/github.com/opencontainers/runc
+rm $GO_SRC_PATH/static-bin  -rf
+rm $GO_RUNC_SRC_PATH/static-bin  -rf
+
 
 REF="6fbe2f9a8e085ffeb72c00027c4f9c889261602c"
 
@@ -31,9 +34,9 @@ set -x; make -C $GO_RUNC_SRC_PATH  --no-
 mkdir -p static-build/static-bin/containerd.io/usr/bin
 
 install -D -m 0755 $GO_SRC_PATH/static-bin/* static-build/static-bin/containerd.io/usr/bin
-install -D -m 0755 $GO_RUNC_SRC_PATH/runc static-build/static-bin/containerd.io/usr/bin
-install -D -m 0644 common/containerd.service static-build/static-bin/containerd.io/lib/systemd/system/containerd.service
-install -D -m 0644 common/containerd.toml    static-build/static-bin/containerd.io/etc/containerd/config.toml
+install -D -m 0755 $GO_RUNC_SRC_PATH/loong-runc static-build/static-bin/containerd.io/usr/bin
+install -D -m 0644 common/loong-containerd.service static-build/static-bin/containerd.io/lib/systemd/system/loong-containerd.service
+install -D -m 0644 common/containerd.toml    static-build/static-bin/containerd.io/etc/loong-containerd/config.toml
 install -D -m 0755 static-compile/static_install.sh       static-build/static-bin/install.sh
 install -D -m 0755 static-compile/static_uninstall.sh     static-build/static-bin/uninstall.sh
 cd static-build
--- lcf/src/loong-containerd.io-1.4.3.orig/static-compile/static_install.sh
+++ lcf/src/loong-containerd.io-1.4.3/static-compile/static_install.sh
@@ -3,13 +3,13 @@
 set -x
 cd $(dirname "$0")
 
-systemctl stop containerd
+systemctl stop loong-containerd
 
 install -D -m 0755 containerd.io/usr/bin/*  /usr/bin/
-install -D -m 0644 containerd.io/lib/systemd/system/containerd.service  /lib/systemd/system/containerd.service 
-install -D -m 0644 containerd.io/etc/containerd/config.toml /etc/containerd/config.toml  
+install -D -m 0644 containerd.io/lib/systemd/system/loong-containerd.service  /lib/systemd/system/loong-containerd.service 
+install -D -m 0644 containerd.io/etc/loong-containerd/config.toml /etc/loong-containerd/config.toml  
 
 
 systemctl daemon-reload
-systemctl start containerd
+systemctl start loong-containerd
 
--- lcf/src/loong-containerd.io-1.4.3.orig/static-compile/static_uninstall.sh
+++ lcf/src/loong-containerd.io-1.4.3/static-compile/static_uninstall.sh
@@ -1,16 +1,16 @@
 #!/bin/bash
 set -x
 
-if pidof containerd
+if pidof loong-containerd
 then
-	systemctl stop containerd
+	systemctl stop loong-containerd
 fi
 
-rm  /usr/bin/ctr  -f
-rm  /usr/bin/containerd -f
-rm  /usr/bin/containerd-shim -f
-rm  /usr/bin/containerd-shim-runc-v1 -f
-rm  /usr/bin/containerd-shim-runc-v2 -f
-rm  /usr/bin/runc  -f
-rm  /lib/systemd/system/containerd.service -f 
-rm  /etc/containerd/config.toml -f
+rm  /usr/bin/loong-ctr  -f
+rm  /usr/bin/loong-containerd -f
+rm  /usr/bin/loong-containerd-shim -f
+rm  /usr/bin/loong-containerd-shim-runc-v1 -f
+rm  /usr/bin/loong-containerd-shim-runc-v2 -f
+rm  /usr/bin/loong-runc  -f
+rm  /lib/systemd/system/loong-containerd.service -f 
+rm  /etc/loong-containerd/config.toml -f
