Compare commits

..

No commits in common. "3796135c0dbc100edfc28bac98c380888e1cabef" and "d13b7ecc3e33f0c79e07aa67d137630762f7f9cb" have entirely different histories.

6 changed files with 91 additions and 202 deletions

View File

@ -1,100 +0,0 @@
From 8a94846b133f12c71f515b0fbaa834b37dd00347 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Wed, 17 May 2023 13:33:37 +0100
Subject: [PATCH] Fix package building with Sphinx >= 7.0.0
Sphinx has dropped the integration with setuptools in version 7.0.0:
https://www.sphinx-doc.org/en/master/changes.html#release-7-0-0-released-apr-29-2023
We now build documentation and man pages out of setup.py script
---
Makefile | 3 +++
cobbler.spec | 1 +
setup.py | 22 +---------------------
3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index 1174062..541865c 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,9 @@ doc: ## Creates the documentation with sphinx in html form.
@echo "creating: documentation"
@cd docs; make html > /dev/null 2>&1
+man: ## Creates documentation and man pages using Sphinx
+ @${PYTHON} -m sphinx -b man -j auto ./docs ./build/sphinx/man
+
qa: ## If pyflakes and/or pycodestyle is found then they are run.
ifeq ($(strip $(PYFLAKES)),)
@echo "No pyflakes found"
diff --git a/cobbler.spec b/cobbler.spec
index 1235917..e4c482b 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -307,6 +307,7 @@ echo "ERROR: DOCPATH: ${DOCPATH} does not match %{_mandir}"
[ "${TFTPROOT}" != %{tftpboot_dir} ] && echo "ERROR: TFTPROOT: ${TFTPROOT} does not match %{tftpboot_dir}"
%py3_build
+make man
%install
. distro_build_configs.sh
diff --git a/setup.py b/setup.py
index 57d8543..595ffd0 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,6 @@ from setuptools import dep_util
from distutils.command.build import build as _build
from configparser import ConfigParser
from setuptools import find_packages
-from sphinx.setup_command import BuildDoc
import codecs
from coverage import Coverage
@@ -143,15 +142,6 @@ class build(_build):
def run(self):
_build.run(self)
-#####################################################################
-# # Build man pages using Sphinx ###################################
-#####################################################################
-
-
-class build_man(BuildDoc):
- def initialize_options(self):
- BuildDoc.initialize_options(self)
- self.builder = 'man'
#####################################################################
# # Configure files ##################################################
@@ -279,16 +269,7 @@ def has_configure_files(build):
return bool(build.distribution.configure_files)
-def has_man_pages(build):
- """Check if the distribution has configuration files to work on."""
- return bool(build.distribution.man_pages)
-
-
-build.sub_commands.extend((
- ('build_man', has_man_pages),
- ('build_cfg', has_configure_files)
-))
-
+build.sub_commands.extend((("build_cfg", has_configure_files),))
#####################################################################
# # Modify Install Stage ############################################
@@ -490,7 +471,6 @@ if __name__ == "__main__":
'savestate': savestate,
'restorestate': restorestate,
'build_cfg': build_cfg,
- 'build_man': build_man
},
name="cobbler",
version=VERSION,
--
2.27.0

BIN
cobbler-3.2.0.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -3,8 +3,8 @@
%global vendor_lower `echo %{_vendor}|tr 'A-Z' 'a-z'`
Name: cobbler
Version: 3.2.3
Release: 2
Version: 3.2.0
Release: 1
Summary: Boot server configurator
URL: https://cobbler.github.io/
License: GPLv2+
@ -13,8 +13,7 @@ BuildArch: noarch
Patch9000: huawei-adapt-vendor.patch
Patch9001: huawei-repair-switch-condition-error.patch
Patch6001: backport-Fix-package-building-with-Sphinx.patch
Patch6000: fix-Give-root-RW-permissions-to-var-lib-cobbler-web.ss.patch
BuildRequires: system-release
BuildRequires: python%{python3_pkgversion}-devel
@ -53,8 +52,7 @@ Requires: python%{python3_pkgversion}-simplejson
Requires: python%{python3_pkgversion}-tornado
Requires: python%{python3_pkgversion}-distro
Requires: python%{python3_pkgversion}-ldap3
Requires: genisoimage
Requires: cobbler-web = %{version}-%{release}
Requires: genisoimage
Recommends: bash-completion
Recommends: syslinux
@ -184,9 +182,13 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" %{_datadir}/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
@ -207,43 +209,7 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" %{_datadir}/cobbler
%attr(-,apache,apache) /var/www/cobbler_webui_content/
%changelog
* Wed Apr 23 2025 sunhai <sunhai10@huawei.com> - 3.2.3-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix start cobbler failed
* Tue Apr 22 2025 sunhai <sunhai10@huawei.com> - 3.2.3-1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:update to 3.2.3
* Wed Nov 20 2024 wangshuo <wangshuo@kylinos.cn> - 3.2.0-5
- Type:CVE
- ID:CVE-2024-47533
- SUG:NA
- DESC:Add Patch6002, fix CVE-2024-47533
* Fri Aug 11 2023 zhangpan <zhangpan103@h-partners.com> - 3.2.0-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix build fail
* Thu Mar 09 2023 sunhai <sunhai10@huawei.com> - 3.2.0-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Change permission with web.ss
* Tue Feb 28 2023 sunhai <sunhai10@huawei.com> - 3.2.0-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: add install depend
* Sat May 29 2021 liuxin <liuxin264@huawei.com> - 3.2.0-1
* Sat May 29 2021 liuxin <liuxin264@huawei.com> - 3.2.0 - 1
- Package init

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

View File

@ -1,6 +1,6 @@
From 704be6fc9efd009c8f1da9abdb626e7fb18c86bb Mon Sep 17 00:00:00 2001
From: sun_hai_10 <sunhai10@huawei.com>
Date: Fri, 28 Mar 2025 01:51:43 +0800
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
---
@ -9,17 +9,17 @@ Subject: [PATCH] adapt vendor
cobbler/actions/reposync.py | 2 +-
cobbler/autoinstallgen.py | 2 +-
cobbler/tftpgen.py | 2 +-
cobbler/utils.py | 4 +++-
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(+), 22 deletions(-)
9 files changed, 55 insertions(+), 21 deletions(-)
diff --git a/cobbler/actions/buildiso.py b/cobbler/actions/buildiso.py
index f1be922..e469535 100644
index 9500086..be42749 100644
--- a/cobbler/actions/buildiso.py
+++ b/cobbler/actions/buildiso.py
@@ -220,7 +220,7 @@ class BuildIso:
@@ -228,7 +228,7 @@ class BuildIso(object):
else:
append_line += " autoyast=%s" % data["autoinstall"]
@ -27,8 +27,8 @@ index f1be922..e469535 100644
+ 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"])
if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
@@ -273,7 +273,7 @@ class BuildIso:
append_line += " ks=%s" % data["autoinstall"]
@@ -278,7 +278,7 @@ class BuildIso(object):
else:
append_line += " autoyast=%s" % data["autoinstall"]
@ -36,8 +36,8 @@ index f1be922..e469535 100644
+ 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"])
if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
@@ -312,7 +312,7 @@ class BuildIso:
append_line += " ks=%s" % data["autoinstall"]
@@ -314,7 +314,7 @@ class BuildIso(object):
my_mask = None
my_gw = None
my_dns = None
@ -46,7 +46,7 @@ index f1be922..e469535 100644
if "netmask" in data["kernel_options"] and data["kernel_options"]["netmask"] != "":
my_mask = data["kernel_options"]["netmask"]
del data["kernel_options"]["netmask"]
@@ -320,7 +320,7 @@ class BuildIso:
@@ -322,7 +322,7 @@ class BuildIso(object):
my_gw = data["kernel_options"]["gateway"]
del data["kernel_options"]["gateway"]
@ -55,7 +55,7 @@ index f1be922..e469535 100644
if "ksdevice" in data["kernel_options"] and data["kernel_options"]["ksdevice"] != "":
my_int = data["kernel_options"]["ksdevice"]
if my_int == "bootif":
@@ -422,7 +422,7 @@ class BuildIso:
@@ -424,7 +424,7 @@ class BuildIso(object):
append_line += " netdevice=%s" % data["mac_address_" + my_int].lower()
else:
append_line += " netdevice=%s" % my_int
@ -64,7 +64,7 @@ index f1be922..e469535 100644
if intmac in data and data[intmac] != "":
append_line += " ksdevice=%s" % data["mac_address_" + my_int]
else:
@@ -433,19 +433,19 @@ class BuildIso:
@@ -435,19 +435,19 @@ class BuildIso(object):
if my_ip is not None:
if dist.breed == "suse":
append_line += " hostip=%s" % my_ip
@ -87,7 +87,7 @@ index f1be922..e469535 100644
append_line += " gateway=%s" % my_gw
if dist.breed in ["ubuntu", "debian"]:
append_line += " netcfg/get_gateway=%s" % my_gw
@@ -456,7 +456,7 @@ class BuildIso:
@@ -458,7 +458,7 @@ class BuildIso(object):
append_line += " nameserver=%s" % ",".join(my_dns)
else:
append_line += " nameserver=%s" % my_dns
@ -96,55 +96,55 @@ index f1be922..e469535 100644
if type(my_dns) == list:
append_line += " dns=%s" % ",".join(my_dns)
else:
@@ -545,7 +545,7 @@ class BuildIso:
@@ -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 dist.breed == "generic_lower_os":
if distro.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
append_line += " ks=cdrom:/isolinux/%s.cfg" % descendant.name
else:
@@ -566,7 +566,7 @@ class BuildIso:
+ 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 dist.breed == "generic_lower_os":
+ 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 4fadab5..4893bf9 100644
index 319c03f..9ae8831 100644
--- a/cobbler/actions/check.py
+++ b/cobbler/actions/check.py
@@ -138,7 +138,7 @@ class CobblerCheck:
@@ -139,7 +139,7 @@ class CobblerCheck(object):
if notes != "":
notes = " (NOTE: %s)" % notes
return_code = 0
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):
return_code = utils.subprocess_call(self.logger,
"/sbin/service %s status > /dev/null 2>/dev/null" % 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 651514f..ddee79c 100644
index fb2ac5c..6b4ff70 100644
--- a/cobbler/actions/reposync.py
+++ b/cobbler/actions/reposync.py
@@ -257,7 +257,7 @@ class RepoSync:
mdoptions.append("-g %s" % os.path.join(origin_path, groupmdfile))
if "prestodelta" in rd:
# need createrepo >= 0.9.7 to add deltas
- if utils.get_family() in ("redhat", "suse"):
@@ -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():
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 d8532ca..0486bf8 100644
index 2f38a40..ec1aac5 100644
--- a/cobbler/autoinstallgen.py
+++ b/cobbler/autoinstallgen.py
@@ -312,7 +312,7 @@ class AutoInstallationGen:
@@ -314,7 +314,7 @@ class AutoInstallationGen(object):
meta.update(autoinstall_meta)
# add package repositories metadata to autoinstall metavariables
@ -154,36 +154,34 @@ index d8532ca..0486bf8 100644
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 087d8c0..5e10636 100644
index 5c5b1ef..bf0f347 100644
--- a/cobbler/tftpgen.py
+++ b/cobbler/tftpgen.py
@@ -746,7 +746,7 @@ class TFTPGen:
autoinstall_path = "http://%s/cblr/svc/op/autoinstall/profile/%s" \
% (httpserveraddress, profile.name)
@@ -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":
if distro.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
append_line += " kssendmac ks=%s" % autoinstall_path
append_line += " kssendmac"
append_line = "%s ks=%s" % (append_line, autoinstall_path)
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 98663a5..7475a27 100644
index 44a7016..8e46e47 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -1017,8 +1017,10 @@ def os_release():
make = "suse"
if "suse" not in distro.like():
@@ -1056,6 +1056,9 @@ def os_release():
make = "unknown"
- return make, float(distro_version)
+ return make, float(distro_versioni)
return make, float(distro_version)
+ elif family == "generic_lower_os":
+ return "generic_lower_os", float(distro_version)
+
def is_safe_to_hardlink(src: str, dst: str, api) -> bool:
def is_safe_to_hardlink(src, dst, api):
"""
diff --git a/config/cobbler/distro_signatures.json b/config/cobbler/distro_signatures.json
index 6d2c04b..804f735 100644
index b1d073c..773e9f2 100644
--- a/config/cobbler/distro_signatures.json
+++ b/config/cobbler/distro_signatures.json
@@ -1,5 +1,33 @@
@ -221,7 +219,7 @@ index 6d2c04b..804f735 100644
"rhel4": {
"signatures": [
diff --git a/distro_build_configs.sh b/distro_build_configs.sh
index 31ee5ce..19fc711 100644
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
@ -234,17 +232,17 @@ index 31ee5ce..19fc711 100644
esac
fi
@@ -43,7 +46,7 @@ elif [ "$DISTRO" = "UBUNTU" ];then
export WEBROOT="/var/www"
export WEBCONFIG="/etc/apache2/conf-available"
@@ -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 HTTP_USER=$APACHE_USER # overrule setup.py
export APACHE_GROUP="apache"
diff --git a/templates/etc/dhcp.template b/templates/etc/dhcp.template
index a24f903..68ebe8a 100644
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 {
@ -285,5 +283,5 @@ index a24f903..68ebe8a 100644
# RiskV 32 bit
else if option system-arch = 00:25 {
--
2.43.0
2.30.0