Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
48f3c7924e
!42 Modify release file name due to release package name change
From: @ccdxx 
Reviewed-by: @zhuchunyi 
Signed-off-by: @zhuchunyi
2023-12-06 06:05:00 +00:00
chendexi
64e97d3898 Modify release file name due to release package name change 2023-11-30 09:35:31 +08:00
openeuler-ci-bot
be89facda2
!39 fix cannot detect package manager on NestOS
From: @jianli-97 
Reviewed-by: @zhuchunyi 
Signed-off-by: @zhuchunyi
2023-10-23 01:48:46 +00:00
jianli-97
7e62b59d45 fix cannot detect package manager on NestOS 2023-10-16 14:45:11 +08:00
openeuler-ci-bot
dcb5f49a2d
!36 [sync] PR-35: add loongarch64 and sw_64 support,add kylinsecos support
From: @openeuler-sync-bot 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-09-21 12:33:19 +00:00
yeqinglong
4a7fe573c1 add loongarch64 and sw_64 support,add kylinsecos support
(cherry picked from commit a53b535ec5e2f3d2842011527131edc0ba9502f0)
2023-09-21 14:34:50 +08:00
openeuler-ci-bot
81c42c88c6
!33 [sync] PR-32: fix supermin: failure: ext2fs_namei: parent directory not found and adapted hce and remove unuse kernel
From: @openeuler-sync-bot 
Reviewed-by: @gitee-cmd 
Signed-off-by: @gitee-cmd
2022-12-13 06:20:31 +00:00
cherry530
c9e0364c57 adapted hce and remove unuse buildrequires kernel
and fix supermin: failure: ext2fs_namei: parent directory not found

Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit 5c2b2ac6c9b8f1d5772feda8f44f8167afe63f21)
2022-12-12 18:23:15 +08:00
openeuler-ci-bot
3ec125ad43
!29 提高软件包兼容性
From: @lyn1001 
Reviewed-by: @gitee-cmd 
Signed-off-by: @gitee-cmd
2022-11-18 09:48:08 +00:00
lyn1001
7844eda654 Replace openEuler with vendor 2022-11-18 15:08:05 +08:00
9 changed files with 321 additions and 4 deletions

View File

@ -0,0 +1,36 @@
From 373ce3be8c1fc0835746eca91a4a2f8176df7203 Mon Sep 17 00:00:00 2001
From: jianli-97 <lijian2@kylinos.cn>
Date: Mon, 16 Oct 2023 14:40:48 +0800
Subject: [PATCH] fix cannot detect package manager on NestOS
---
src/ph_rpm.ml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index db7818a..9a65d0a 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,14 +31,17 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS"; "kylinsecos" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS"; "kylinsecos"; "nestos" ] ||
+
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
(stat "/etc/openEuler-release").st_kind = S_REG ||
(stat "/etc/euleros-release").st_kind = S_REG ||
(stat "/etc/hce-release").st_kind = S_REG ||
- (stat "/etc/kylinsec-release").st_kind = S_REG
+ (stat "/etc/kylinsec-release").st_kind = S_REG ||
+ (stat "/etc/openEuler-release-nestos-for-virt").st_kind = S_REG
+
with Unix_error _ -> false)
let opensuse_detect () =
--
2.33.0

View File

@ -0,0 +1,51 @@
From 3cda639a6dfc98446dd799a9b44d8080ef62c405 Mon Sep 17 00:00:00 2001
From: herengui <herengui@kylinsec.com.cn>
Date: Fri, 19 May 2023 14:12:53 +0800
Subject: [PATCH] enable musl for loongarch64
Signed-off-by: herengui <herengui@kylinsec.com.cn>
---
Makefile.in | 4 ++--
init/Makefile.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 0ddd63e..4b6592e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -280,7 +280,7 @@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -I/usr/musl/include
COM_ERR_CFLAGS = @COM_ERR_CFLAGS@
COM_ERR_LIBS = @COM_ERR_LIBS@
CPIO = @CPIO@
@@ -681,7 +681,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = @LDFLAGS@ -L/usr/musl/lib
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
LIBINTL = @LIBINTL@
diff --git a/init/Makefile.in b/init/Makefile.in
index e05bd32..e0df0c2 100644
--- a/init/Makefile.in
+++ b/init/Makefile.in
@@ -930,8 +930,8 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
CLEANFILES = *~
init_SOURCES = init.c
-init_CFLAGS = -static
-init_LDFLAGS = -static
+init_CFLAGS = -static -I/usr/musl/include
+init_LDFLAGS = -static -L/usr/musl/lib
all: all-am
.SUFFIXES:
--
2.40.1

View File

@ -0,0 +1,55 @@
From 487e8c964078f823646d3b0584745ab7d0ef99ca Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 26 Nov 2019 09:01:21 +0000
Subject: [PATCH] ext2: Build symbolic links correctly (RHBZ#1770304).
We created symlinks in two steps, by creating the empty inode and then
calling ext2fs_symlink to populate it. This created broken symlinks
where the directory name contained a / character, eg:
lrwxrwxrwx 1 root root 7 Nov 26 08:43 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 Nov 26 08:43 /lib -> usr/lib
lrwxrwxrwx 1 root root 9 Nov 26 08:43 /lib64 -> usr/lib64
lrwxrwxrwx 1 root root 8 Nov 26 08:43 /sbin -> usr/sbin
lrwxrwxrwx 1 root root 7 Nov 26 08:38 bin -> usr/bin
This breaks with Linux >= 5.3.8, most likely because of extra
validation now being done at the VFS layer:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/readdir.c?id=8a23eb804ca4f2be909e372cf5a9e7b30ae476cd
It's unnecessary to create the empty inode since ext2fs_symlink can
create the inode for us perfectly fine if we simply pass ino == 0, and
it creates them correctly too.
Thanks: Toolybird for identifying the problem and kernel patch.
---
src/ext2fs-c.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c
index e8ab972..8903f74 100644
--- a/src/ext2fs-c.c
+++ b/src/ext2fs-c.c
@@ -782,12 +782,6 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
}
/* Create a symlink. */
else if (S_ISLNK (statbuf.st_mode)) {
- ext2_ino_t ino;
- ext2_empty_inode (data->fs, dir_ino, dirname, basename,
- statbuf.st_mode, statbuf.st_uid, statbuf.st_gid,
- statbuf.st_ctime, statbuf.st_atime, statbuf.st_mtime,
- 0, 0, EXT2_FT_SYMLINK, &ino);
-
char *buf = malloc (statbuf.st_size+1);
if (buf == NULL)
caml_raise_out_of_memory ();
@@ -797,7 +791,7 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
if (r > statbuf.st_size)
r = statbuf.st_size;
buf[r] = '\0';
- ext2fs_symlink (data->fs, dir_ino, ino, dest, buf);
+ ext2fs_symlink (data->fs, dir_ino, 0, basename, buf);
free (buf);
}
/* Create directory. */

View File

@ -0,0 +1,38 @@
From 62d5c774d6c8fcac11e28fcba99754b5478e5088 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 10 Dec 2019 18:43:00 +0000
Subject: [PATCH] ext2: Expand directory when adding symlinks (RHBZ#1770304).
This produced very weird bugs with missing symlinks under
certain conditions, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1781803
Fixes commit 487e8c964078f823646d3b0584745ab7d0ef99ca.
---
src/ext2fs-c.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/ext2fs-c.c b/src/ext2fs-c.c
index 8903f74..0000865 100644
--- a/src/ext2fs-c.c
+++ b/src/ext2fs-c.c
@@ -791,7 +791,18 @@ ext2_copy_file (struct ext2_data *data, const char *src, const char *dest)
if (r > statbuf.st_size)
r = statbuf.st_size;
buf[r] = '\0';
- ext2fs_symlink (data->fs, dir_ino, 0, basename, buf);
+ symlink_again:
+ err = ext2fs_symlink (data->fs, dir_ino, 0, basename, buf);
+ if (err) {
+ if (err == EXT2_ET_DIR_NO_SPACE) {
+ err = ext2fs_expand_dir (data->fs, dir_ino);
+ if (err)
+ ext2_error_to_exception ("ext2fs_expand_dir", err, dirname);
+ goto symlink_again;
+ }
+ else
+ ext2_error_to_exception ("ext2fs_symlink", err, basename);
+ }
free (buf);
}
/* Create directory. */

View File

@ -0,0 +1,26 @@
From bbbf9d682017e93de210d8911347626fea93f1f3 Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Thu, 4 May 2023 18:04:36 +0800
Subject: [PATCH] add kylinsecos to supermin support
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
src/ph_rpm.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index a6e1eb4..db7818a 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,7 +31,7 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS"; "kylinsecos" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
--
2.33.0

View File

@ -0,0 +1,20 @@
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 61537ce..8260396 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,11 +31,13 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
- (stat "/etc/openEuler-release").st_kind = S_REG
+ (stat "/etc/openEuler-release").st_kind = S_REG ||
+ (stat "/etc/euleros-release").st_kind = S_REG ||
+ (stat "/etc/hce-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =

View File

@ -0,0 +1,39 @@
From 3cb595825d136cdce47dd264360780bb405acfba Mon Sep 17 00:00:00 2001
From: yangchenguang <yangchenguang@kylinsec.com.cn>
Date: Fri, 7 Apr 2023 15:12:31 +0800
Subject: [PATCH] fix(*):fix supermin cannot detect kylinsecos
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加supermin对kylinsec的支持
Signed-off-by: yangchenguang <yangchenguang@kylinsec.com.cn>
---
src/ph_rpm.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 8260396..a6e1eb4 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,13 +31,14 @@ let stringset_of_list pkgs =
let fedora_detect () =
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler"; "hce"; "euleros"; "KylinSecOS" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
(stat "/etc/fedora-release").st_kind = S_REG ||
(stat "/etc/openEuler-release").st_kind = S_REG ||
(stat "/etc/euleros-release").st_kind = S_REG ||
- (stat "/etc/hce-release").st_kind = S_REG
+ (stat "/etc/hce-release").st_kind = S_REG ||
+ (stat "/etc/kylinsec-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =
--
2.33.0

View File

@ -1,6 +1,16 @@
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
# KYLINSEC
%ifarch loongarch64 sw_64
# If a strip is executed on the loongarch64 executable supermin, it will cause the program to deteriorate
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/.*/usr/bin/strip[[:space:]].*$!!g')
# and don't generate debug packages for loongarch64
%global debug_package %{nil}
%endif
# END KYLINSEC
Name: supermin
Version: 5.1.19
Release: 12
Release: 19
Summary: A tool for building supermin appliances, required by libguestfs
License: GPLv2+
URL: http://libguestfs.org/
@ -9,10 +19,21 @@ Source1: supermin.attr
Source2: supermin-find-requires
Patch0001: 0001-Fix-Bytes-String-for-OCaml-4.06.patch
Patch0002: 0002-use-installed-packages-instead-of-dnf-downloading.patch
Patch9000: 9000-fix-cannot-detect-package-manager-on-openeuler.patch
Patch0003: Build-symbolic-links-correctly.patch
Patch0004: Expand-directory-when-adding-symlinks.patch
Patch9000: 9000-fix-cannot-detect-package-manager.patch
Patch9001: add-pie-and-bind_now-flags.patch
BuildRequires: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel
BuildRequires: findutils gnupg2 grubby hivex kernel ocaml ocaml-findlib-devel
Patch9002: fix-cannot-detect-package-manager-on-hce.patch
Patch9003: fix-supermin-cannot-detect-kylinsecos.patch
Patch9004: add-kylinsecos-to-supermin-support.patch
Patch9005: 0001-fix-cannot-detect-package-manager-on-NestOS.patch
BuildRequires: augeas dnf dnf-plugins-core e2fsprogs-devel
%ifarch loongarch64 sw_64
BuildRequires: glibc-devel
%else
BuildRequires: dietlibc-devel
%endif
BuildRequires: findutils gnupg2 grubby hivex ocaml ocaml-findlib-devel
BuildRequires: rpm rpm-devel systemd-udev tar
BuildRequires: /usr/bin/pod2man /usr/bin/pod2html /usr/sbin/mke2fs
Requires: cpio dnf dnf-plugins-core e2fsprogs-libs >= 1.42 findutils
@ -43,9 +64,17 @@ This contains man files for the using of supermin.
%prep
%autosetup -p1
%if %{!?openEuler:1}0
sed -i 's/; "openEuler"/&; "%{vendor}"/' ./src/ph_rpm.ml
num=$(grep -n "etc/openEuler-release" ./src/ph_rpm.ml |awk -F ":" '{printf $1}')
sed -i "N;$num i\ (stat \"/etc/%{vendor}-release\").st_kind = S_REG ||" ./src/ph_rpm.ml
%endif
%build
%configure --disable-network-tests
%ifnarch loongarch64 sw_64
make -C init CC="diet gcc"
%endif
%make_build
%install
@ -68,6 +97,29 @@ install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
%{_mandir}/man1/*
%changelog
* Thu Nov 30 2023 chendexi <chendexi@kylinos.cn> - 5.1.19-19
- Modify release file name due to release package name change
* Mon Oct 16 2023 lijian <lijian2@kylinos.cn> - 5.1.19-18
- fix cannot detect package manager on NestOS
* Fri Aug 11 2023 yeqinglong <yeqinglong@kylinsec.com.cn> - 5.1.19-17
- add loongarch64 and sw_64 support
- add kylinsec to supermin support
- fix supermin cannot detect kylinsecos
* Tue Nov 15 2022 xu_ping <xuping33@h-partners.com> - 5.1.19-16
- fix cannot detect package manager on hce
* Mon Nov 14 2022 xu_ping <xuping33@h-partners.com> - 5.1.19-15
- fix ext2: copying kernel modules error
* Thu May 26 2022 Jun Yang <jun.yang@suse.com> - 5.1.19-14
- Remove dependency of kernel package
* Fri Nov 18 2022 liyanan <liyanan32@h-partners.com> - 5.1.19-13
- Replace openEuler with vendor
* Wed Sep 08 2021 wangyue <wangyue92@huawei.com> - 5.1.19-12
- Add pie and bind_now flags