From 7de4e1f1ac34ddb4f11229d8f3c049ca0693984c Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Tue, 28 Sep 2021 11:24:24 +0800 Subject: [PATCH] change for edge computing iso --- 0003-change-for-edge-computing.patch | 151 +++++++++++++++++++++++++++ README.en.md | 2 +- README.md | 2 +- edge_normal_aarch64.xml | 119 +++++++++++++++++++++ edge_normal_x86_64.xml | 119 +++++++++++++++++++++ oemaker.spec | 14 ++- rpmlist.xml | 34 ++++++ 7 files changed, 438 insertions(+), 3 deletions(-) create mode 100644 0003-change-for-edge-computing.patch create mode 100644 edge_normal_aarch64.xml create mode 100644 edge_normal_x86_64.xml diff --git a/0003-change-for-edge-computing.patch b/0003-change-for-edge-computing.patch new file mode 100644 index 0000000..eaeec29 --- /dev/null +++ b/0003-change-for-edge-computing.patch @@ -0,0 +1,151 @@ +From 5883a7f40fe7fc8cce44c7a709eaa890e1fe43d3 Mon Sep 17 00:00:00 2001 +From: miao_kaibo +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 + diff --git a/README.en.md b/README.en.md index 9b442e2..3643571 100644 --- a/README.en.md +++ b/README.en.md @@ -2,7 +2,7 @@ #### Description -`oemaker` is a building tool for making DVD iso, include standard iso, debug iso, source iso, everything iso, everything debug iso, everything source and netinst iso. +`oemaker` is a building tool for making DVD iso, include standard iso, debug iso, source iso, everything iso, everything debug iso, everything source iso, edge computing iso and netinst iso. `oemaker` uses local arch when building, did not support cross building. currently, `oemaker` support the arch of aarch64 and x86_64 for iso making. diff --git a/README.md b/README.md index 95533de..eb980ac 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # oemaker #### 介绍 -oemaker是一款用于构建DVD iso的工具,包括标准iso,debug iso, source iso, everything iso, everything debug iso, everything source and netinst iso等。 +oemaker是一款用于构建DVD iso的工具,包括标准iso,debug iso, source iso, everything iso, everything debug iso, everything source iso, edge computing iso and netinst iso等。 oemaker采用的是本地架构的方式进行构建,不支持交叉编译环境构建。 目前,oemkaer支持aarch64和x86_64两个架构的iso制作。 diff --git a/edge_normal_aarch64.xml b/edge_normal_aarch64.xml new file mode 100644 index 0000000..8810540 --- /dev/null +++ b/edge_normal_aarch64.xml @@ -0,0 +1,119 @@ + + + + + core + Core + 核心 + Smallest possible installation + 最小安装 + true + false + + audit + kernel + basesystem + bash + coreutils + cronie + curl + dnf + e2fsprogs + filesystem + firewalld + glibc + grubby + hostname + initscripts + iproute + iprutils + iputils + irqbalance + kbd + kexec-tools + less + man-db + ncurses + openssh + openssh-server + openssh-clients + parted + passwd + policycoreutils + procps-ng + rng-tools + rootfiles + rpm + selinux-policy-targeted + setup + shadow + sssd + sudo + systemd + tuned + util-linux + vim-minimal + xfsprogs + yum + wget + openEuler-release + openEuler-performance + openEuler-latest-release + NetworkManager + NetworkManager-config-server + authselect + dnf-plugins-core + dracut-config-rescue + kernel-tools + sysfsutils + linux-firmware + lshw + lsscsi + rsyslog + security-tool + sg3_utils + dracut-config-generic + dracut-network + rdma-core + selinux-policy-mls + patch + patch-help + ntp + ntp-help + ntp-perl + iSulad + tar + socat + socat-help + conntrack-tools + conntrack-tools-help + vim-X11 + vim-common + vim-enhanced + vim-filesystem + vim-minimal + efibootmgr + efibootmgr-help + cjson + cjson-devel + mosquitto + chrony + + + + minimal-environment + Minimal Install + 最小安装 + Basic functionality. + 基本功能。 + 1 + + core + + + standard + + + diff --git a/edge_normal_x86_64.xml b/edge_normal_x86_64.xml new file mode 100644 index 0000000..a165920 --- /dev/null +++ b/edge_normal_x86_64.xml @@ -0,0 +1,119 @@ + + + + + core + Core + 核心 + Smallest possible installation + 最小安装 + true + false + + audit + kernel + basesystem + bash + coreutils + cronie + curl + dnf + e2fsprogs + filesystem + firewalld + glibc + grubby + hostname + initscripts + iproute + iprutils + iputils + irqbalance + kbd + kexec-tools + less + man-db + ncurses + openssh + openssh-server + openssh-clients + openEuler-release + openEuler-performance + openEuler-latest-release + parted + passwd + policycoreutils + procps-ng + rng-tools + rootfiles + rpm + selinux-policy-targeted + setup + shadow + sssd + sudo + systemd + tuned + util-linux + vim-minimal + xfsprogs + yum + wget + NetworkManager + NetworkManager-config-server + authselect + dnf-plugins-core + dracut-config-rescue + kernel-tools + sysfsutils + linux-firmware + lshw + lsscsi + rsyslog + security-tool + sg3_utils + dracut-config-generic + dracut-network + rdma-core + selinux-policy-mls + patch + patch-help + ntp + ntp-help + ntp-perl + iSulad + tar + socat + socat-help + conntrack-tools + conntrack-tools-help + vim-X11 + vim-common + vim-enhanced + vim-filesystem + vim-minimal + efibootmgr + efibootmgr-help + cjson + cjson-devel + mosquitto + chrony + + + + minimal-environment + Minimal Install + 最小安装 + Basic functionality. + 基本功能。 + 1 + + core + + + standard + + + diff --git a/oemaker.spec b/oemaker.spec index 8ecf1d6..e1b373a 100644 --- a/oemaker.spec +++ b/oemaker.spec @@ -11,19 +11,22 @@ Summary: a duilding tool for DVD ISO making and ISO cutting License: Mulan PSL v2 Group: System/Management Version: 2.0.0 -Release: 4 +Release: 5 BuildRoot: %{_tmppath}/%{name} Source: https://gitee.com/openeuler/oemaker/repository/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: normal_aarch64.xml Source2: normal_x86_64.xml Source3: rpmlist.xml +Source4: edge_normal_aarch64.xml +Source5: edge_normal_x86_64.xml Requires: createrepo dnf-plugins-core genisoimage isomd5sum grep bash libselinux-utils libxml2 Requires: lorax >= 19.6.78-1 Patch0001: 0001-rename-source-iso.patch Patch0002: 0002-bugfix-I3QY98.patch +Patch0003: 0003-change-for-edge-computing.patch %description a building tool for DVD ISO making and ISO cutting @@ -44,6 +47,10 @@ rm -rf %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/x86_64/normal.xm cp %{SOURCE2} %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/x86_64/normal.xml rm -rf %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/rpmlist.xml cp %{SOURCE3} %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/rpmlist.xml +rm -rf %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/aarch64/edge_normal.xml +cp %{SOURCE4} %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/aarch64/edge_normal.xml +rm -rf %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/x86_64/edge_normal.xml +cp %{SOURCE5} %{_builddir}/%{name}-%{version}/%{name}/isomaker/config/x86_64/edge_normal.xml cd %{_builddir}/%{name}-%{version}/%{name} %autopatch -p1 @@ -121,6 +128,11 @@ rm -rf %{buildroot} rm -rf $RPM_BUILD_DIR/%{name} %changelog +* Tue Sep 28 2021 miao_kaibo - 2.0.0-5 +- ID:NA +- SUG:NA +- DESC: change for edge computing iso + * Wed May 12 2021 miao_kaibo - 2.0.0-4 - ID:NA - SUG:NA diff --git a/rpmlist.xml b/rpmlist.xml index 2d109e2..ae5ee4f 100644 --- a/rpmlist.xml +++ b/rpmlist.xml @@ -1416,4 +1416,38 @@ zziplib-help zziplib-utils + + grub2-efi-aa64 + grub2-efi-aa64-cdboot + grub2-efi-aa64-modules + + + grub2-pc + grub2-pc-modules + + + kubernetes + kubernetes-client + kubernetes-help + kubernetes-kubeadm + kubernetes-kubelet + kubernetes-master + kubernetes-node + kubeedge-cloudcore + kubeedge-edgecore + kubeedge-edgesite + kubeedge-keadm + grub2-common + grub2-tools-minimal + grub2-tools-extra + grub2-tools + grub2-help + lvm2-help + lvm2 + shim + mdadm + mdadm-help + dosfstools-help + dosfstools + -- Gitee