Compare commits
10 Commits
39facd00e4
...
ea1c6b103f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea1c6b103f | ||
|
|
2aa4b3740e | ||
|
|
cb0063f6e4 | ||
|
|
09a98017aa | ||
|
|
409e0cb858 | ||
|
|
0331d3a409 | ||
|
|
73c38588f1 | ||
|
|
0ec41dc186 | ||
|
|
704c27bdef | ||
|
|
1422a47be1 |
58
0001-Fix-Bytes-String-for-OCaml-4.06.patch
Normal file
58
0001-Fix-Bytes-String-for-OCaml-4.06.patch
Normal 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
|
||||
|
||||
25
0002-use-installed-packages-instead-of-dnf-downloading.patch
Normal file
25
0002-use-installed-packages-instead-of-dnf-downloading.patch
Normal 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
|
||||
|
||||
29
9000-fix-cannot-detect-package-manager-on-openeuler.patch
Normal file
29
9000-fix-cannot-detect-package-manager-on-openeuler.patch
Normal 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
|
||||
@ -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
|
||||
|
||||
36
README.en.md
36
README.en.md
@ -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/)
|
||||
39
README.md
39
README.md
@ -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/)
|
||||
25
add-pie-and-bind_now-flags.patch
Normal file
25
add-pie-and-bind_now-flags.patch
Normal 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
BIN
supermin-5.1.19.tar.gz
Normal file
Binary file not shown.
16
supermin-find-requires
Normal file
16
supermin-find-requires
Normal 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
2
supermin.attr
Normal file
@ -0,0 +1,2 @@
|
||||
%__supermin_requires %{_rpmconfigdir}/supermin-find-requires
|
||||
%__supermin_path /supermin\.d/[^/]*packages[^/]*
|
||||
85
supermin.spec
Normal file
85
supermin.spec
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user