Skip to content

Commit

Permalink
<feature>[root]: use openeuler image for vpc
Browse files Browse the repository at this point in the history
Resolves: ZSTAC-65988

Change-Id: I6b69757169676c627463787164696a6a6961696e
  • Loading branch information
ruansteve committed Aug 21, 2024
1 parent 9eda188 commit 46a63a8
Show file tree
Hide file tree
Showing 112 changed files with 1,664 additions and 699 deletions.
15 changes: 14 additions & 1 deletion data/config/bootup-config.install
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ ipsec.sh __ZVR_ROOT_PATH__/keepalived/temp/ipsec.sh 0755 __U
version __ZVR_ROOT_PATH__/version 0644 __USER__:users
zsn-crontab.sh /usr/local/zstack/zsn-agent/bin/zsn-crontab.sh 0755 __USER__:users
zstack-virtualrouteragent /etc/init.d/zstack-virtualrouteragent 0755 root:root

rsyslog.haproxy /etc/rsyslog.d/haproxy.conf 0600 root:root
rsyslog.keepalived /etc/rsyslog.d/keepalived.conf 0600 root:root
rsyslog.dhcp /etc/rsyslog.d/dhcp.conf 0600 root:root
lograte.auth /etc/logrotate.d/auth 0600 root:root
lograte.charon /etc/logrotate.d/charon 0600 root:root
lograte.dhcp /etc/logrotate.d/dhcp 0600 root:root
lograte.dnsamsq /etc/logrotate.d/dnsamsq 0600 root:root
lograte.gobetween /etc/logrotate.d/gobetween 0600 root:root
lograte.haproxy /etc/logrotate.d/haproxy 0600 root:root
lograte.keepalived /etc/logrotate.d/keepalived 0600 root:root
lograte.zsn /etc/logrotate.d/zsn 0600 root:root
lograte.zvr /etc/logrotate.d/zvr 0600 root:root
lograte.zvrMonitor /etc/logrotate.d/zvrMonitor 0600 root:root
lograte.zvrstartup /etc/logrotate.d/zvrstartup 0600 root:root

[[X86]]
# this files just for x86_64
Expand Down
44 changes: 44 additions & 0 deletions data/config/bootup-config_euler2203.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[[GENERIC]]
# this files for all archs
# format: [source file] [dst file] [file mode] [file owner]
#
sysctl.conf /etc/sysctl.conf 0644 root:root
healthcheck.sh /usr/share/healthcheck.sh 0755 __USER__:users
zvr-monitor.sh __ZVR_ROOT_PATH__/ssh/zvr-monitor.sh 0755 __USER__:users
zvr-reboot.sh __ZVR_ROOT_PATH__/ssh/zvr-reboot.sh 0755 __USER__:users
file-monitor.sh __ZVR_ROOT_PATH__/ssh/file-monitor.sh 0755 __USER__:users
zstack-virtualrouteragent __BIN_PATH__/zstack-virtualrouteragent 0755 root:root
rsyslog_euler.conf /etc/rsyslog.conf 0644 root:root
rsyslog.haproxy /etc/rsyslog.d/haproxy.conf 0600 root:root
rsyslog.keepalived /etc/rsyslog.d/keepalived.conf 0600 root:root
rsyslog.dhcp /etc/rsyslog.d/dhcp.conf 0600 root:root
lograte.auth /etc/logrotate.d/auth 0600 root:root
lograte.charon /etc/logrotate.d/charon 0600 root:root
lograte.dhcp /etc/logrotate.d/dhcp 0600 root:root
lograte.dnsamsq /etc/logrotate.d/dnsamsq 0600 root:root
lograte.gobetween /etc/logrotate.d/gobetween 0600 root:root
lograte.haproxy /etc/logrotate.d/haproxy 0600 root:root
lograte.keepalived /etc/logrotate.d/keepalived 0600 root:root
lograte.zsn /etc/logrotate.d/zsn 0600 root:root
lograte.zvr /etc/logrotate.d/zvr 0600 root:root
lograte.zvrMonitor /etc/logrotate.d/zvrMonitor 0600 root:root
lograte.zvrstartup /etc/logrotate.d/zvrstartup 0600 root:root

[[X86]]
# this files just for x86_64
# format: [source file] [dst file] [file mode] [file owner]
#
zvr_x86_64 __BIN_PATH__/zvr 0755 __USER__:users
zvrboot_x86_64 __BIN_PATH__/zvrboot 0755 root:root

[[ARM]]
# this files just for aarch64
# format: [source file] [dst file] [file mode] [file owner]
#

[[MIPS]]
# Use for add/sync files just for mips64
# format: [source file] [dst file] [file mode] [file owner]
#

[[LOONG]]
14 changes: 14 additions & 0 deletions data/config/update-zvr.install
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ ipsec.sh __ZVR_ROOT_PATH__/keepalived/temp/ipsec.sh 0755
zsn-crontab.sh /usr/local/zstack/zsn-agent/bin/zsn-crontab.sh 0755 __USER__:users
zstack-virtualrouteragent /etc/init.d/zstack-virtualrouteragent 0755 root:root
zstack-logrotate /etc/logrotate.d/zstack-logrotate 0644 root:root
rsyslog.haproxy /etc/rsyslog.d/haproxy.conf 0600 root:root
rsyslog.keepalived /etc/rsyslog.d/keepalived.conf 0600 root:root
rsyslog.dhcp /etc/rsyslog.d/dhcp.conf 0600 root:root
lograte.auth /etc/logrotate.d/auth 0600 root:root
lograte.charon /etc/logrotate.d/charon 0600 root:root
lograte.dhcp /etc/logrotate.d/dhcp 0600 root:root
lograte.dnsamsq /etc/logrotate.d/dnsamsq 0600 root:root
lograte.gobetween /etc/logrotate.d/gobetween 0600 root:root
lograte.haproxy /etc/logrotate.d/haproxy 0600 root:root
lograte.keepalived /etc/logrotate.d/keepalived 0600 root:root
lograte.zsn /etc/logrotate.d/zsn 0600 root:root
lograte.zvr /etc/logrotate.d/zvr 0600 root:root
lograte.zvrMonitor /etc/logrotate.d/zvrMonitor 0600 root:root
lograte.zvrstartup /etc/logrotate.d/zvrstartup 0600 root:root

[[X86]]
# this files just for x86_64
Expand Down
43 changes: 43 additions & 0 deletions data/config/update-zvr_euler2203.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[[GENERIC]]
# this files for all archs
# format: [source file] [dst file] [file mode] [file owner]
#
sysctl.conf /etc/sysctl.conf 0644 root:root
healthcheck.sh /usr/share/healthcheck.sh 0755 __USER__:users
zvr-monitor.sh __ZVR_ROOT_PATH__/ssh/zvr-monitor.sh 0755 __USER__:users
zvr-reboot.sh __ZVR_ROOT_PATH__/ssh/zvr-reboot.sh 0755 __USER__:users
file-monitor.sh __ZVR_ROOT_PATH__/ssh/file-monitor.sh 0755 __USER__:users
zstack-virtualrouteragent /etc/init.d/zstack-virtualrouteragent 0755 root:root
rsyslog_euler.conf /etc/rsyslog.conf 0644 root:root
rsyslog.haproxy /etc/rsyslog.d/haproxy.conf 0600 root:root
rsyslog.keepalived /etc/rsyslog.d/keepalived.conf 0600 root:root
rsyslog.dhcp /etc/rsyslog.d/dhcp.conf 0600 root:root
lograte.auth /etc/logrotate.d/auth 0600 root:root
lograte.charon /etc/logrotate.d/charon 0600 root:root
lograte.dhcp /etc/logrotate.d/dhcp 0600 root:root
lograte.dnsamsq /etc/logrotate.d/dnsamsq 0600 root:root
lograte.gobetween /etc/logrotate.d/gobetween 0600 root:root
lograte.haproxy /etc/logrotate.d/haproxy 0600 root:root
lograte.keepalived /etc/logrotate.d/keepalived 0600 root:root
lograte.zsn /etc/logrotate.d/zsn 0600 root:root
lograte.zvr /etc/logrotate.d/zvr 0600 root:root
lograte.zvrMonitor /etc/logrotate.d/zvrMonitor 0600 root:root
lograte.zvrstartup /etc/logrotate.d/zvrstartup 0600 root:root

[[X86]]
# this files just for x86_64
# format: [source file] [dst file] [file mode] [file owner]
#
zvr_x86_64 __BIN_PATH__/zvr 0755 __USER__:users

[[ARM]]
# this files just for aarch64
# format: [source file] [dst file] [file mode] [file owner]
#

[[MIPS]]
# Use for add/sync files just for mips64
# format: [source file] [dst file] [file mode] [file owner]
#

[[LOONG]]
8 changes: 8 additions & 0 deletions data/file-lists/lograte.auth
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/auth.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.charon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/charon.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.dhcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/dhcp.log {
size 10240k
rotate 20
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.dnsamsq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/dnsmasq.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.gobetween
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/gobetween*.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.haproxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/haproxy.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.keepalived
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/keepalived.log {
size 10240k
rotate 20
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.zsn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/var/log/zstack/zsn-agent/zsn-agent.log {
size 50M
rotate 10
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.zvr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/home/zstack/zvr/zvr.log {
size 10240k
rotate 40
compress
copytruncate
notifempty
missingok
}
8 changes: 8 additions & 0 deletions data/file-lists/lograte.zvrMonitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/home/zstack/zvr/zvrMonitor.log {
size 10240k
rotate 40
compress
copytruncate
notifempty
missingok
}
9 changes: 9 additions & 0 deletions data/file-lists/lograte.zvrstartup
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/home/zstack/zvr/zvrstartup.log {
size 10240k
daily
rotate 10
compress
copytruncate
notifempty
missingok
}
3 changes: 3 additions & 0 deletions data/file-lists/rsyslog.dhcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ModLoad imudp
$UDPServerRun 514
local3.debug /var/log/dhcp.log
3 changes: 3 additions & 0 deletions data/file-lists/rsyslog.haproxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ModLoad imudp
$UDPServerRun 514
local1.info /var/log/haproxy.log
3 changes: 3 additions & 0 deletions data/file-lists/rsyslog.keepalived
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ModLoad imudp
$UDPServerRun 514
local2.debug /var/log/keepalived.log
1 change: 1 addition & 0 deletions data/file-lists/sysctl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ net.ipv6.conf.all.keep_addr_on_down = 1
net.ipv6.conf.default.keep_addr_on_down = 1
net.ipv6.conf.all.accept_dad = 0
net.ipv6.conf.default.accept_dad = 0
net.ipv6.conf.all.forwarding=1
2 changes: 1 addition & 1 deletion data/file-lists/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.8.0
5.2.0.0
2 changes: 1 addition & 1 deletion data/hooks/00_exec_hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for f in *.sh; do
;;
*)
chmod +x $f
timeout 30 /bin/bash $f >> ${LOG_FILE} 2>&1
timeout 30 /bin/bash -x $f >> ${LOG_FILE} 2>&1
;;
esac
done
Expand Down
9 changes: 9 additions & 0 deletions data/hooks/01_sync_conf_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ fi

ZVR_ROOT_PATH="/home/${USER}/zvr"

OS="vyos 1.1.7"
if [ -f /etc/system-release ]; then
OS=`cat /etc/system-release | awk '{print $1,$2,$3}'`
fi

if [ "${OS}" == "openEuler release 22.03" ]; then
UPDATE_ZVR_FILE="${CONFIG_PATH}/update-zvr_euler2203.install"
fi

sed -i "s%__ZVR_ROOT_PATH__%${ZVR_ROOT_PATH}%g" ${UPDATE_ZVR_FILE}
sed -i "s%__BIN_PATH__%${BIN_PATH}%g" ${UPDATE_ZVR_FILE}
sed -i "s%__USER__%${USER}%g" ${UPDATE_ZVR_FILE}
Expand Down
1 change: 0 additions & 1 deletion data/hooks/hook_function
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ HOOKS_PATH="${DATA_PATH}/hooks"
FILE_LISTS_PATH="${DATA_PATH}/file-lists"

CONFIG_PATH="${DATA_PATH}/config"
BOOTUP_CONFIG_FILE="${CONFIG_PATH}/bootup-config.install"
UPDATE_ZVR_FILE="${CONFIG_PATH}/update-zvr.install"
FLAG_X86="X86"
FLAG_ARM="ARM"
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ tar: clean
cp -f scripts/grub.cfg.5.4.80 $(PKG_TAR_DIR)
cp -f scripts/grub.cfg.3.13 $(PKG_TAR_DIR)
cp -f scripts/vyos-postconfig-bootup.script $(PKG_TAR_DIR)
cp -f scripts/zstack-vrouter-euler2203-bootup $(PKG_TAR_DIR)
tar czf $(PKG_TAR_DIR)/zvr-data.tar.gz -C $(DATA_TAR_DIR) .
rm -rf $(DATA_TAR_DIR)
tar czf $(TARGET_DIR)/zvr.tar.gz -C $(PKG_TAR_DIR) .
Expand Down
Loading

0 comments on commit 46a63a8

Please sign in to comment.