1 Star 0 Fork 14

songkai/libreswan

forked from src-anolis-os/libreswan 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-libreswan-anolis-rebrand-to-anolis.patch 3.74 KB
一键复制 编辑 原始数据 按行查看 历史
From c0ae1f9070d386036a793d3e8eac7a787e7017a0 Mon Sep 17 00:00:00 2001
From: "yangxiaoxuan@openanolis.org" <root@localhost.localdomain>
Date: Mon, 21 Jun 2021 22:48:03 +0800
Subject: [PATCH] libreswan anolis rebrand to anolis
---
Makefile | 2 +-
mk/defaults/linux.mk | 2 +-
programs/barf/barf.in | 2 +-
testing/guestbin/docker-transmogrify | 8 +++++---
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index db230d4..bafddc2 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ include ${LIBRESWANSRCDIR}/Makefile.inc
MAIN_RPM_VERSION = $(shell make showversion | sed "s/-.*//")
MAIN_RPM_PREVER = $(shell make showversion | sed -e "s/^.[^-]*-\([^-]*\)-\(.*\)/rc\1_\2/" -e "s/-/_/g")
MAIN_RPM_PREFIX = libreswan-$(MAIN_RPM_VERSION)$(MAIN_RPM_PREVER)
-MAIN_RPM_RHEL_PKG = $(shell rpm -qf /etc/redhat-release)
+MAIN_RPM_RHEL_PKG = $(shell rpm -qf /etc/anolis-release)
MAIN_RPM_RHEL_VERSION = $(shell echo $(MAIN_RPM_RHEL_PKG) | sed "s/.*-release-\(.\).*/\1/")
MAIN_RPM_SPECFILE = $(shell if [ -f /etc/fedora-release ]; then echo packaging/fedora/libreswan.spec; elif [ -n "$(MAIN_RPM_RHEL_VERSION)" ]; then echo packaging/rhel/$(MAIN_RPM_RHEL_VERSION)/libreswan.spec; else echo "unknown distro, cannot find spec file to use in packaging directory"; fi)
RHEL_LIKE= $(shell cat /etc/os-release | grep ID_LIKE | sed -e "s/ID_LIKE=//" -e 's/"//g' -e "s/ .*//")
diff --git a/mk/defaults/linux.mk b/mk/defaults/linux.mk
index c286a7d..56a3e20 100644
--- a/mk/defaults/linux.mk
+++ b/mk/defaults/linux.mk
@@ -131,7 +131,7 @@ ifndef INITSYSTEM
ifndef INITSYSTEM
ifneq ($(and $(wildcard /lib/systemd/systemd),$(wildcard /run/systemd)),)
INITSYSTEM=systemd
- else ifneq ($(and $(wildcard /sbin/start),$(wildcard /etc/redhat-release)),)
+ else ifneq ($(and $(wildcard /sbin/start),$(wildcard /etc/anolis-release)),)
# override for rhel/centos to use sysvinit
INITSYSTEM=sysvinit
else ifneq ($(wildcard /sbin/start),)
diff --git a/programs/barf/barf.in b/programs/barf/barf.in
index e76c62f..7a7a61a 100755
--- a/programs/barf/barf.in
+++ b/programs/barf/barf.in
@@ -248,7 +248,7 @@ if [ -r /proc/config_built_with ]; then
cat /proc/config_built_with
fi
_________________________ distro-release
-for distro in /etc/redhat-release /etc/debian-release /etc/SuSE-release /etc/mandrake-release /etc/mandriva-release /etc/gentoo-release
+for distro in /etc/redhat-release /etc/anolis-release /etc/debian-release /etc/SuSE-release /etc/mandrake-release /etc/mandriva-release /etc/gentoo-release
do
if [ -f ${distro} ]; then
cat ${distro}
diff --git a/testing/guestbin/docker-transmogrify b/testing/guestbin/docker-transmogrify
index 0afa1f1..4dc7539 100755
--- a/testing/guestbin/docker-transmogrify
+++ b/testing/guestbin/docker-transmogrify
@@ -34,7 +34,9 @@ macs['sunset'] = "12:00:00:ab:cd:01"
# conflicts with north
#macs['japan'] = "12:00:00:ab:cd:02"
-if os.path.isfile("/etc/redhat-release"):
+if os.path.isfile("/etc/anolis-release"):
+ GUESTOS = "anolis"
+elif os.path.isfile("/etc/redhat-release"):
GUESTOS = "redhat"
elif os.path.isfile("/etc/debian_version"):
GUESTOS = "debian"
@@ -136,7 +138,7 @@ else:
if os.path.isfile(hostname_file):
shutil.copyfile(hostname_file, "/etc/hostname")
-if GUESTOS == "redhat":
+if GUESTOS == "anolis":
# these files are needed for systemd-networkd too
fnames = glob.glob("/testing/baseconfigs/all/etc/sysconfig/*")
@@ -216,7 +218,7 @@ for dbfile in glob.glob("/etc/ipsec.d/*.db"):
os.chmod(dbfile, 0o600)
# SElinux fixup
-if GUESTOS == "redhat":
+if GUESTOS == "anolis":
output += "\n" + subprocess.getoutput("restorecon -R /etc/")
# selinux does not like our /testing include files
--
2.18.4
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/songkai01/libreswan.git
git@gitee.com:songkai01/libreswan.git
songkai01
libreswan
libreswan
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385