From 6ac1feb025ff2bc04102d4c02796ac170a89204f Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 25 Apr 2024 22:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=A8=A1=E5=BC=8F=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_reinstall.yml | 17 +++++------------ README.en.md | 18 ++++-------------- README.md | 18 ++++-------------- reinstall.sh | 14 ++++++++++---- 4 files changed, 23 insertions(+), 44 deletions(-) diff --git a/.github/workflows/run_reinstall.yml b/.github/workflows/run_reinstall.yml index 30c0863..1cdcdc8 100644 --- a/.github/workflows/run_reinstall.yml +++ b/.github/workflows/run_reinstall.yml @@ -24,25 +24,18 @@ jobs: - run: | ${{ matrix.command }} centos 7 ${{ matrix.command }} alma-8 - ${{ matrix.command }} rocky 8 + ${{ matrix.command }} rocky 9 ${{ matrix.command }} fedora ${{ matrix.command }} ubuntu - ${{ matrix.command }} debian 12 + ${{ matrix.command }} debian ${{ matrix.command }} alpine - ${{ matrix.command }} netboot.xyz - ${{ matrix.command }} dd --img=https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-SelfInstall.raw.xz - - # 测试 cloud image - ${{ matrix.command }} centos --ci - ${{ matrix.command }} alma --ci - ${{ matrix.command }} rocky --ci - ${{ matrix.command }} fedora-40 --ci - ${{ matrix.command }} ubuntu 22.04 --ci - ${{ matrix.command }} debian --ci ${{ matrix.command }} opensuse ${{ matrix.command }} arch ${{ matrix.command }} gentoo + ${{ matrix.command }} netboot.xyz + ${{ matrix.command }} dd --img=https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-SelfInstall.raw.xz + # 测试失败例子 # ${{ matrix.command }} wrong-os # ${{ matrix.command }} dd --img=https://github.com/ diff --git a/README.en.md b/README.en.md index ab5d578..dbdcb37 100644 --- a/README.en.md +++ b/README.en.md @@ -63,9 +63,7 @@ All features can be used on both Linux and Windows. ### Feature 1: Install Linux -- The parameter --ci indicates forced usage of the cloud image for installation. -- Machines with static IP installing CentOS, Alma, Rocky, Fedora, Ubuntu must include the parameter `--ci`. -- If it is uncertain whether the machine has a static or dynamic IP, you can also add the parameter `--ci`. +- If no version number is entered, the latest version will be installed. ```bash bash reinstall.sh centos 7|8|9 (8|9 for the stream version) @@ -78,14 +76,6 @@ bash reinstall.sh centos 7|8|9 (8|9 for the stream version) alpine 3.16|3.17|3.18|3.19 arch gentoo - - If no version number is entered, the latest version will be installed. -``` - -Parameters: - -```bash ---ci Force the use of the cloud image ``` ### Feature 2: DD @@ -192,11 +182,11 @@ Use `Dism++` File menu > Open Image File, select the iso to be installed to get | System | Traditional Installation | Cloud Image | | ------------------------------------- | ------------------------ | ----------- | -| Debian | 256M | 512M | -| Ubuntu | 1G | 512M | -| CentOS / Alma / Rocky | 1G | 512M | +| CentOS / Alma / Rocky | - | 512M | | Fedora | - | 512M | | openSUSE | - | 512M | +| Ubuntu | - | 512M | +| Debian | 256M | | | Alpine | 256M | - | | Arch | 512M | - | | Gentoo | 512M | - | diff --git a/README.md b/README.md index 491a54d..2b62572 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,7 @@ certutil -urlcache -f -split https://mirror.ghproxy.com/https://raw.githubuserco ### 功能 1: 安装 Linux -- 参数 `--ci` 表示强制使用云镜像安装 -- 静态 IP 的机器安装 CentOS、Alma、Rocky、Fedora、Ubuntu,必须使用 `--ci` 参数 -- 如果不清楚机器是静态 IP 还是动态 IP,也可使用 `--ci` +- 不输入版本号,则安装最新版 ```bash bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本) @@ -78,14 +76,6 @@ bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本) alpine 3.16|3.17|3.18|3.19 arch gentoo - - 不输入版本号,则安装最新版 -``` - -参数: - -```bash ---ci 强制使用云镜像 ``` ### 功能 2: DD @@ -192,11 +182,11 @@ Windows Server 2022 SERVERDATACENTER | 系统 | 传统安装 | 云镜像 | | ----------------------------------- | -------- | ------ | -| Debian | 256M | 512M | -| Ubuntu | 1G | 512M | -| CentOS / Alma / Rocky | 1G | 512M | +| CentOS / Alma / Rocky | - | 512M | | Fedora | - | 512M | | openSUSE | - | 512M | +| Ubuntu | - | 512M | +| Debian | 256M | - | | Alpine | 256M | - | | Arch | 512M | - | | Gentoo | 512M | - | diff --git a/reinstall.sh b/reinstall.sh index 9365975..6c2defe 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -1266,7 +1266,8 @@ check_ram() { return fi - ram_cloud_image=512 + # 未测试 + ram_cloud_image=256 has_cloud_image=$( case "$distro" in @@ -2266,6 +2267,9 @@ mod_initrd() { mod_initrd_$nextos_distro + # 显示精简前的大小 + du -sh . + # 删除 initrd 里面没用的文件/驱动 if is_virt && ! is_alpine_live; then rm -rf bin/brltty @@ -2313,6 +2317,9 @@ mod_initrd() { ) fi + # 显示精简后的大小 + du -sh . + # 重建 # 注意要用 cpio -H newc 不要用 cpio -c ,不同版本的 -c 作用不一样,很坑 # -c Use the old portable (ASCII) archive format @@ -2321,7 +2328,6 @@ mod_initrd() { # (ASCII) archive format, use "-H odc" instead. find . | cpio --quiet -o -H newc | gzip -1 >/reinstall-initrd cd - >/dev/null - ls -lh /reinstall-initrd } # 脚本入口 @@ -2426,13 +2432,13 @@ mkdir -p "$tmp" # 强制忽略/强制添加 --ci 参数 case "$distro" in -dd | windows | netboot.xyz | alpine | arch | gentoo) +dd | windows | netboot.xyz | debian | alpine | arch | gentoo) if is_use_cloud_image; then echo "ignored --ci" cloud_image=0 fi ;; -fedora | opensuse) +centos | alma | rocky | ubuntu | fedora | opensuse) cloud_image=1 ;; esac