1 Star 0 Fork 100

tianwei/oemaker

forked from src-openEuler/oemaker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-change-for-edge-computing.patch 5.58 KB
一键复制 编辑 原始数据 按行查看 历史
BigSkySea 提交于 2021-09-28 11:00 . change for edge computing iso
From 5883a7f40fe7fc8cce44c7a709eaa890e1fe43d3 Mon Sep 17 00:00:00 2001
From: miao_kaibo <miaokaibo@outlook.com>
Date: Mon, 27 Sep 2021 15:31:58 +0800
Subject: [PATCH] change for edge computing
---
isomaker/img_repo.sh | 13 ++++++++++++-
isomaker/init.sh | 4 +++-
isomaker/iso.sh | 16 ++++++++++++++++
isomaker/oemaker.sh | 7 +++++++
isomaker/rpm.sh | 19 +++++++++++++++++++
5 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/isomaker/img_repo.sh b/isomaker/img_repo.sh
index 5403724..0865815 100755
--- a/isomaker/img_repo.sh
+++ b/isomaker/img_repo.sh
@@ -18,7 +18,18 @@
set -e
function create_install_img()
{
- echo "$YUMREPO" > yumrepo.file
+ tmprep=''
+ repos=($(echo "$YUMREPO" | sed 's/-s//g'))
+ for rep in ${repos[@]}
+ do
+ if [[ "${rep}" =~ "Epol" ]];then
+ continue
+ else
+ tmprep="-s ${rep} ${tmprep}"
+ fi
+ done
+
+ echo "${tmprep}" > yumrepo.file
lorax --isfinal -p "${PRODUCT}" -v "${VERSION}${RELEASE}" -r "${RELEASE}" -t "${VARIANT}" --sharedir 80-openeuler --rootfs-size=4 --buildarch="$ARCH" $(cat yumrepo.file) --nomacboot --noupgrade "${BUILD}"/iso > lorax.logfile 2>&1
if [ $? != 0 ] ; then
diff --git a/isomaker/init.sh b/isomaker/init.sh
index 2603bfb..ca39d48 100755
--- a/isomaker/init.sh
+++ b/isomaker/init.sh
@@ -78,7 +78,7 @@ function parse_cmd_line()
esac
done
- for typename in standard source debug everything_debug everything everything_src netinst
+ for typename in standard source debug everything_debug everything everything_src netinst edge
do
if [ "${typename}" == "${ISO_TYPE}" ];then
return 0
@@ -114,6 +114,7 @@ function global_var_init()
EVE_DEBUG_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-everything-debug-${ARCH}-dvd.iso"
EVE_SRC_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-source-dvd.iso"
NETINST_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-netinst-${ARCH}-dvd.iso"
+ EDGE_ISO_NAME="${PRODUCT}-${VERSION}-${RELEASE}-edge-${ARCH}-dvd.iso"
else
RELEASE_NAME="${PRODUCT}-${VERSION}-${ARCH}"
STANDARD_ISO_NAME="${PRODUCT}-${VERSION}-${ARCH}-dvd.iso"
@@ -123,6 +124,7 @@ function global_var_init()
EVE_DEBUG_ISO_NAME="${PRODUCT}-${VERSION}-everything-debug-${ARCH}-dvd.iso"
EVE_SRC_ISO_NAME="${PRODUCT}-${VERSION}-source-dvd.iso"
NETINST_ISO_NAME="${PRODUCT}-${VERSION}-netinst-${ARCH}-dvd.iso"
+ EDGE_ISO_NAME="${PRODUCT}-${VERSION}-edge-${ARCH}-dvd.iso"
fi
[ ! -d "${BUILD}" ] && mkdir -p "${BUILD}"
diff --git a/isomaker/iso.sh b/isomaker/iso.sh
index b15b394..20a6245 100755
--- a/isomaker/iso.sh
+++ b/isomaker/iso.sh
@@ -47,6 +47,22 @@ function gen_standard_iso()
return 0
}
+function gen_edge_iso()
+{
+ set +e
+ mkdir -p "${BUILD}"/iso/repodata/
+ cp "config/${ARCH}/edge_normal.xml" "${BUILD}"/iso/repodata/
+ createrepo -g "${BUILD}"/iso/repodata/*.xml "${BUILD}"/iso
+ if [ "$ARCH" == "x86_64" ]; then
+ mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${EDGE_ISO_NAME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
+ [ $? != 0 ] && return 1
+ elif [ "$ARCH" == "aarch64" ]; then
+ mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -V "${RELEASE_NAME}" -o "${OUTPUT_DIR}/${EDGE_ISO_NAME}" -e images/efiboot.img -no-emul-boot "${BUILD}"/iso
+ [ $? != 0 ] && return 1
+ fi
+ implantisomd5 "${OUTPUT_DIR}/${EDGE_ISO_NAME}"
+ return 0
+}
function gen_src_iso()
{
diff --git a/isomaker/oemaker.sh b/isomaker/oemaker.sh
index 74d923e..37196e5 100755
--- a/isomaker/oemaker.sh
+++ b/isomaker/oemaker.sh
@@ -144,6 +144,13 @@ function mk_euleros_main()
return 1
fi
ls "${OUTPUT_DIR}/${EVE_SRC_ISO_NAME}"
+ elif [ "${ISO_TYPE}" == "edge" ]; then
+ gen_edge_iso
+ if [ $? -ne 0 ]; then
+ echo "create edge iso failed"
+ return 1
+ fi
+ ls "${OUTPUT_DIR}/${EDGE_ISO_NAME}"
fi
mkclean
return 0
diff --git a/isomaker/rpm.sh b/isomaker/rpm.sh
index e3feaab..85b1042 100755
--- a/isomaker/rpm.sh
+++ b/isomaker/rpm.sh
@@ -26,6 +26,10 @@ function parse_rpmlist_xml()
function download_rpms()
{
+ if [ "${ISO_TYPE}" == "edge" ]; then
+ get_edge_rpms
+ return 0
+ fi
cat "${CONFIG}" | grep packagereq | cut -d ">" -f 2 | cut -d "<" -f 1 > _all_rpms.lst
parse_rpmlist_xml "${ARCH}"
cat parsed_rpmlist_${ARCH} >> _all_rpms.lst
@@ -146,6 +150,21 @@ function get_rpm_pub_key()
rm -rf "${BUILD}"/iso/GPG_tmp
}
+function get_edge_rpms()
+{
+ parse_rpmlist_xml "edge_${ARCH}"
+ cat parsed_rpmlist_edge_${ARCH} > _edge_rpms.lst
+ parse_rpmlist_xml "edge_common"
+ cat parsed_rpmlist_edge_common >> _edge_rpms.lst
+ cat "config/${ARCH}/edge_normal.xml" | grep packagereq | cut -d ">" -f 2 | cut -d "<" -f 1 >> _edge_rpms.lst
+ sort -r -u _edge_rpms.lst -o _edge_rpms.lst
+ yumdownloader --resolve --installroot="${BUILD}"/tmp --destdir="${BUILD}"/iso/Packages/ $(cat _edge_rpms.lst | tr '\n' ' ')
+ if [ $? != 0 ] || [ $(ls "${BUILD}"/iso/Packages/ | wc -l) == 0 ]; then
+ echo "Download rpms failed!"
+ exit 133
+ fi
+}
+
function get_everything_rpms()
{
yum list --installroot="${BUILD}"/tmp --available | awk '{print $1}' | grep -E "\.noarch|\.${ARCH}" | grep -v "debuginfo" | grep -v "debugsource" > ava_every_lst
--
2.30.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/weiwei_150212/oemaker.git
git@gitee.com:weiwei_150212/oemaker.git
weiwei_150212
oemaker
oemaker
master

搜索帮助