change generate argument from isopath to repopath
This commit is contained in:
parent
0c49429ead
commit
34799ba674
119
0002-change-generate-argument-from-isopath-to-repopath.patch
Normal file
119
0002-change-generate-argument-from-isopath-to-repopath.patch
Normal file
@ -0,0 +1,119 @@
|
||||
From c652bb6f46ce2e434bd098552abebbba8909a9c0 Mon Sep 17 00:00:00 2001
|
||||
From: linxiaoxu <linxiaoxu@huawei.com>
|
||||
Date: Wed, 8 Dec 2021 02:01:18 +0000
|
||||
Subject: [PATCH] change generate argument from isopath to repopath
|
||||
|
||||
---
|
||||
docs/quick-start.md | 4 ++--
|
||||
scripts/generate.sh | 30 ++++++------------------------
|
||||
2 files changed, 8 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/docs/quick-start.md b/docs/quick-start.md
|
||||
index 098c839..ceb81e5 100644
|
||||
--- a/docs/quick-start.md
|
||||
+++ b/docs/quick-start.md
|
||||
@@ -56,10 +56,10 @@
|
||||
进入scripts目录,执行脚本
|
||||
```
|
||||
cd scripts
|
||||
- bash generate.sh ISO_PATH VERSION AGENT_PATH ENCRYPTED_PASSWD
|
||||
+ bash generate.sh REPO_PATH VERSION AGENT_PATH ENCRYPTED_PASSWD
|
||||
```
|
||||
- 参数说明:
|
||||
- - ISO_PATH :全量iso的路径
|
||||
+ - REPO_PATH :全量repo的路径
|
||||
- VERSION :制作的容器OS镜像的版本
|
||||
- AGENT_PATH:构建出来的os-agent的路径
|
||||
- ENCRYPTED_PASSWD:镜像的root用户密码,加密后的带盐值的密码。可以用openssl、kiwi等命令生成
|
||||
diff --git a/scripts/generate.sh b/scripts/generate.sh
|
||||
index 1374894..d5111f1 100644
|
||||
--- a/scripts/generate.sh
|
||||
+++ b/scripts/generate.sh
|
||||
@@ -12,8 +12,7 @@
|
||||
set -e
|
||||
|
||||
NAME=KubeOS
|
||||
-ISO_PATH="/mnt"
|
||||
-ISO=""
|
||||
+REPO=""
|
||||
VERSION=""
|
||||
AGENT_PATH=""
|
||||
PASSWD=""
|
||||
@@ -27,7 +26,7 @@ CHECK_REGEX='\||;|&|&&|\|\||>|>>|<|,|#|!|\$'
|
||||
function show_options() {
|
||||
cat << EOF
|
||||
|
||||
-usage example: sh generate.sh isopath osversion agentpath passwd(encrypted)
|
||||
+usage example: sh generate.sh repopath osversion agentpath passwd(encrypted)
|
||||
|
||||
options:
|
||||
-h,--help show help information
|
||||
@@ -114,7 +113,6 @@ function delete_file() {
|
||||
function clean_space() {
|
||||
delete_dir "${RPM_ROOT}"
|
||||
delete_dir "${TMP_MOUNT_PATH}"
|
||||
- unmount_dir "${ISO_PATH}"
|
||||
delete_file os.tar
|
||||
rm -rf "${LOCK}"
|
||||
}
|
||||
@@ -135,8 +133,8 @@ function test_lock() {
|
||||
}
|
||||
|
||||
function check_path() {
|
||||
- if [ ! -f "${ISO}" ];then
|
||||
- echo "ISO path is invalid."
|
||||
+ if [ ! -f "${REPO}" ];then
|
||||
+ echo "REPO path is invalid."
|
||||
exit 3
|
||||
fi
|
||||
|
||||
@@ -144,11 +142,6 @@ function check_path() {
|
||||
echo "there is a rootfs folder. please confirm if rootfs is being used, if not, please remove ${RPM_ROOT} first."
|
||||
exit 5
|
||||
fi
|
||||
-
|
||||
- if mount 2>/dev/null | grep -w -q "${ISO_PATH}"; then
|
||||
- echo "$ISO_PATH has already been mounted."
|
||||
- exit 4
|
||||
- fi
|
||||
}
|
||||
|
||||
function check_disk_space() {
|
||||
@@ -168,24 +161,13 @@ function check_disk_space() {
|
||||
}
|
||||
|
||||
function prepare_yum() {
|
||||
- mount "${ISO}" "${ISO_PATH}"
|
||||
- if [ ! -d "/mnt/Packages" ]; then
|
||||
- echo "please use ISO file path as ${ISO}."
|
||||
- exit 2
|
||||
- fi
|
||||
-
|
||||
# init rpmdb
|
||||
rpm --root "${RPM_ROOT}" --initdb
|
||||
mkdir -p "${RPM_ROOT}"{/etc/yum.repos.d,/persist,/proc,/dev/pts,/sys}
|
||||
mount_proc_dev_sys "${RPM_ROOT}"
|
||||
# init yum repo
|
||||
local iso_repo="${RPM_ROOT}/etc/yum.repos.d/iso.repo"
|
||||
- echo "[base]" >"${iso_repo}"
|
||||
- {
|
||||
- echo "name=ISO base"
|
||||
- echo "baseurl=file://${ISO_PATH}"
|
||||
- echo "enabled=1"
|
||||
- } >>"${iso_repo}"
|
||||
+ cat ${REPO} > ${RPM_ROOT}/etc/yum.repos.d/iso.repo
|
||||
}
|
||||
|
||||
function install_packages() {
|
||||
@@ -304,7 +286,7 @@ do
|
||||
done
|
||||
set -eE
|
||||
|
||||
-ISO=$1
|
||||
+REPO=$1
|
||||
VERSION=$2
|
||||
AGENT_PATH=$3
|
||||
PASSWD=$4
|
||||
--
|
||||
2.30.0
|
||||
|
||||
@ -2,11 +2,12 @@
|
||||
|
||||
Name: KubeOS
|
||||
Version: 1.0.1
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: O&M platform used to update the whole OS as an entirety
|
||||
License: Mulan PSL v2
|
||||
Source0: https://gitee.com/openeuler/KubeOS/repository/archive/v%{version}.tar.gz
|
||||
Patch1: 0001-KubeOS-modify-checks-in-generate.sh-and-change-modul.patch
|
||||
Patch2: 0002-change-generate-argument-from-isopath-to-repopath.patch
|
||||
ExclusiveArch: x86_64
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: make
|
||||
@ -78,6 +79,12 @@ install -p -m 0600 ./files/os-release %{buildroot}/opt/kubeOS/files
|
||||
rm -rfv %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Wed Dec 08 2021 linxiaoxu<linxiaoxu@huawei.com> - 1.0.1-4
|
||||
- Type:requirement
|
||||
- CVE:NA
|
||||
- SUG:restart
|
||||
- DESC:fix bugs of change generate argument from isopath to repopath
|
||||
|
||||
* Thu Nov 11 2021 liyuanrong<liyuanrong1@huawei.com> - 1.0.1-3
|
||||
- Type:requirement
|
||||
- CVE:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user