Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ea1c6b103f
!52 fix cannot detect package manager on kylin and uos
From: @funningc0217 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
2024-10-28 08:50:58 +00:00
Yurii Huang
2aa4b3740e fix cannot detect package manager on kylin and uos 2024-10-18 18:50:07 +08:00
openeuler-ci-bot
cb0063f6e4 !13 [sync] PR-11: Add pie and bind_now flags
From: @openeuler-sync-bot
Reviewed-by: @miao_kaibo
Signed-off-by: @miao_kaibo
2021-09-09 02:29:50 +00:00
wang_yue111
09a98017aa Add pie and bind_now flags
(cherry picked from commit fbb9631834b3506ad026fe0ebc3c21ba1c85d8f2)
2021-09-08 17:25:34 +08:00
openeuler-ci-bot
409e0cb858 !8 Use installed packages instead of dnf downloading
From: @maminjie
Reviewed-by: @zhanghua1831,@small_leek
Signed-off-by: @small_leek
2020-12-17 09:58:19 +08:00
maminjie
0331d3a409 Use installed packages instead of dnf downloading 2020-12-16 09:28:19 +08:00
openeuler-ci-bot
73c38588f1 !3 supermin: Add devel package
Merge pull request !3 from gnaygnil/master
2020-03-02 14:05:15 +08:00
gnaygnil
0ec41dc186 supermin: Add devel package 2020-03-02 12:52:13 +08:00
openeuler-ci-bot
704c27bdef !1 Package init
Merge pull request !1 from gnaygnil/master
2020-02-14 17:47:07 +08:00
gnaygnil
1422a47be1 Package init 2020-02-14 15:52:57 +08:00
11 changed files with 281 additions and 75 deletions

View File

@ -0,0 +1,58 @@
From 5c5eff66dfaccb212b8906e769e40633d8b8f5e4 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 13 Feb 2018 08:20:52 +0000
Subject: [PATCH] Fix Bytes/String for OCaml 4.06.
---
src/format_ext2_kernel.ml | 4 ++--
src/mode_build.ml | 10 ++++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index d5d529d..98bff3a 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -290,9 +290,9 @@ and read_leshort chan offset =
and read_string chan offset len =
seek_in chan offset;
- let buf = String.create len in
+ let buf = Bytes.create len in
really_input chan buf 0 len;
- buf
+ Bytes.to_string buf
and copy_or_symlink_file copy_kernel src dest =
if not copy_kernel then
diff --git a/src/mode_build.ml b/src/mode_build.ml
index 95869cb..b5f5fa6 100644
--- a/src/mode_build.ml
+++ b/src/mode_build.ml
@@ -299,9 +299,10 @@ and update_appliance appliance lines = function
(* Determine the [file_type] of [file], or exit with an error. *)
and get_file_type file =
let chan = open_in file in
- let buf = String.create 512 in
- let len = input chan buf 0 (String.length buf) in
+ let buf = Bytes.create 512 in
+ let len = input chan buf 0 (Bytes.length buf) in
close_in chan;
+ let buf = Bytes.to_string buf in
if len >= 3 && buf.[0] = '\x1f' && buf.[1] = '\x8b' && buf.[2] = '\x08'
then (* gzip-compressed file *)
@@ -335,8 +336,9 @@ and get_file_content file buf len =
and get_compressed_file_content zcat file =
let cmd = sprintf "%s %s" zcat (quote file) in
let chan_out, chan_in, chan_err = open_process_full cmd [||] in
- let buf = String.create 512 in
- let len = input chan_out buf 0 (String.length buf) in
+ let buf = Bytes.create 512 in
+ let len = input chan_out buf 0 (Bytes.length buf) in
+ let buf = Bytes.to_string buf in
(* We're expecting the subprocess to fail because we close the pipe
* early, so:
*)
--
2.15.1

View File

@ -0,0 +1,25 @@
From bb6a164d258c70d69b74e946f9e01d1503d66df0 Mon Sep 17 00:00:00 2001
From: maminjie <maminjie1@huawei.com>
Date: Tue, 15 Dec 2020 16:39:20 +0800
Subject: [PATCH] use installed packages instead of dnf downloading
---
src/supermin.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/supermin.ml b/src/supermin.ml
index f9798f9..7e4bd6c 100644
--- a/src/supermin.ml
+++ b/src/supermin.ml
@@ -91,7 +91,7 @@ let main () =
let mode = ref None in
let outputdir = ref "" in
let packager_config = ref "" in
- let use_installed = ref false in
+ let use_installed = ref true in
let size = ref None in
let include_packagelist = ref false in
--
2.23.0

View File

@ -0,0 +1,29 @@
From 21d7bb90cbcb1ab71c3d7e660948b92bbf85e5f6 Mon Sep 17 00:00:00 2001
From: zhanghaibo <ted.zhang@huawei.com>
Date: Wed, 11 Dec 2019 03:02:27 +0000
Subject: [PATCH] supermin:fix cannot detect package manager on openeuler
---
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 b0a5eb2..61537ce 100644
--- a/src/ph_rpm.ml
+++ b/src/ph_rpm.ml
@@ -31,10 +31,11 @@ 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" ] ||
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler" ] ||
try
(stat "/etc/redhat-release").st_kind = S_REG ||
- (stat "/etc/fedora-release").st_kind = S_REG
+ (stat "/etc/fedora-release").st_kind = S_REG ||
+ (stat "/etc/openEuler-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =
--
2.23.0

View File

@ -0,0 +1,41 @@
From decd4660a9df603dc2fedc72bdc9c9b99bc567d1 Mon Sep 17 00:00:00 2001
From: Yurii Huang <yurii.huang@dbappsecurity.com.cn>
Date: Fri, 18 Oct 2024 17:11:26 +0800
Subject: [PATCH] fix cannot detect package manager on kylin and uos
---
src/ph_rpm.ml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
index 61537ce..61d2cb7 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"; "uos"; "kylin" ] ||
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/UnionTech-release").st_kind = S_REG ||
+ (stat "/etc/kylin-release").st_kind = S_REG
with Unix_error _ -> false)
let opensuse_detect () =
@@ -439,7 +441,7 @@ and pkgs_as_NA_rpms pkgs =
and rpm_unpack tdir dir =
(* Unpack each downloaded package.
- *
+ *
* yumdownloader can't necessarily download the specific file that we
* requested, we might get a different (eg later) version.
*)
--
2.27.0

View File

@ -1,36 +0,0 @@
# supermin
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### 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,39 +0,0 @@
# supermin
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
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. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -0,0 +1,25 @@
From 678155eaeafa82ebdbebeed7567d54558c22538e Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 8 Sep 2021 16:05:12 +0800
Subject: [PATCH] Add pie and bind_now flags
---
src/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 09e1d08..5f8b34a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1077,7 +1077,7 @@ supermin_LDADD = ../lib/libgnu.a
supermin_LINK = \
./supermin-link.sh \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) \
- $(OBJECTS) -o $@
+ $(OBJECTS) -cclib "-pie -Wl,-z,now" -o $@
BUILT_SOURCES = format-ext2-init-bin.h
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
--
2.23.0

BIN
supermin-5.1.19.tar.gz Normal file

Binary file not shown.

16
supermin-find-requires Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash -
function process_file
{
cat "$1"
}
if [ "$#" -ge 1 ]; then
for f in "$@"; do
process_file "$f"
done
else
while read line; do
process_file "$line"
done
fi

2
supermin.attr Normal file
View File

@ -0,0 +1,2 @@
%__supermin_requires %{_rpmconfigdir}/supermin-find-requires
%__supermin_path /supermin\.d/[^/]*packages[^/]*

85
supermin.spec Normal file
View File

@ -0,0 +1,85 @@
Name: supermin
Version: 5.1.19
Release: 13
Summary: A tool for building supermin appliances, required by libguestfs
License: GPLv2+
URL: http://libguestfs.org/
Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz
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
Patch9001: add-pie-and-bind_now-flags.patch
Patch9002: 9002-fix-cannot-detect-package-manager-on-kylin-and-uos.patch
BuildRequires: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel
BuildRequires: findutils gnupg2 grubby hivex kernel 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
Requires: rpm tar util-linux-ng /usr/sbin/mke2fs
%description
Supermin is a tool for building supermin appliances. These are tiny
appliances (similar to virtual machines), usually around 100KB in
size, which get fully instantiated on-the-fly in a fraction of a
second when you need to boot one of them.
%package devel
Summary: Development tools for supermin
Requires: supermin = %{version}-%{release}
Requires: rpm-build
%description devel
supermin-devel contains development tools for supermin.
%package help
Summary: Man files for supermin
Requires: man
BuildArch: noarch
%description help
This contains man files for the using of supermin.
%prep
%autosetup -p1
%build
%configure --disable-network-tests
make -C init CC="diet gcc"
%make_build
%install
%make_install
mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_rpmconfigdir}/fileattrs/
install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_rpmconfigdir}/
%files
%doc examples/build-basic-vm.sh README
%license COPYING
%{_bindir}/*
%files devel
%{_rpmconfigdir}/fileattrs/supermin.attr
%{_rpmconfigdir}/supermin-find-requires
%files help
%{_mandir}/man1/*
%changelog
* Fri Oct 18 2024 Yurii.Huang<yurii.huang@dbappsecurity.com.cn> - 5.1.19-13
- adapter os uos and kylin
* Wed Sep 08 2021 wangyue <wangyue92@huawei.com> - 5.1.19-12
- Add pie and bind_now flags
* Wed Dec 16 2020 maminjie <maminjie1@huawei.com> - 5.1.19-11
- Use installed packages instead of dnf downloading
* Mon Mar 2 2020 Ling Yang <lingyang2@huawei.com> - 5.1.19-10
- Add devel package
* Fri Feb 14 2020 Ling Yang <lingyang2@huawei.com> - 5.1.19-9
- Package Initialization