!2 init package

From: @bitcoffee
Reviewed-by: @t_feng
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2021-06-29 02:27:03 +00:00 committed by Gitee
commit d13b7ecc3e
8 changed files with 562 additions and 73 deletions

View File

@ -1,36 +0,0 @@
# cobbler
#### Description
Cobbler is a Linux installation server that allow for rapid setup of network installation environments.
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +0,0 @@
# cobbler
#### 介绍
Cobbler is a Linux installation server that allow for rapid setup of network installation environments.
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

BIN
cobbler-3.2.0.tar.gz Normal file

Binary file not shown.

215
cobbler.spec Normal file
View File

@ -0,0 +1,215 @@
%global tftpboot_dir %{_sharedstatedir}/tftpboot
%global apache_webconfigdir %{_sysconfdir}/httpd/conf.d
%global vendor_lower `echo %{_vendor}|tr 'A-Z' 'a-z'`
Name: cobbler
Version: 3.2.0
Release: 1
Summary: Boot server configurator
URL: https://cobbler.github.io/
License: GPLv2+
Source0: https://github.com/cobbler/cobbler/archive/v%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
Patch9000: huawei-adapt-vendor.patch
Patch9001: huawei-repair-switch-condition-error.patch
Patch6000: fix-Give-root-RW-permissions-to-var-lib-cobbler-web.ss.patch
BuildRequires: system-release
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-coverage
BuildRequires: python%{python3_pkgversion}-distro
BuildRequires: python%{python3_pkgversion}-future
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-netaddr
BuildRequires: python%{python3_pkgversion}-cheetah
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-yaml
BuildRequires: python%{python3_pkgversion}-simplejson
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: httpd
Requires: tftp-server
Requires: createrepo
Requires: file
Requires: rsync
Requires: xorriso
Requires: dnf-plugins-core
Requires: /sbin/service
Requires: python%{python3_pkgversion}-cheetah
Requires: python%{python3_pkgversion}-dns
Requires: python%{python3_pkgversion}-future
Requires: python%{python3_pkgversion}-mod_wsgi
Requires: python%{python3_pkgversion}-netaddr
Requires: python%{python3_pkgversion}-yaml
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-simplejson
Requires: python%{python3_pkgversion}-tornado
Requires: python%{python3_pkgversion}-distro
Requires: python%{python3_pkgversion}-ldap3
Requires: genisoimage
Recommends: bash-completion
Recommends: syslinux
Recommends: grub2-efi-x64
Recommends: grub2-efi-aa64
Recommends: logrotate
Obsoletes: cobbler-nsupdate < 3.0.99
Provides: cobbler-nsupdate = %{version}-%{release}
%description
Cobbler is a network install server. Cobbler supports PXE, ISO virtualized installs, and re-installing existing Linux
machines. The last two modes use a helper tool, 'koan', that integrates with cobbler. Cobbler's advanced features
include importing distributions from DVDs and rsync mirrors, kickstart templating, integrated yum mirroring, and
built-in DHCP/DNS Management. Cobbler has a XML-RPC API for integration with other applications.
%package -n cobbler-web
Summary: Web interface for Cobbler
Requires: cobbler = %{version}-%{release}
Requires: python%{python3_pkgversion}-django
Requires: python%{python3_pkgversion}-mod_wsgi
Requires: mod_ssl
Requires(post): coreutils
Requires(post): sed
%description -n cobbler-web
Web interface for Cobbler that allows visiting
http://server/cobbler_web to configure the install server.
%prep
%autosetup -p1
sed -i "s/generic_os/%{_vendor}/g" distro_build_configs.sh
sed -i "s/generic_os/%{_vendor}/g" config/cobbler/distro_signatures.json
sed -i "s/generic_lower_os/%{vendor_lower}/g" cobbler/actions/check.py
sed -i "s/generic_lower_os/%{vendor_lower}/g" cobbler/utils.py
sed -i "s/generic_lower_os/%{vendor_lower}/g" config/cobbler/distro_signatures.json
sed -i "s/generic_lower_os/%{vendor_lower}/g" cobbler/tftpgen.py
sed -i "s/generic_lower_os/%{vendor_lower}/g" cobbler/autoinstallgen.py
sed -i "s/generic_lower_os/%{vendor_lower}/g" cobbler/actions/buildiso.py
%build
. ./distro_build_configs.sh
# Check distro specific variables for consistency
[ "${DOCPATH}" != %{_mandir} ] && echo "ERROR: DOCPATH: ${DOCPATH} does not match %{_mandir}"
# [ "${ETCPATH}" != "/etc/cobbler" ]
# [ "${LIBPATH}" != "/var/lib/cobbler" ]
[ "${LOGPATH}" != %{_localstatedir}/log ] && echo "ERROR: LOGPATH: ${LOGPATH} does not match %{_localstatedir}/log"
[ "${COMPLETION_PATH}" != %{_datadir}/bash-completion/completions ] && \
echo "ERROR: COMPLETION: ${COMPLETION_PATH} does not match %{_datadir}/bash-completion/completions"
[ "${WEBROOT}" != %{apache_dir} ] && echo "ERROR: WEBROOT: ${WEBROOT} does not match %{apache_dir}"
[ "${WEBCONFIG}" != %{apache_webconfigdir} ] && echo "ERROR: WEBCONFIG: ${WEBCONFIG} does not match %{apache_webconfigdir}"
[ "${TFTPROOT}" != %{tftpboot_dir} ] && echo "ERROR: TFTPROOT: ${TFTPROOT} does not match %{tftpboot_dir}"
%py3_build
%install
. ./distro_build_configs.sh
%py3_install
# cobbler
rm %{buildroot}%{_sysconfdir}/cobbler/cobbler.conf
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
mv %{buildroot}%{_sysconfdir}/cobbler/cobblerd_rotate %{buildroot}%{_sysconfdir}/logrotate.d/cobblerd
# Create data directories in tftpboot_dir
mkdir -p %{buildroot}%{tftpboot_dir}/{boot,etc,grub/system{,_link},images{,2},ppc,pxelinux.cfg,s390x}
# systemd
mkdir -p %{buildroot}%{_unitdir}
mv %{buildroot}%{_sysconfdir}/cobbler/cobblerd.service %{buildroot}%{_unitdir}
# cobbler-web
rm %{buildroot}%{_sysconfdir}/cobbler/cobbler_web.conf
# ghosted files
touch %{buildroot}%{_sharedstatedir}/cobbler/web.ss
# rm test file
rm -rf %{buildroot}%{_datarootdir}/cobbler/tests
%pre
if [ $1 -ge 2 ]; then
# package upgrade: backup configuration
DATE=$(date "+%%Y%%m%%d-%%H%%M%%S")
if [ ! -d "%{_sharedstatedir}/cobbler/backup/upgrade-${DATE}" ]; then
mkdir -p "%{_sharedstatedir}/cobbler/backup/upgrade-${DATE}"
fi
for i in "config" "snippets" "templates" "triggers" "scripts"; do
if [ -d "%{_sharedstatedir}/cobbler/${i}" ]; then
cp -r "%{_sharedstatedir}/cobbler/${i}" "%{_sharedstatedir}/cobbler/backup/upgrade-${DATE}"
fi
done
if [ -d %{_sysconfdir}/cobbler ]; then
cp -r %{_sysconfdir}/cobbler "%{_sharedstatedir}/cobbler/backup/upgrade-${DATE}"
fi
fi
%post
%systemd_post cobblerd.service
%preun
%systemd_preun cobblerd.service
%postun
%systemd_postun_with_restart cobblerd.service
%post -n cobbler-web
# Change the SECRET_KEY option in the Django settings.py file
# required for security reasons, should be unique on all systems
# Choose from letters and numbers only, so no special chars like ampersand (&).
RAND_SECRET=$(head /dev/urandom | tr -dc 'A-Za-z0-9!' | head -c 50; echo '')
sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" %{_datadir}/cobbler/web/settings.py
%files
%license COPYING
%doc AUTHORS.in README.md
%doc docs/developer-guide.rst docs/quickstart-guide.rst docs/installation-guide.rst
%config(noreplace) %{_sysconfdir}/cobbler
%config(noreplace) %{_sysconfdir}/logrotate.d/cobblerd
%config(noreplace) %{apache_webconfigdir}/cobbler.conf
%{_bindir}/cobbler
%{_bindir}/cobbler-ext-nodes
%{_bindir}/cobblerd
%{_sbindir}/tftpd.py
%{_sbindir}/fence_ipmitool
%{_datadir}/bash-completion/
%dir %{_datadir}/cobbler
%{_datadir}/cobbler/bin
%{_mandir}/man1/cobbler.1*
%{_mandir}/man5/cobbler.conf.5*
%{_mandir}/man8/cobblerd.8*
%{python3_sitelib}/cobbler/
%{python3_sitelib}/cobbler-*.egg-info
%{_unitdir}/cobblerd.service
%{tftpboot_dir}/*
/var/www/cobbler
%config(noreplace) %{_sharedstatedir}/cobbler
%exclude %{_sharedstatedir}/cobbler/web.ss
%exclude %{_sharedstatedir}/cobbler/webui_sessions
%{_localstatedir}/log/cobbler
%files -n cobbler-web
%license COPYING
%doc AUTHORS.in README.md
%config(noreplace) %{apache_webconfigdir}/cobbler_web.conf
%attr(-,apache,apache) %{_datadir}/cobbler/web
%ghost %attr(0660,apache,root) %{_sharedstatedir}/cobbler/web.ss
%dir %attr(700,apache,root) %{_sharedstatedir}/cobbler/webui_sessions
%attr(-,apache,apache) /var/www/cobbler_webui_content/
%changelog
* Sat May 29 2021 liuxin <liuxin264@huawei.com> - 3.2.0 - 1
- Package init

4
cobbler.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: cobbler/cobbler
tag_prefix: v
separator: .

View File

@ -0,0 +1,25 @@
From d63ed9f9712bfbdc9b36e2f3dc94bc8bb4ba0a80 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@nwra.com>
Date: Sun, 25 Oct 2020 11:43:25 -0600
Subject: [PATCH] Give root RW permissions to /var/lib/cobbler/web.ss
---
cobbler/cobblerd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cobbler/cobblerd.py b/cobbler/cobblerd.py
index fe1cf88..34aedf9 100644
--- a/cobbler/cobblerd.py
+++ b/cobbler/cobblerd.py
@@ -57,7 +57,7 @@ def regen_ss_file():
data = fd.read(512)
fd.close()
- fd = os.open(ssfile, os.O_CREAT | os.O_RDWR, 0o600)
+ fd = os.open(ssfile, os.O_CREAT | os.O_RDWR, 0o660)
os.write(fd, binascii.hexlify(data))
os.close(fd)
--
2.30.0

287
huawei-adapt-vendor.patch Normal file
View File

@ -0,0 +1,287 @@
From 39793327e0f859dc613f9ff69e3f91e6a7be086c Mon Sep 17 00:00:00 2001
From: bitcoffee <liuxin264@huawei.com>
Date: Tue, 29 Jun 2021 00:43:34 +0800
Subject: [PATCH] adapt vendor
---
cobbler/actions/buildiso.py | 22 ++++++++++-----------
cobbler/actions/check.py | 2 +-
cobbler/actions/reposync.py | 2 +-
cobbler/autoinstallgen.py | 2 +-
cobbler/tftpgen.py | 2 +-
cobbler/utils.py | 3 +++
config/cobbler/distro_signatures.json | 28 +++++++++++++++++++++++++++
distro_build_configs.sh | 5 ++++-
templates/etc/dhcp.template | 10 +++++-----
9 files changed, 55 insertions(+), 21 deletions(-)
diff --git a/cobbler/actions/buildiso.py b/cobbler/actions/buildiso.py
index 9500086..be42749 100644
--- a/cobbler/actions/buildiso.py
+++ b/cobbler/actions/buildiso.py
@@ -228,7 +228,7 @@ class BuildIso(object):
else:
append_line += " autoyast=%s" % data["autoinstall"]
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if "proxy" in data and data["proxy"] != "":
append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
append_line += " ks=%s" % data["autoinstall"]
@@ -278,7 +278,7 @@ class BuildIso(object):
else:
append_line += " autoyast=%s" % data["autoinstall"]
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if "proxy" in data and data["proxy"] != "":
append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
append_line += " ks=%s" % data["autoinstall"]
@@ -314,7 +314,7 @@ class BuildIso(object):
my_mask = None
my_gw = None
my_dns = None
- if dist.breed in ["suse", "redhat"]:
+ if dist.breed in ["suse", "redhat", "generic_lower_os"]:
if "netmask" in data["kernel_options"] and data["kernel_options"]["netmask"] != "":
my_mask = data["kernel_options"]["netmask"]
del data["kernel_options"]["netmask"]
@@ -322,7 +322,7 @@ class BuildIso(object):
my_gw = data["kernel_options"]["gateway"]
del data["kernel_options"]["gateway"]
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if "ksdevice" in data["kernel_options"] and data["kernel_options"]["ksdevice"] != "":
my_int = data["kernel_options"]["ksdevice"]
if my_int == "bootif":
@@ -424,7 +424,7 @@ class BuildIso(object):
append_line += " netdevice=%s" % data["mac_address_" + my_int].lower()
else:
append_line += " netdevice=%s" % my_int
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if intmac in data and data[intmac] != "":
append_line += " ksdevice=%s" % data["mac_address_" + my_int]
else:
@@ -435,19 +435,19 @@ class BuildIso(object):
if my_ip is not None:
if dist.breed == "suse":
append_line += " hostip=%s" % my_ip
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
append_line += " ip=%s" % my_ip
if dist.breed in ["ubuntu", "debian"]:
append_line += " netcfg/get_ipaddress=%s" % my_ip
if my_mask is not None:
- if dist.breed in ["suse", "redhat"]:
+ if dist.breed in ["suse", "redhat", "generic_lower_os"]:
append_line += " netmask=%s" % my_mask
if dist.breed in ["ubuntu", "debian"]:
append_line += " netcfg/get_netmask=%s" % my_mask
if my_gw is not None:
- if dist.breed in ["suse", "redhat"]:
+ if dist.breed in ["suse", "redhat", "generic_lower_os"]:
append_line += " gateway=%s" % my_gw
if dist.breed in ["ubuntu", "debian"]:
append_line += " netcfg/get_gateway=%s" % my_gw
@@ -458,7 +458,7 @@ class BuildIso(object):
append_line += " nameserver=%s" % ",".join(my_dns)
else:
append_line += " nameserver=%s" % my_dns
- if dist.breed == "redhat":
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if type(my_dns) == list:
append_line += " dns=%s" % ",".join(my_dns)
else:
@@ -548,7 +548,7 @@ class BuildIso(object):
cfg.write(" kernel %s\n" % os.path.basename(distro.kernel))
append_line = " append initrd=%s" % os.path.basename(distro.initrd)
- if distro.breed == "redhat":
+ if distro.breed == "redhat" or distro.breed == "generic_lower_os":
append_line += " ks=cdrom:/isolinux/%s.cfg" % descendant.name
if distro.breed == "suse":
append_line += " autoyast=file:///isolinux/%s.cfg install=cdrom:///" % descendant.name
@@ -566,7 +566,7 @@ class BuildIso(object):
elif descendant.COLLECTION_TYPE == 'system':
autoinstall_data = self.api.autoinstallgen.generate_autoinstall_for_system(descendant.name)
- if distro.breed == "redhat":
+ if distro.breed == "redhat" or distro.breed == "generic_lower_os":
cdregex = re.compile(r"^\s*url .*\n", re.IGNORECASE | re.MULTILINE)
autoinstall_data = cdregex.sub("cdrom\n", autoinstall_data, count=1)
diff --git a/cobbler/actions/check.py b/cobbler/actions/check.py
index 319c03f..9ae8831 100644
--- a/cobbler/actions/check.py
+++ b/cobbler/actions/check.py
@@ -139,7 +139,7 @@ class CobblerCheck(object):
if notes != "":
notes = " (NOTE: %s)" % notes
rc = 0
- if self.checked_family in ("redhat", "suse"):
+ if self.checked_family in ("redhat", "suse", "generic_lower_os"):
if os.path.exists("/etc/rc.d/init.d/%s" % which):
rc = utils.subprocess_call(self.logger, "/sbin/service %s status > /dev/null 2>/dev/null" % which, shell=True)
if rc != 0:
diff --git a/cobbler/actions/reposync.py b/cobbler/actions/reposync.py
index fb2ac5c..6b4ff70 100644
--- a/cobbler/actions/reposync.py
+++ b/cobbler/actions/reposync.py
@@ -275,7 +275,7 @@ class RepoSync(object):
mdoptions.append("-g %s" % groupmdfile)
if "prestodelta" in rd:
# need createrepo >= 0.9.7 to add deltas
- if utils.get_family() in ("redhat", "suse"):
+ if utils.get_family() in ("redhat", "suse", "generic_lower_os"):
cmd = "/usr/bin/rpmquery --queryformat=%{VERSION} createrepo"
createrepo_ver = utils.subprocess_get(self.logger, cmd)
if not createrepo_ver[0:1].isdigit():
diff --git a/cobbler/autoinstallgen.py b/cobbler/autoinstallgen.py
index 2f38a40..ec1aac5 100644
--- a/cobbler/autoinstallgen.py
+++ b/cobbler/autoinstallgen.py
@@ -314,7 +314,7 @@ class AutoInstallationGen(object):
meta.update(autoinstall_meta)
# add package repositories metadata to autoinstall metavariables
- if distro.breed == "redhat":
+ if distro.breed == "redhat" or distro.breed == "generic_lower_os":
meta["yum_repo_stanza"] = self.generate_repo_stanza(obj, (system is None))
meta["yum_config_stanza"] = self.generate_config_stanza(obj, (system is None))
# FIXME: implement something similar to zypper (SUSE based distros) and apt (Debian based distros)
diff --git a/cobbler/tftpgen.py b/cobbler/tftpgen.py
index 5c5b1ef..bf0f347 100644
--- a/cobbler/tftpgen.py
+++ b/cobbler/tftpgen.py
@@ -727,7 +727,7 @@ class TFTPGen(object):
else:
autoinstall_path = "http://%s/cblr/svc/op/autoinstall/profile/%s" % (httpserveraddress, profile.name)
- if distro.breed is None or distro.breed == "redhat":
+ if distro.breed is None or distro.breed == "redhat" or distro.breed == "generic_lower_os":
append_line += " kssendmac"
append_line = "%s ks=%s" % (append_line, autoinstall_path)
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 44a7016..8e46e47 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -1056,6 +1056,9 @@ def os_release():
make = "unknown"
return make, float(distro_version)
+ elif family == "generic_lower_os":
+ return "generic_lower_os", float(distro_version)
+
def is_safe_to_hardlink(src, dst, api):
"""
diff --git a/config/cobbler/distro_signatures.json b/config/cobbler/distro_signatures.json
index b1d073c..773e9f2 100644
--- a/config/cobbler/distro_signatures.json
+++ b/config/cobbler/distro_signatures.json
@@ -1,5 +1,33 @@
{
"breeds": {
+ "generic_lower_os": {
+ "generic_lower_os": {
+ "signatures": [
+ "Packages"
+ ],
+ "version_file": "generic_os-release-(.*).rpm",
+ "version_file_regex": null,
+ "kernel_arch": "kernel-(.*).rpm",
+ "kernel_arch_regex": null,
+ "supported_arches": [
+ "aarch64",
+ "x86_64"
+ ],
+ "supported_repo_breeds": [
+ "rsync",
+ "rhn",
+ "yum"
+ ],
+ "kernel_file": "vmlinuz(.*)",
+ "initrd_file": "initrd(.*)\\.img",
+ "isolinux_ok": true,
+ "default_autoinstall": "sample.ks",
+ "kernel_options": "repo=$tree",
+ "kernel_options_post": "",
+ "boot_files": [],
+ "boot_loaders": {}
+ }
+ },
"redhat": {
"rhel4": {
"signatures": [
diff --git a/distro_build_configs.sh b/distro_build_configs.sh
index bad43e3..ef48836 100644
--- a/distro_build_configs.sh
+++ b/distro_build_configs.sh
@@ -30,6 +30,9 @@ if [ "$DISTRO" = "" ] && [ -r /etc/os-release ];then
ubuntu*|debian*)
DISTRO="UBUNTU"
;;
+ generic_os*)
+ DISTRO=`echo 'generic_os'|tr 'a-z' 'A-Z'`
+ ;;
esac
fi
@@ -42,7 +45,7 @@ elif [ "$DISTRO" = "UBUNTU" ];then
export WEBROOT="/var/www";
export WEBCONFIG="/etc/apache2/conf-available";
export DEFAULTPATH="etc/default"
-elif [ "$DISTRO" = "FEDORA" ];then
+elif [ "$DISTRO" = "FEDORA" ] || [ "$DISTRO" = `echo 'generic_os'|tr 'a-z' 'A-Z'` ];then
export APACHE_USER="apache"
export APACHE_GROUP="apache"
diff --git a/templates/etc/dhcp.template b/templates/etc/dhcp.template
index e450419..e8a2b91 100644
--- a/templates/etc/dhcp.template
+++ b/templates/etc/dhcp.template
@@ -33,7 +33,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
# Legacy
if option system-arch = 00:00 {
- filename "grub/grub.0";
+ filename "pxelinux.0";
}
# UEFI-32-1
if option system-arch = 00:06 {
@@ -47,15 +47,15 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
}
# UEFI-64-1
else if option system-arch = 00:07 {
- filename "grub/grubx64.efi";
+ filename "grubx64.efi";
}
# UEFI-64-2
else if option system-arch = 00:08 {
- filename "grub/grubx64.efi";
+ filename "grubx64.efi";
}
# UEFI-64-3
else if option system-arch = 00:09 {
- filename "grub/grubx64.efi";
+ filename "grubx64.efi";
}
# armv7 (aka arm 32 bit)
else if option system-arch = 00:0a {
@@ -63,7 +63,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
}
# aarch64 (aka arm 64 bit)
else if option system-arch = 00:0b {
- filename "grub/grubaa64.efi";
+ filename "grubaa64.efi";
}
# RiskV 32 bit
else if option system-arch = 00:25 {
--
2.30.0

View File

@ -0,0 +1,31 @@
From 23087fd58b8f7b62c35dcaaae0e7db7713a8172e Mon Sep 17 00:00:00 2001
From: bitcoffee <liuxin264@huawei.com>
Date: Tue, 29 Jun 2021 00:44:49 +0800
Subject: [PATCH] repair switch condition error
---
templates/etc/dhcp.template | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/etc/dhcp.template b/templates/etc/dhcp.template
index e8a2b91..cc3cfb1 100644
--- a/templates/etc/dhcp.template
+++ b/templates/etc/dhcp.template
@@ -36,12 +36,12 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
filename "pxelinux.0";
}
# UEFI-32-1
- if option system-arch = 00:06 {
+ else if option system-arch = 00:06 {
# Not supported, no 32 bit UEFI grub executable
filename "unsupported";
}
# UEFI-32-2
- if option system-arch = 00:02 {
+ else if option system-arch = 00:02 {
# Not supported, no 32 bit UEFI grub executable
filename "unsupported";
}
--
2.30.0