前言
oecustom (openEuler customize) 是一套关于 openEuler iso 格式光盘映像的定制工具集。
工具 | 用途 |
---|---|
iso_custom | 用于定制 openEuler iso 镜像,可以定制 openEuler iso 镜像的系统名称和安装界面图标等 |
iso_cut | 用于裁剪 openEuler iso 镜像,参考 oemaker/isocut,可以裁剪iso大小及默认安装软件,还可以配置 kickstart 文件实现镜像自动安装等 |
iso_make | 用于制作 iso 镜像,参考 oemaker/isomaker,可以基于repo源重新制作镜像 |
创建一键自定义ISO制作(logo,名称,ISO)
- /目录位置/openEuler
- giee项目地址(git clone https://gitee.com/icanpool/shcanpool.git)
- 百度网盘离线项目包链接
- 镜像名称生成是这样CiasOS-24.03-LTS-x86_64-dvd.iso
- 44-51 变量更改自己的内容信息
- 项目logo位置/openEuler/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/sidebar-logo.png
- 项目logo位置/openEuler/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/sidebar-logo.png
- 系统logo 目录/usr/share/anaconda/pixmaps/sidebar-logo.png
- GIMP 图片制作logo download
- 在线去除图片背景参考
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: make.han
# Email: CIASM@CIASM
# Date: 2024/08/02
# openEuler Customization tool for images
<<!
# gitee 项目参考地址
https://gitee.com/icanpool/shcanpool/tree/master/tools/oecustom
# 参考信息
bash /openEuler/shcanpool/tools/oecustom/iso_make.sh -h
usage:
bash iso_make.sh [-h] [-t TYPE] [-p PRODUCT] [-v VERSION] [-r RELEASE] [-s REPOSITORY]
[-k KSFILE] [-b BASEOS] [-o OUTDIR]
-t TYPE:iso 类型,参考 openEuler 的 iso 镜像类型
-p PRODUCT:产品名称,如:openEuler,默认是 MyOS
-v VERSION:产品版本,如:24.03,默认是 1.0
-r RELEASE:产品发布号,如:LTS,默认无
-s REPOSITORY:dnf仓库源地址,可以指定多次-s来指定多个源
-k KSFILE:kickstart配置文件
-b BASEOS:基线 os 目录,目录内包含 normal.xml 和 rpmlist.xml
-o OUTDIR:iso 输出目录
!
<<!
#更改登录logo,以下目录图片sidebar-logo.png替换,(图片格式大小248X248 PNG GIMP制作https://mirror.nju.edu.cn/gimp/gimp/v2.10/windows/gimp-2.10.38-setup.exe
# 在线编辑工具https://fixthephoto.com/cn/online-gimp.html
/openEuler/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/sidebar-logo.png
/openEuler/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/shcanpool/tools/oecustom/logos/canpool/usr/share/anaconda/pixmaps/sidebar-logo.png
#默认系统下的logo
yum install -y openEuler-logos
/usr/share/anaconda/pixmaps/sidebar-logo.png
!
# 官网镜像裁剪参考
#https://docs.openeuler.org/zh/docs/22.03_LTS/docs/TailorCustom/imageTailor%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97.html
#yum install -y isocut imageTailor
# download openEuler environment variable
openEuler_directory=/openEuler
openEuler_download_url='https://mirror.sjtu.edu.cn/openeuler/openEuler-24.03-LTS/ISO/x86_64/openEuler-24.03-LTS-x86_64-dvd.iso'
openEuler24_iso='openEuler-24.03-LTS-x86_64-dvd.iso'
# os environment variable
os_name=CiasOS
os_version='24.04'
os_Release_Number=LTS
echo "install tools"
yum install -y git curl wget tar unzip vim net-tools
echo "Dependency installation"
yum install -y openEuler-logos
yum install -y rpmdevtools rpmrebuild createrepo genisoimage syslinux isomd5sum rsync
echo "directories creating"
mkdir -p $openEuler_directory
echo "download shcanpool"
git clone https://gitee.com/icanpool/shcanpool.git $openEuler_directory/shcanpool
echo "donwload $openEuler24_iso"
curl -o $openEuler_directory/$openEuler24_iso $openEuler_download_url
echo "Based on openEuler iso"
bash $openEuler_directory/shcanpool/tools/oecustom/iso_custom.sh \
-i $openEuler_directory/$openEuler24_iso \
-g $openEuler_directory/shcanpool/tools/oecustom/logos/canpool \
-p $os_name \
-v $os_version \
-r $os_Release_Number
<<!
echo "Crop to minimal image"
bash /openEuler/shcanpool/tools/oecustom/iso_cut.sh \
-i /openEuler/openEuler-24.03-LTS-x86_64-dvd.iso \
-f shcanpool/tools/oecustom/config/rpmlist/rpmlist.template \
-f shcanpool/tools/oecustom/config/rpmlist/rpmlist.x86_64 \
-o CiasOS-24.03-minimal-LTS-x86_64.iso
!