├── .github
├── FUNDING.yml
└── workflows
│ ├── build-custom.yml
│ ├── build-esiropenwrt.yml
│ ├── build-ezopwrt.yml
│ ├── build-haos.yml
│ ├── build-imm.yml
│ ├── build-istoreos.yml
│ └── build.yml
├── .gitignore
├── LICENSE
├── README.md
├── build.sh
├── custom.sh
├── debugBuild.sh
├── esir.sh
├── ezopwrt.sh
├── haos.sh
├── imm.sh
├── info.md
├── istoreos.sh
└── supportFiles
├── 99-dhcp-en.network
├── build.sh
├── custom
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── ddd
├── esirplayground
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── ezopwrt
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── grub-standalone.cfg
├── grub.cfg
├── haos
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── immortalwrt
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── installChroot.sh
├── isolinux.cfg
├── istoreos
├── build.sh
├── ddd
├── grub.cfg
├── info.md
└── isolinux.cfg
├── override.conf
└── sources.list
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 |
2 | custom: https://wkdaily.cpolar.top/01
3 |
--------------------------------------------------------------------------------
/.github/workflows/build-custom.yml:
--------------------------------------------------------------------------------
1 | name: "Build Custom OpenWrt Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | download_url:
7 | description: '请输入下载地址(扩展名 .img.gz/.img.xz/.img.zip)'
8 | required: true
9 | default: 'https://default.example.com/file.img.gz'
10 |
11 | jobs:
12 | build-release:
13 | name: "Build and Release"
14 | runs-on: "ubuntu-22.04"
15 |
16 | steps:
17 | - name: "Checking out git repository"
18 | uses: actions/checkout@v2
19 |
20 | - name: Set executable permissions
21 | run: |
22 | chmod +x "${{ github.workspace }}/custom.sh"
23 | chmod +x "${{ github.workspace }}/supportFiles/custom/build.sh"
24 |
25 | - name: Validate Download URL
26 | run: |
27 | DEFAULT_URL="https://default.example.com/file.img.gz"
28 | USER_INPUT_URL="${{ github.event.inputs.download_url }}"
29 |
30 | if [[ "$USER_INPUT_URL" == "$DEFAULT_URL" ]]; then
31 | echo "❌ 错误:请修改默认下载地址!当前地址为无效占位符。"
32 | exit 1
33 | fi
34 |
35 | if [[ ! "$USER_INPUT_URL" =~ ^https?://.+\.[gG][zZ]$|^https?://.+\.[xX][zZ]$|^https?://.+\.[zZ][iI][pP]$ ]]; then
36 | echo "❌ 错误:地址需以 http(s) 开头且扩展名为 .gz/.xz/.zip"
37 | echo "当前输入:$USER_INPUT_URL"
38 | exit 1
39 | fi
40 |
41 | - name: "Build Image"
42 | run: |
43 | download_url="${{ github.event.inputs.download_url }}"
44 | ./custom.sh "$download_url"
45 |
46 | - name: "Publish"
47 | uses: softprops/action-gh-release@v2.2.1
48 | with:
49 | tag_name: "Custom-Installer-x86_64-ISO"
50 | body_path: "${{ github.workspace }}/supportFiles/custom/info.md"
51 | files: |
52 | output/custom-installer-x86_64.iso
53 | token: "${{ secrets.GITHUB_TOKEN }}"
--------------------------------------------------------------------------------
/.github/workflows/build-esiropenwrt.yml:
--------------------------------------------------------------------------------
1 | name: "Build eSirOpenWrt Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | build-release:
8 | name: "Build and Release"
9 | runs-on: "ubuntu-22.04"
10 |
11 | steps:
12 | - name: "Get Date"
13 | run: |
14 | echo "DATESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
15 |
16 | - name: "Checking out git repository"
17 | uses: actions/checkout@v2
18 |
19 | - name: Set executable permissions
20 | run: |
21 | chmod +x ${{ github.workspace }}/esir.sh
22 | chmod +x ${{ github.workspace }}/supportFiles/esirplayground/build.sh
23 |
24 | - name: "Build Image"
25 | run: |
26 | ./esir.sh
27 |
28 | - name: "Publish"
29 | uses: softprops/action-gh-release@v2.2.1
30 | with:
31 | tag_name: "eSirOpenWrt-Installer-x86_64-ISO"
32 | body_path: ${{ github.workspace }}/supportFiles/esirplayground/info.md
33 | files: |
34 | output/esiropenwrt-installer-x86_64.iso
35 | token: ${{ secrets.GITHUB_TOKEN }}
36 | env:
37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 |
--------------------------------------------------------------------------------
/.github/workflows/build-ezopwrt.yml:
--------------------------------------------------------------------------------
1 | name: "Build EzOpWrt Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | build-release:
8 | name: "Build and Release"
9 | runs-on: "ubuntu-22.04"
10 |
11 | steps:
12 | - name: "Get Date"
13 | run: |
14 | echo "DATESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
15 |
16 | - name: "Checking out git repository"
17 | uses: actions/checkout@v2
18 |
19 | - name: Set executable permissions
20 | run: |
21 | chmod +x ${{ github.workspace }}/ezopwrt.sh
22 | chmod +x ${{ github.workspace }}/supportFiles/ezopwrt/build.sh
23 |
24 | - name: "Build Image"
25 | run: |
26 | ./ezopwrt.sh
27 |
28 | - name: "Publish"
29 | uses: softprops/action-gh-release@v2.2.1
30 | with:
31 | tag_name: "EzOpWrt-Installer-x86_64-ISO"
32 | body_path: ${{ github.workspace }}/supportFiles/ezopwrt/info.md
33 | files: |
34 | output/ezopwrt-installer-x86_64.iso
35 | token: ${{ secrets.GITHUB_TOKEN }}
36 | env:
37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 |
--------------------------------------------------------------------------------
/.github/workflows/build-haos.yml:
--------------------------------------------------------------------------------
1 | name: "Build HAOS Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | download_url:
7 | description: '请输入haos下载地址(扩展名 .img.gz/.img.xz/.img.zip)'
8 | required: true
9 | default: 'https://github.com/home-assistant/operating-system/releases/download/15.0/haos_generic-x86-64-15.0.img.xz'
10 |
11 | jobs:
12 | build-release:
13 | name: "Build and Release"
14 | runs-on: "ubuntu-22.04"
15 |
16 | steps:
17 | - name: "Checking out git repository"
18 | uses: actions/checkout@v2
19 |
20 | - name: Set executable permissions
21 | run: |
22 | chmod +x "${{ github.workspace }}/haos.sh"
23 | chmod +x "${{ github.workspace }}/supportFiles/haos/build.sh"
24 |
25 | - name: Validate Download URL
26 | run: |
27 | USER_INPUT_URL="${{ github.event.inputs.download_url }}"
28 |
29 | if [[ ! "$USER_INPUT_URL" =~ ^https?://.+\.[gG][zZ]$|^https?://.+\.[xX][zZ]$|^https?://.+\.[zZ][iI][pP]$ ]]; then
30 | echo "❌ 错误:地址需以 http(s) 开头且扩展名为 .gz/.xz/.zip"
31 | echo "当前输入:$USER_INPUT_URL"
32 | exit 1
33 | fi
34 |
35 | - name: "Build Image"
36 | run: |
37 | download_url="${{ github.event.inputs.download_url }}"
38 | ./haos.sh "$download_url"
39 |
40 | - name: "Publish"
41 | uses: softprops/action-gh-release@v2.2.1
42 | with:
43 | tag_name: "HAOS-Installer-x86_64-ISO"
44 | body_path: "${{ github.workspace }}/supportFiles/haos/info.md"
45 | files: |
46 | output/haos-installer-x86_64.iso
47 | token: "${{ secrets.GITHUB_TOKEN }}"
--------------------------------------------------------------------------------
/.github/workflows/build-imm.yml:
--------------------------------------------------------------------------------
1 | name: "Build ImmortalWrt Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | build-release:
8 | name: "Build and Release"
9 | runs-on: "ubuntu-22.04"
10 |
11 | steps:
12 | - name: "Get Date"
13 | run: |
14 | echo "DATESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
15 |
16 | - name: "Checking out git repository"
17 | uses: actions/checkout@v2
18 |
19 | - name: Set executable permissions
20 | run: |
21 | chmod +x ${{ github.workspace }}/imm.sh
22 | chmod +x ${{ github.workspace }}/supportFiles/immortalwrt/build.sh
23 |
24 | - name: "Build Image"
25 | run: |
26 | ./imm.sh
27 |
28 | - name: "Publish"
29 | uses: softprops/action-gh-release@v2.2.1
30 | with:
31 | tag_name: "ImmortalWrt-Installer-x86_64-ISO"
32 | body_path: ${{ github.workspace }}/supportFiles/immortalwrt/info.md
33 | files: |
34 | output/immortalwrt-installer-x86_64.iso
35 | token: ${{ secrets.GITHUB_TOKEN }}
36 | env:
37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 |
--------------------------------------------------------------------------------
/.github/workflows/build-istoreos.yml:
--------------------------------------------------------------------------------
1 | name: "Build iStoreOS Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | build-release:
8 | name: "Build and Release"
9 | runs-on: "ubuntu-22.04"
10 |
11 | steps:
12 |
13 | - name: "Checking out git repository"
14 | uses: actions/checkout@v2
15 |
16 | - name: Set executable permissions
17 | run: |
18 | chmod +x ${{ github.workspace }}/istoreos.sh
19 | chmod +x ${{ github.workspace }}/supportFiles/istoreos/build.sh
20 |
21 | - name: "Build iStoreOS Installer ISO"
22 | run: |
23 | ./istoreos.sh
24 |
25 | - name: "Publish"
26 | uses: softprops/action-gh-release@v2.2.1
27 | with:
28 | tag_name: "iStoreOS-Installer-x86_64-ISO"
29 | body_path: ${{ github.workspace }}/supportFiles/istoreos/info.md
30 | files: |
31 | output/istoreos-installer-x86_64.iso
32 | token: ${{ secrets.GITHUB_TOKEN }}
33 | env:
34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: "Build Armbian Installer ISO"
2 |
3 | on:
4 | workflow_dispatch:
5 | inputs:
6 | version_type:
7 | description: "版本类型"
8 | required: true
9 | default: "standard"
10 | type: choice
11 | options:
12 | - "standard"
13 | - "debian12_minimal"
14 | - "ubuntu24_minimal"
15 | - "homeassistant_debian12_minimal"
16 |
17 | jobs:
18 | build-release:
19 | runs-on: ubuntu-22.04
20 | env:
21 | VERSION_TYPE: ${{ github.event.inputs.version_type }}
22 |
23 | steps:
24 | - uses: actions/checkout@v4
25 |
26 | - name: Build Image
27 | run: ./build.sh
28 |
29 | - name: "Prepare Release Assets"
30 | run: |
31 | # 根据版本类型重命名ISO文件
32 | if [ "$VERSION_TYPE" = "debian12_minimal" ]; then
33 | mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-debian12_minimal.iso
34 | fi
35 |
36 | if [ "$VERSION_TYPE" = "ubuntu24_minimal" ]; then
37 | mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-ubuntu24_minimal.iso
38 | fi
39 |
40 | if [ "$VERSION_TYPE" = "homeassistant_debian12_minimal" ]; then
41 | mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-homeassistant_debian12_minimal.iso
42 | fi
43 |
44 |
45 | - name: "Publish"
46 | uses: softprops/action-gh-release@v2.2.1
47 | with:
48 | tag_name: "Armbian-Installer-x86_64-ISO"
49 | body_path: ${{ github.workspace }}/info.md
50 | files: |
51 | output/armbian-installer-x86_64-${{ github.event.inputs.version_type }}.iso
52 | token: ${{ secrets.GITHUB_TOKEN }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/output
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Daniel William Powers
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # img-installer
2 | 它是一个基于Debian Live系统的img镜像安装器。采用github action构建打包。目前实现了在x86-64设备上 快速安装armbian和openwrt的功能。
3 | 
4 |
5 |
6 | ## 背景解读
7 | - 嵌入式设备的系统通常采用img格式,一般出现在ARM设备中,安装方式通常是线刷、烧录SD卡等方式。
8 | - 但近年来,openwrt 和 armbian 也逐渐兼容适配通用型x86-64设备,随着软路由和NAS虚拟机逐渐普及。
9 | - 显然针对ARM设备的烧录方法 不太适合x86-64设备(含虚拟机)。无论是借助PE还是借助dd 都需要传递固件文件。显得低效和复杂。
10 | - 如何让openwrt/armbian 等小众x86-64的Linux系统 像安装普通系统一样简单呢 希望本项目给你一个满意的答案。
11 |
12 | ## 使用方式
13 | [图文教学](https://club.fnnas.com/forum.php?mod=viewthread&tid=26293)
14 | 1. 虚拟机使用:各种虚拟机直接选择iso即可
15 | 2. 物理机使用:建议将iso放入ventoy的U盘中
16 | 3. https://www.ventoy.net/cn/download.html
17 | 4. 视频教学:[](https://youtu.be/6FWyACrNQIg)
18 | [](https://www.bilibili.com/video/BV1DQXVYFENr)
19 | - 【第一集 ESXI虚拟机 和 物理机使用】https://youtu.be/6FWyACrNQIg 【B站】https://www.bilibili.com/video/BV1DQXVYFENr
20 | - 【第二集 飞牛NAS】https://youtu.be/RRBFc58SwXQ 【B站】https://www.bilibili.com/video/BV1gPXCYyEc2
21 | - 【第三集 Hyper-V、绿联NAS虚拟机、飞牛虚拟机使用教程】 https://www.bilibili.com/video/BV1BoZVYsE7b
22 | - 【第四集 PVE虚拟机里如何使用img安装器】https://www.bilibili.com/video/BV1Rx5Qz4EZB
23 |
24 | 6. 具体的操作方法是:在安装器所在系统里输入 `ddd` 命令 方可调出安装菜单
25 | 
26 |
27 |
28 | ## 项目说明和相关Feature
29 | 1. 此项目生成的ISO同时 支持物理机 和 虚拟机的安装
30 | 2. 此项目生成的安装器用于各种常见的img格式嵌入式系统:`OpenWrt`、`Armbian`、`HAOS`、`LibreELEC`等
31 | 3. 其中OpenWrt分为istoreos、immortalwrt、EzOpWrt、eSirOpenWrt 安装器。实际上安装任意一种即可,因为换固件可在网页里随时换。
32 | 4. istoreos 在虚拟机上并没有安装器,因此本项目算是一种补充。(物理机安装istoreos就可以忽略本项目了)
33 | 5. armbian 安装器 目前构建2种 一种是minimal 一种是标准版 较低配置的x86-64设备建议使用minimal 比如(wyse3040瘦客户机)
34 | 6. HAOS可自定义下载地址,默认构建HAOS 15.0 `haos_generic-x86-64-15.0.img.xz`
35 | 7. 支持自定义openwrt镜像生成iso安装器,其中openwrt镜像的压缩包格式是`img.gz` `img.zip` `img.xz`三种
36 |
37 |
38 |
39 | ## ISO自动制作流程
40 | 本项目也是基于开源项目[debian-live](https://github.com/dpowers86/debian-live)制作.因此我的代码也是全程开源 MIT协议不变。
41 | 1. 首先构建一个debian live系统 该系统带EFI引导。
42 | 2. 在该系统内融入我们需要的img镜像和自己制作的dd写盘脚本。一起打包到filesystem.squashfs文件系统中。该过程包含了压缩,从而保证了最终的体积较小。
43 | 3. 最后将新的squashfs文件和相关文件一起打包为ISO
44 |
45 | ## 项目参考
46 | - https://willhaley.com/blog/custom-debian-live-environment/
47 | - https://github.com/dpowers86/debian-live
48 | - https://github.com/sirpdboy/openwrt/releases
49 | - https://github.com/esirplayground
50 |
51 | ## Star History
52 |
53 | [](https://star-history.com/#wukongdaily/armbian-installer&Date)
54 |
55 |
56 |
57 | ## ❤️赞助作者 ⬇️⬇️
58 | #### 项目开发不易 感谢您的支持鼓励。
59 | [](https://wkdaily.cpolar.top/01)
60 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p armbian
3 |
4 | # 读取环境变量 (带默认值)
5 | VERSION_TYPE="${VERSION_TYPE:-standard}"
6 | if [ "$VERSION_TYPE" = "debian12_minimal" ]; then
7 | echo "构建debian12_minimal-armbian..."
8 | FILE_NAME="Armbian_25.2.1_Uefi-x86_bookworm_current_6.12.13_minimal.img.xz"
9 | elif [ "$VERSION_TYPE" = "ubuntu24_minimal" ]; then
10 | echo "构建ubuntu24_minimal-armbian..."
11 | FILE_NAME="Armbian_25.2.1_Uefi-x86_noble_current_6.12.13_minimal.img.xz"
12 | elif [ "$VERSION_TYPE" = "homeassistant_debian12_minimal" ]; then
13 | echo "构建homeassistant全家桶版armbian..."
14 | FILE_NAME="Armbian_25.2.3_Uefi-x86_bookworm_current_6.12.17-homeassistant_minimal.img.xz"
15 | else
16 | echo "构建standard-armbian..."
17 | FILE_NAME="Armbian_25.2.1_Uefi-x86_noble_current_6.12.13.img.xz"
18 | fi
19 |
20 | REPO="wukongdaily/armbian-installer"
21 | TAG="2025-03-12"
22 | OUTPUT_PATH="armbian/armbian.img.xz"
23 |
24 | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == "'"$FILE_NAME"'") | .browser_download_url')
25 |
26 | if [[ -z "$DOWNLOAD_URL" ]]; then
27 | echo "错误:未找到文件 $FILE_NAME"
28 | exit 1
29 | fi
30 |
31 | echo "下载地址: $DOWNLOAD_URL"
32 | echo "下载文件: $FILE_NAME -> $OUTPUT_PATH"
33 | curl -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"
34 |
35 | if [[ $? -eq 0 ]]; then
36 | echo "下载armbian成功!"
37 | file armbian/armbian.img.xz
38 | echo "正在解压为:armbian.img"
39 | xz -d armbian/armbian.img.xz
40 | ls -lh armbian/
41 | echo "准备合成 armbian 安装器"
42 | else
43 | echo "下载失败!"
44 | exit 1
45 | fi
46 |
47 | mkdir -p output
48 | docker run --privileged --rm \
49 | -v $(pwd)/output:/output \
50 | -v $(pwd)/supportFiles:/supportFiles:ro \
51 | -v $(pwd)/armbian/armbian.img:/mnt/armbian.img \
52 | debian:buster \
53 | /supportFiles/build.sh
--------------------------------------------------------------------------------
/custom.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 |
4 | # 校验参数是否存在
5 | if [ -z "$1" ]; then
6 | echo "❌ 错误:未提供下载地址!"
7 | exit 1
8 | fi
9 |
10 | mkdir -p imm
11 | DOWNLOAD_URL="$1"
12 | filename=$(basename "$DOWNLOAD_URL") # 从 URL 提取文件名
13 | OUTPUT_PATH="imm/$filename"
14 |
15 | echo "下载地址: $DOWNLOAD_URL"
16 | echo "保存路径: $OUTPUT_PATH"
17 |
18 | # 下载文件
19 | if ! curl -k -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"; then
20 | echo "❌ 下载失败!"
21 | exit 1
22 | fi
23 |
24 | echo "✅ 下载成功!"
25 | file "$OUTPUT_PATH"
26 |
27 | # 根据扩展名解压
28 | extension="${filename##*.}" # 获取文件扩展名
29 | case $extension in
30 | gz)
31 | echo "gz正在解压$OUTPUT_PATH"
32 | gunzip -f "$OUTPUT_PATH" || true
33 | final_name=$(find imm -name '*.img' -print -quit)
34 | mv "$final_name" "imm/custom.img"
35 | ;;
36 | zip)
37 | echo "zip正在解压$OUTPUT_PATH"
38 | unzip -j -o "$OUTPUT_PATH" -d imm/ # -j 忽略目录结构
39 | final_name=$(find imm -name '*.img' -print -quit)
40 | mv "$final_name" "imm/custom.img"
41 | ;;
42 | xz)
43 | echo "xz正在解压$OUTPUT_PATH"
44 | xz -d --keep "$OUTPUT_PATH" # 保留原文件
45 | final_name="${OUTPUT_PATH%.*}"
46 | mv "$final_name" "imm/custom.img"
47 | ;;
48 | *)
49 | echo "❌ 不支持的压缩格式: $extension"
50 | exit 1
51 | ;;
52 | esac
53 |
54 |
55 | # 检查最终文件
56 | if [ -f "imm/custom.img" ]; then
57 | echo "✅ 解压成功"
58 | ls -lh imm/
59 | echo "✅ 准备合成 自定义OpenWrt 安装器"
60 | else
61 | echo "❌ 错误:最终文件 imm/custom.img 不存在"
62 | exit 1
63 | fi
64 |
65 | mkdir -p output
66 | docker run --privileged --rm \
67 | -v $(pwd)/output:/output \
68 | -v $(pwd)/supportFiles:/supportFiles:ro \
69 | -v $(pwd)/imm/custom.img:/mnt/custom.img \
70 | debian:buster \
71 | /supportFiles/custom/build.sh
72 |
--------------------------------------------------------------------------------
/debugBuild.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p output
3 | docker run --privileged -it --rm -v $(pwd)/output:/output -v $(pwd)/supportFiles:/supportFiles:ro -w /supportFiles debian:buster
4 |
--------------------------------------------------------------------------------
/esir.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | REPO="wkccd/esirOpenWrt"
4 | TAG=$(curl -sL "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name // empty')
5 | [ -z "$TAG" ] && TAG=$(curl -sL "https://api.github.com/repos/$REPO/tags" | jq -r '.[0].name')
6 | echo "最新TAG: $TAG"
7 | # 获取该 Tag 下所有以 .img.gz 结尾的文件
8 | DOWNLOAD_URLS=$(curl -sL "https://api.github.com/repos/$REPO/releases/tags/$TAG" \
9 | | jq -r '.assets[] | select(.name | endswith("img.gz")) | .browser_download_url')
10 | # 保存位置
11 | mkdir -p imm
12 | OUTPUT_PATH="imm/esiropenwrt.img.gz"
13 |
14 | if [ -z "$DOWNLOAD_URLS" ]; then
15 | echo "Error: No .img.gz files found under tag $TAG"
16 | exit 1
17 | fi
18 |
19 | FIRST_DOWNLOAD_URL=$(echo "$DOWNLOAD_URLS" | head -n1)
20 | echo "下载地址: $FIRST_DOWNLOAD_URL"
21 | curl -L -o "$OUTPUT_PATH" "$FIRST_DOWNLOAD_URL"
22 |
23 | if [[ $? -eq 0 ]]; then
24 | echo "下载esiropenwrt成功!"
25 | file imm/esiropenwrt.img.gz
26 | echo "正在解压为:esiropenwrt.img"
27 | gzip -d imm/esiropenwrt.img.gz
28 | ls -lh imm/
29 | echo "准备合成 eSirOpenWrt 安装器"
30 | else
31 | echo "下载失败!"
32 | exit 1
33 | fi
34 |
35 | mkdir -p output
36 | docker run --privileged --rm \
37 | -v $(pwd)/output:/output \
38 | -v $(pwd)/supportFiles:/supportFiles:ro \
39 | -v $(pwd)/imm/esiropenwrt.img:/mnt/esiropenwrt.img \
40 | debian:buster \
41 | /supportFiles/esirplayground/build.sh
--------------------------------------------------------------------------------
/ezopwrt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | REPO="sirpdboy/openwrt"
4 | TAG=$(curl -sL "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name // empty')
5 | [ -z "$TAG" ] && TAG=$(curl -sL "https://api.github.com/repos/$REPO/tags" | jq -r '.[0].name')
6 | echo "最新TAG: $TAG"
7 | # 获取该 Tag 下所有以 .img.gz 结尾的文件
8 | DOWNLOAD_URLS=$(curl -sL "https://api.github.com/repos/$REPO/releases/tags/$TAG" \
9 | | jq -r '.assets[] | select(.name | endswith("img.gz")) | .browser_download_url')
10 | # 保存位置
11 | mkdir -p imm
12 | OUTPUT_PATH="imm/ezopwrt.img.gz"
13 |
14 | if [ -z "$DOWNLOAD_URLS" ]; then
15 | echo "Error: No .img.gz files found under tag $TAG"
16 | exit 1
17 | fi
18 |
19 | FIRST_DOWNLOAD_URL=$(echo "$DOWNLOAD_URLS" | head -n1)
20 | echo "下载地址: $FIRST_DOWNLOAD_URL"
21 | curl -L -o "$OUTPUT_PATH" "$FIRST_DOWNLOAD_URL"
22 |
23 | if [[ $? -eq 0 ]]; then
24 | echo "下载ezopwrt成功!"
25 | file imm/ezopwrt.img.gz
26 | echo "正在解压为:ezopwrt.img"
27 | gzip -d imm/ezopwrt.img.gz
28 | ls -lh imm/
29 | echo "准备合成 EzOpWrt 安装器"
30 | else
31 | echo "下载失败!"
32 | exit 1
33 | fi
34 |
35 | mkdir -p output
36 | docker run --privileged --rm \
37 | -v $(pwd)/output:/output \
38 | -v $(pwd)/supportFiles:/supportFiles:ro \
39 | -v $(pwd)/imm/ezopwrt.img:/mnt/ezopwrt.img \
40 | debian:buster \
41 | /supportFiles/ezopwrt/build.sh
42 |
--------------------------------------------------------------------------------
/haos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 |
4 | # 校验参数是否存在
5 | if [ -z "$1" ]; then
6 | echo "❌ 错误:未提供下载地址!"
7 | exit 1
8 | fi
9 |
10 | mkdir -p imm
11 | DOWNLOAD_URL="$1"
12 | filename=$(basename "$DOWNLOAD_URL") # 从 URL 提取文件名
13 | OUTPUT_PATH="imm/$filename"
14 |
15 | echo "下载地址: $DOWNLOAD_URL"
16 | echo "保存路径: $OUTPUT_PATH"
17 |
18 | # 下载文件
19 | if ! curl -k -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"; then
20 | echo "❌ 下载失败!"
21 | exit 1
22 | fi
23 |
24 | echo "✅ 下载成功!"
25 | file "$OUTPUT_PATH"
26 |
27 | # 根据扩展名解压
28 | extension="${filename##*.}" # 获取文件扩展名
29 | case $extension in
30 | gz)
31 | echo "gz正在解压$OUTPUT_PATH"
32 | gunzip -f "$OUTPUT_PATH" || true
33 | final_name=$(find imm -name '*.img' -print -quit)
34 | mv "$final_name" "imm/haos.img"
35 | ;;
36 | zip)
37 | echo "zip正在解压$OUTPUT_PATH"
38 | unzip -j -o "$OUTPUT_PATH" -d imm/ # -j 忽略目录结构
39 | final_name=$(find imm -name '*.img' -print -quit)
40 | mv "$final_name" "imm/haos.img"
41 | ;;
42 | xz)
43 | echo "xz正在解压$OUTPUT_PATH"
44 | xz -d --keep "$OUTPUT_PATH" # 保留原文件
45 | final_name="${OUTPUT_PATH%.*}"
46 | mv "$final_name" "imm/haos.img"
47 | ;;
48 | *)
49 | echo "❌ 不支持的压缩格式: $extension"
50 | exit 1
51 | ;;
52 | esac
53 |
54 |
55 | # 检查最终文件
56 | if [ -f "imm/haos.img" ]; then
57 | echo "✅ 解压成功"
58 | ls -lh imm/
59 | echo "✅ 准备合成 自定义HAOS 安装器"
60 | else
61 | echo "❌ 错误:最终文件 imm/haos.img 不存在"
62 | exit 1
63 | fi
64 |
65 | mkdir -p output
66 | docker run --privileged --rm \
67 | -v $(pwd)/output:/output \
68 | -v $(pwd)/supportFiles:/supportFiles:ro \
69 | -v $(pwd)/imm/haos.img:/mnt/haos.img \
70 | debian:buster \
71 | /supportFiles/haos/build.sh
72 |
--------------------------------------------------------------------------------
/imm.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p imm
3 | #https://github.com/wukongdaily/AutoBuildImmortalWrt/releases/download/Autobuild-x86-64/immortalwrt-24.10.0-x86-64-generic-squashfs-combined-efi.img.gz
4 |
5 | REPO="wukongdaily/AutoBuildImmortalWrt"
6 | TAG="img-installer"
7 | FILE_NAME="immortalwrt-24.10.1-x86-64-generic-squashfs-combined-efi.img.gz"
8 | OUTPUT_PATH="imm/immortalwrt.img.gz"
9 |
10 | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == "'"$FILE_NAME"'") | .browser_download_url')
11 |
12 | # 此处可以替换op固件下载地址,但必须是 直链才可以,网盘那种地址是不行滴。举3个例子
13 | # 原版OpenWrt
14 | # DOWNLOAD_URL="https://downloads.openwrt.org/releases/24.10.0/targets/x86/64/openwrt-24.10.0-x86-64-generic-squashfs-combined-efi.img.gz"
15 | # 原版immortalwrt
16 | # DOWNLOAD_URL="https://downloads.immortalwrt.org/releases/24.10.0/targets/x86/64/immortalwrt-24.10.0-x86-64-generic-squashfs-combined-efi.img.gz"
17 | # 原版KWRT
18 | # DOWNLOAD_URL="https://dl.openwrt.ai/releases/24.10/targets/x86/64/kwrt-03.08.2025-x86-64-generic-squashfs-combined-efi.img.gz"
19 |
20 | if [[ -z "$DOWNLOAD_URL" ]]; then
21 | echo "错误:未找到文件 $FILE_NAME"
22 | exit 1
23 | fi
24 |
25 | echo "下载地址: $DOWNLOAD_URL"
26 | echo "下载文件: $FILE_NAME -> $OUTPUT_PATH"
27 | curl -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"
28 |
29 | if [[ $? -eq 0 ]]; then
30 | echo "下载immortalwrt-24.10.1成功!"
31 | file imm/immortalwrt.img.gz
32 | echo "正在解压为:immortalwrt.img"
33 | gzip -d imm/immortalwrt.img.gz
34 | ls -lh imm/
35 | echo "准备合成 immortalwrt 安装器"
36 | else
37 | echo "下载失败!"
38 | exit 1
39 | fi
40 |
41 | mkdir -p output
42 | docker run --privileged --rm \
43 | -v $(pwd)/output:/output \
44 | -v $(pwd)/supportFiles:/supportFiles:ro \
45 | -v $(pwd)/imm/immortalwrt.img:/mnt/immortalwrt.img \
46 | debian:buster \
47 | /supportFiles/immortalwrt/build.sh
48 |
--------------------------------------------------------------------------------
/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 此安装器本身的Debian Live系统SSH用户名:root 密码:1234
5 | #### 安装器中的Armbian系统
6 | #### web地址:插好网线 详见屏幕信息
7 | #### ssh默认用户名 `root` 密码:1234
8 | #### Armbian镜像出处:https://github.com/wukongdaily/armbian-installer/releases/tag/2025-03-12
9 |
--------------------------------------------------------------------------------
/istoreos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | mkdir -p openwrt
3 |
4 | REPO="wukongdaily/armbian-installer"
5 | TAG="2025-03-12"
6 | FILE_NAME="istoreos-22.03.7-2025040711-x86-64-squashfs-combined-efi.img.gz"
7 | OUTPUT_PATH="openwrt/istoreos.img.gz"
8 | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == "'"$FILE_NAME"'") | .browser_download_url')
9 |
10 | if [[ -z "$DOWNLOAD_URL" ]]; then
11 | echo "错误:未找到文件 $FILE_NAME"
12 | exit 1
13 | fi
14 |
15 | echo "下载地址: $DOWNLOAD_URL"
16 | echo "下载文件: $FILE_NAME -> $OUTPUT_PATH"
17 | curl -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"
18 |
19 | if [[ $? -eq 0 ]]; then
20 | echo "下载istoreos成功!"
21 | echo "正在解压为:istoreos.img"
22 | gzip -d openwrt/istoreos.img.gz
23 | ls -lh openwrt/
24 | echo "准备合成 istoreos 安装器"
25 | else
26 | echo "下载失败!"
27 | exit 1
28 | fi
29 |
30 | mkdir -p output
31 | docker run --privileged --rm \
32 | -v $(pwd)/output:/output \
33 | -v $(pwd)/supportFiles:/supportFiles:ro \
34 | -v $(pwd)/openwrt/istoreos.img:/mnt/istoreos.img \
35 | debian:buster \
36 | /supportFiles/istoreos/build.sh
37 |
--------------------------------------------------------------------------------
/supportFiles/99-dhcp-en.network:
--------------------------------------------------------------------------------
1 | [Match]
2 | Name=e*
3 |
4 | [Network]
5 | DHCP=yes
6 |
7 | [DHCP]
8 | ClientIdentifier=mac
9 |
10 |
--------------------------------------------------------------------------------
/supportFiles/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | sgdisk --move-second-header "/mnt/armbian.img"
51 | cp /mnt/armbian.img ${HOME}/LIVE_BOOT/chroot/mnt/
52 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
53 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
54 |
55 | echo Copy kernel and initrd
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
57 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
58 |
59 | echo Copy boot config files
60 | cp -v /supportFiles/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
61 | cp -v /supportFiles/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
62 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
63 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
64 |
65 | echo Copy boot images
66 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
68 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
69 |
70 | echo Make UEFI grub files
71 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
72 |
73 | cd $HOME/LIVE_BOOT/staging/EFI/boot
74 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
75 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
76 | /sbin/mkfs.vfat efiboot.img
77 | mmd -i efiboot.img efi efi/boot
78 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
79 |
80 | echo Build ISO
81 | xorriso \
82 | -as mkisofs \
83 | -iso-level 3 \
84 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
85 | -full-iso9660-filenames \
86 | -volid "DEBIAN_CUSTOM" \
87 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
88 | -eltorito-boot \
89 | isolinux/isolinux.bin \
90 | -no-emul-boot \
91 | -boot-load-size 4 \
92 | -boot-info-table \
93 | --eltorito-catalog isolinux/isolinux.cat \
94 | -eltorito-alt-boot \
95 | -e /EFI/boot/efiboot.img \
96 | -no-emul-boot \
97 | -isohybrid-gpt-basdat \
98 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
99 | "${HOME}/LIVE_BOOT/staging"
100 |
101 | echo Copy output
102 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/armbian-installer-x86_64-standard.iso
103 | chmod -v 666 /output/armbian-installer-x86_64-standard.iso
104 | ls -lah /output
105 |
--------------------------------------------------------------------------------
/supportFiles/custom/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/custom/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/custom.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/custom/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/custom/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/custom-installer-x86_64.iso
102 | chmod -v 666 /output/custom-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/custom/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "=========================================="
6 | echo " Custom OpenWrt Installer by wukongdaily"
7 | echo "=========================================="
8 | echo "1. Install Custom OpenWrt"
9 | echo "0. Quit"
10 | echo "====================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "Custom OpenWrt installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "custom.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/custom/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "Custom OpenWrt x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/custom/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的Custom OpenWrt
5 | #### 固件地址:
6 | #### 用户名: 密码:
7 | #### 默认软件包大小:
--------------------------------------------------------------------------------
/supportFiles/custom/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL Custom OpenWrt Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "====================================="
6 | echo " Armbian x86-UEFI Installer by wukongdaily"
7 | echo "====================================="
8 | echo "1. Install Armbian x86-UEFI"
9 | echo "0. Quit"
10 | echo "====================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "Armbian installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "armbian.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/esirplayground/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/esirplayground/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/esiropenwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/esirplayground/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/esirplayground/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/esiropenwrt-installer-x86_64.iso
102 | chmod -v 666 /output/esiropenwrt-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/esirplayground/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "====================================================="
6 | echo " eSirPlayGround OpenWrt Installer by wukongdaily"
7 | echo "====================================================="
8 | echo "1. Install eSirPlayGround OpenWrt GDQ"
9 | echo "0. Quit"
10 | echo "====================================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "eSirOpenWrt installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "esiropenwrt.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/esirplayground/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "eSirPlayGround OpenWrt x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/esirplayground/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的openwrt-gdq-version-v1.2025.-x86-64-generic-squashfs-uefi.img.gz
5 | #### 固件地址 `192.168.5.1`
6 | #### 用户名 `root` 密码:无
7 | #### 默认软件包大小 1GB
8 | #### 内核版本6.6.73
9 | #### Luci 版本24.10.0 firewall4
10 |
11 | - 固件出处:https://t.me/esirplayground
--------------------------------------------------------------------------------
/supportFiles/esirplayground/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL eSirPlayGround OpenWrt Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/ezopwrt/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/ezopwrt/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/ezopwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/ezopwrt/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/ezopwrt/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/ezopwrt-installer-x86_64.iso
102 | chmod -v 666 /output/ezopwrt-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/ezopwrt/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "====================================="
6 | echo " EzOpWrt Installer by wukongdaily"
7 | echo "====================================="
8 | echo "1. Install EzOpWrt Vip-Super"
9 | echo "0. Quit"
10 | echo "====================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "EzOpWrt installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "ezopwrt.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/ezopwrt/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "EzOpWrt x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/ezopwrt/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的EzOpWrt Vip-Super 24.10
5 | #### 固件地址 `192.168.10.1`
6 | #### 用户名 `root` 密码:无
7 | #### 默认软件包大小 2GB
8 |
9 | - 固件出处:https://github.com/sirpdboy/openwrt/releases/
--------------------------------------------------------------------------------
/supportFiles/ezopwrt/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL EzOpWrt Vip-Super Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/grub-standalone.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 | set prefix=($root)/boot/grub/
3 | configfile /boot/grub/grub.cfg
4 |
--------------------------------------------------------------------------------
/supportFiles/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "Armbian x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/haos/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/haos/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/haos.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/haos/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/haos/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/haos-installer-x86_64.iso
102 | chmod -v 666 /output/haos-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/haos/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "=========================================="
6 | echo " HAOS Installer by wukongdaily"
7 | echo "=========================================="
8 | echo "1. Install HAOS"
9 | echo "0. Quit"
10 | echo "====================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "HAOS installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "haos.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/haos/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "HAOS x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/haos/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的haos-installer-x86_64.iso 用于快速安装HAOS
5 | #### 默认版本15.0 haos_generic-x86-64-15.0.img.xz
6 | #### 出处:https://github.com/home-assistant/operating-system/releases/
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/supportFiles/haos/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL HAOS Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/immortalwrt/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/immortalwrt/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/immortalwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/immortalwrt/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/immortalwrt/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/immortalwrt-installer-x86_64.iso
102 | chmod -v 666 /output/immortalwrt-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/immortalwrt/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "====================================="
6 | echo " Immortalwrt Installer by wukongdaily"
7 | echo "====================================="
8 | echo "1. Install Immortalwrt 24.10.1 (1GB)"
9 | echo "0. Quit"
10 | echo "====================================="
11 | }
12 |
13 | detect_disk() {
14 | # Get all available disks
15 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
16 |
17 | # Error handling
18 | if [ ${#disks[@]} -eq 0 ]; then
19 | echo "Error: No available disk devices detected!" >&2
20 | exit 1
21 | fi
22 |
23 | # Display disk list with sizes
24 | echo "Available disks:" >&2
25 | for i in "${!disks[@]}"; do
26 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
27 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
28 | done
29 |
30 | # User selection logic
31 | while true; do
32 | read -p "Select target disk number (1-${#disks[@]}): " choice
33 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
34 | selected_disk="${disks[choice-1]}"
35 | echo "[Security Notice] Selected disk: $selected_disk" >&2
36 | echo "$selected_disk"
37 | return
38 | else
39 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
40 | fi
41 | done
42 | }
43 |
44 | confirm_danger() {
45 | local target_disk=$1
46 | local image_file=$2
47 |
48 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
49 | echo "──────────────────────────────────────"
50 | echo "Target device: $target_disk"
51 | echo "Image file: $image_file"
52 | echo "──────────────────────────────────────"
53 | echo "This will ERASE ALL DATA on $target_disk!"
54 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
55 |
56 | if [ "$confirm" != "YES" ]; then
57 | echo "Operation cancelled"
58 | exit 0
59 | fi
60 |
61 | }
62 |
63 | install_system() {
64 | local image_name=$1
65 | local image_file="/mnt/$image_name"
66 | local target_disk
67 |
68 | # Get user-selected disk
69 | target_disk=$(detect_disk)
70 |
71 | # Display disk information
72 | echo -e "\nDisk Information:"
73 | fdisk -l "$target_disk" | grep Disk | head -1
74 |
75 | # Check image file existence
76 | if [ ! -f "$image_file" ]; then
77 | echo -e "\nError: Image file $image_file not found!"
78 | echo "Please:"
79 | echo "1. Place the image file in /mnt directory"
80 | echo "2. Verify file permissions"
81 | exit 1
82 | fi
83 |
84 | # Final confirmation
85 | confirm_danger "$target_disk" "$image_file"
86 |
87 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
88 | sleep 2
89 |
90 | # Perform write operation
91 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
92 |
93 | echo "──────────────────────────────────────"
94 | echo "Immortalwrt installed successfully:"
95 | }
96 |
97 | while true; do
98 | show_menu
99 | read -p "Enter your choice [0-1]: " choice
100 |
101 | case $choice in
102 | 1)
103 | install_system "immortalwrt.img"
104 | break
105 | ;;
106 | 0)
107 | echo "Exiting installer"
108 | exit 0
109 | ;;
110 | *)
111 | echo "Invalid option, please try again"
112 | sleep 2
113 | ;;
114 | esac
115 | done
--------------------------------------------------------------------------------
/supportFiles/immortalwrt/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "ImmortalWrt x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/immortalwrt/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的Immortalwrt 24.10.1 x86-64-efi
5 | #### 固件地址 `192.168.100.1`
6 | #### 用户名 `root` 密码:无
7 | #### 默认软件包大小 1GB
8 | #### 默认带docker
9 | #### 下列属性刷机前必读
10 |
11 | - 该固件刷入【单网口设备】默认采用DHCP模式,自动获得ip。类似NAS的做法
12 | - 该固件刷入【多网口设备】默认WAN口采用DHCP模式,LAN 口ip为 192.168.100.1
13 | - 其中eth0为WAN 其余网口均为LAN (自动将剩余其他网口桥接 无需手动)
14 | - 默认情况下 只要你知道wan口分配的ip 就能访问web页
15 | - immortalwrt终端中使用 `ip a` 可查看网口信息
16 |
--------------------------------------------------------------------------------
/supportFiles/immortalwrt/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL ImmortalWrt 24.10 Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/installChroot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This shell script is executed inside the chroot
3 |
4 | echo Set hostname
5 | echo "installer" > /etc/hostname
6 |
7 | # Set as non-interactive so apt does not prompt for user input
8 | export DEBIAN_FRONTEND=noninteractive
9 |
10 | echo Install security updates and apt-utils
11 | apt-get update
12 | apt-get -y install apt-utils
13 | apt-get -y upgrade
14 |
15 | echo Set locale
16 | apt-get -y install locales
17 | sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
18 | dpkg-reconfigure --frontend=noninteractive locales
19 | update-locale LANG=en_US.UTF-8
20 |
21 | echo Install packages
22 | apt-get install -y --no-install-recommends linux-image-amd64 live-boot systemd-sysv
23 | apt-get install -y parted openssh-server bash-completion cifs-utils curl dbus dosfstools firmware-linux-free gddrescue gdisk iputils-ping isc-dhcp-client less nfs-common ntfs-3g openssh-client open-vm-tools procps vim wimtools wget
24 |
25 | echo Clean apt post-install
26 | apt-get clean
27 |
28 | echo Enable systemd-networkd as network manager
29 | systemctl enable systemd-networkd
30 |
31 | echo Set resolv.conf to use systemd-resolved
32 | rm /etc/resolv.conf
33 | ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
34 |
35 | echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
36 | echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
37 | echo "root:1234" | chpasswd
38 | systemctl enable ssh
39 |
40 | echo Remove machine-id
41 | rm /etc/machine-id
42 |
43 | echo List installed packages
44 | dpkg --get-selections|tee /packages.txt
45 |
--------------------------------------------------------------------------------
/supportFiles/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL Armbian Installer
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/istoreos/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Based from https://willhaley.com/blog/custom-debian-live-environment/
3 |
4 | echo Install required tools
5 | apt-get update
6 | apt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted
7 |
8 | echo Create directory where we will make the image
9 | mkdir -p $HOME/LIVE_BOOT
10 |
11 | echo Install Debian
12 | debootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://ftp.us.debian.org/debian/
13 |
14 | echo Copy supporting documents into the chroot
15 | cp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh
16 | cp -v /supportFiles/istoreos/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd
17 | chmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd
18 | cp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list
19 |
20 | echo Mounting dev / proc / sys
21 | mount -t proc none $HOME/LIVE_BOOT/chroot/proc
22 | mount -o bind /dev $HOME/LIVE_BOOT/chroot/dev
23 | mount -o bind /sys $HOME/LIVE_BOOT/chroot/sys
24 |
25 | echo Run install script inside chroot
26 | chroot $HOME/LIVE_BOOT/chroot /installChroot.sh
27 |
28 | echo Cleanup chroot
29 | rm -v $HOME/LIVE_BOOT/chroot/installChroot.sh
30 | mv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt
31 |
32 | echo Copy in systemd-networkd config
33 | cp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
34 | chown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
35 | chmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network
36 |
37 | echo Enable autologin
38 | mkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/
39 | cp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf
40 |
41 | echo Unmounting dev / proc / sys
42 | umount $HOME/LIVE_BOOT/chroot/proc
43 | umount $HOME/LIVE_BOOT/chroot/dev
44 | umount $HOME/LIVE_BOOT/chroot/sys
45 |
46 | echo Create directories that will contain files for our live environment files and scratch files.
47 | mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}
48 |
49 | echo Compress the chroot environment into a Squash filesystem.
50 | cp /mnt/istoreos.img ${HOME}/LIVE_BOOT/chroot/mnt/
51 | ls ${HOME}/LIVE_BOOT/chroot/mnt/
52 | mksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot
53 |
54 | echo Copy kernel and initrd
55 | cp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz
56 | cp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd
57 |
58 | echo Copy boot config files
59 | cp -v /supportFiles/istoreos/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg
60 | cp -v /supportFiles/istoreos/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg
61 | cp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg
62 | touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM
63 |
64 | echo Copy boot images
65 | cp -v /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/"
66 | cp -v /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/"
67 | cp -v -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/"
68 |
69 | echo Make UEFI grub files
70 | grub-mkstandalone --format=x86_64-efi --output=$HOME/LIVE_BOOT/tmp/bootx64.efi --locales="" --fonts="" "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg"
71 |
72 | cd $HOME/LIVE_BOOT/staging/EFI/boot
73 | SIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`
74 | dd if=/dev/zero of=efiboot.img bs=$SIZE count=1
75 | /sbin/mkfs.vfat efiboot.img
76 | mmd -i efiboot.img efi efi/boot
77 | mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/
78 |
79 | echo Build ISO
80 | xorriso \
81 | -as mkisofs \
82 | -iso-level 3 \
83 | -o "${HOME}/LIVE_BOOT/debian-custom.iso" \
84 | -full-iso9660-filenames \
85 | -volid "DEBIAN_CUSTOM" \
86 | -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
87 | -eltorito-boot \
88 | isolinux/isolinux.bin \
89 | -no-emul-boot \
90 | -boot-load-size 4 \
91 | -boot-info-table \
92 | --eltorito-catalog isolinux/isolinux.cat \
93 | -eltorito-alt-boot \
94 | -e /EFI/boot/efiboot.img \
95 | -no-emul-boot \
96 | -isohybrid-gpt-basdat \
97 | -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \
98 | "${HOME}/LIVE_BOOT/staging"
99 |
100 | echo Copy output
101 | cp -v $HOME/LIVE_BOOT/debian-custom.iso /output/istoreos-installer-x86_64.iso
102 | chmod -v 666 /output/istoreos-installer-x86_64.iso
103 | ls -lah /output
104 |
--------------------------------------------------------------------------------
/supportFiles/istoreos/ddd:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | show_menu() {
4 | clear
5 | echo "================================================="
6 | echo " iStoreOS Installer for all virtual machine"
7 | echo " by wukongdaily"
8 | echo "================================================="
9 | echo "1. Install iStoreOS"
10 | echo "0. Quit"
11 | echo "================================================="
12 | }
13 |
14 | detect_disk() {
15 | # Get all available disks
16 | local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == "disk" && $2 == "0" {print "/dev/"$1}'))
17 |
18 | # Error handling
19 | if [ ${#disks[@]} -eq 0 ]; then
20 | echo "Error: No available disk devices detected!" >&2
21 | exit 1
22 | fi
23 |
24 | # Display disk list with sizes
25 | echo "Available disks:" >&2
26 | for i in "${!disks[@]}"; do
27 | size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf "%.2f GB", $1/1000000000}')
28 | printf "%2d. %-12s %8s\n" $((i+1)) "${disks[i]}" "$size" >&2
29 | done
30 |
31 | # User selection logic
32 | while true; do
33 | read -p "Select target disk number (1-${#disks[@]}): " choice
34 | if [[ "$choice" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then
35 | selected_disk="${disks[choice-1]}"
36 | echo "[Security Notice] Selected disk: $selected_disk" >&2
37 | echo "$selected_disk"
38 | return
39 | else
40 | echo "Invalid input. Please enter a valid number between 1-${#disks[@]}"
41 | fi
42 | done
43 | }
44 |
45 | confirm_danger() {
46 | local target_disk=$1
47 | local image_file=$2
48 |
49 | echo "!! DANGEROUS OPERATION CONFIRMATION !!"
50 | echo "──────────────────────────────────────"
51 | echo "Target device: $target_disk"
52 | echo "Image file: $image_file"
53 | echo "──────────────────────────────────────"
54 | echo "This will ERASE ALL DATA on $target_disk!"
55 | read -p "Confirm write operation? (Type uppercase YES to proceed): " confirm
56 |
57 | if [ "$confirm" != "YES" ]; then
58 | echo "Operation cancelled"
59 | exit 0
60 | fi
61 |
62 | }
63 |
64 | install_system() {
65 | local image_name=$1
66 | local image_file="/mnt/$image_name"
67 | local target_disk
68 |
69 | # Get user-selected disk
70 | target_disk=$(detect_disk)
71 |
72 | # Display disk information
73 | echo -e "\nDisk Information:"
74 | fdisk -l "$target_disk" | grep Disk | head -1
75 |
76 | # Check image file existence
77 | if [ ! -f "$image_file" ]; then
78 | echo -e "\nError: Image file $image_file not found!"
79 | echo "Please:"
80 | echo "1. Place the image file in /mnt directory"
81 | echo "2. Verify file permissions"
82 | exit 1
83 | fi
84 |
85 | # Final confirmation
86 | confirm_danger "$target_disk" "$image_file"
87 |
88 | echo -e "\nStarting system write... (Press Ctrl+C to cancel)"
89 | sleep 2
90 |
91 | # Perform write operation
92 | dd if="$image_file" of="$target_disk" bs=4M conv=fsync status=progress
93 |
94 | echo "──────────────────────────────────────"
95 | echo "iStoreOS installed successfully:"
96 | }
97 |
98 | while true; do
99 | show_menu
100 | read -p "Enter your choice [0-1]: " choice
101 |
102 | case $choice in
103 | 1)
104 | install_system "istoreos.img"
105 | break
106 | ;;
107 | 0)
108 | echo "Exiting installer"
109 | exit 0
110 | ;;
111 | *)
112 | echo "Invalid option, please try again"
113 | sleep 2
114 | ;;
115 | esac
116 | done
--------------------------------------------------------------------------------
/supportFiles/istoreos/grub.cfg:
--------------------------------------------------------------------------------
1 | search --set=root --file /DEBIAN_CUSTOM
2 |
3 | set default="0"
4 | set timeout=5
5 |
6 | # If X has issues finding screens, experiment with/without nomodeset.
7 | # Load EFI video drivers. This device is EFI so keep the
8 | # video mode while booting the linux kernel.
9 |
10 | insmod efi_gop
11 | insmod font
12 | if loadfont ${prefix}/fonts/unicode.pf2
13 | then
14 | insmod gfxterm
15 | set gfxmode=auto
16 | set gfxpayload=keep
17 | terminal_output gfxterm
18 | fi
19 |
20 | menuentry "iStoreOS x86-UEFI Installer [EFI/GRUB]" {
21 | linux ($root)/live/vmlinuz boot=live
22 | initrd ($root)/live/initrd
23 | }
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/supportFiles/istoreos/info.md:
--------------------------------------------------------------------------------
1 | [](https://wkdaily.cpolar.top/archives/1)
2 |
3 | #### 适用范围:所有虚拟机和物理机
4 | #### 安装器中的iStoreOS
5 | #### 固件地址 `192.168.100.1`
6 | #### 用户名 `root` 密码:password
7 | #### 默认软件包大小 2GB
8 | #### 默认带docker
9 | #### 下列属性刷机前必读
10 |
11 | - 该固件刷入【单网口设备】默认采用DHCP模式,自动获得ip。类似NAS的做法
12 | - 该固件刷入【多网口设备】默认WAN口采用DHCP模式,LAN 口ip为 192.168.100.1
13 | - 其中eth0为WAN 其余网口均为LAN (自动将剩余其他网口桥接 无需手动)
14 | - iStoreOS终端中使用 `quickstart` 可查看网口信息
15 | - 默认情况下 只要你知道wan口分配的ip 就能访问web页 前提是你在`quickstart` 中启用了 `ALLOW WAN ACCESS`
16 | - 出处:https://fw0.koolcenter.com/iStoreOS/x86_64_efi/istoreos-22.03.7-2024122712-x86-64-squashfs-combined-efi.img.gz
17 |
--------------------------------------------------------------------------------
/supportFiles/istoreos/isolinux.cfg:
--------------------------------------------------------------------------------
1 | UI vesamenu.c32
2 |
3 | MENU TITLE Boot Menu
4 | DEFAULT linux
5 | TIMEOUT 50
6 | MENU RESOLUTION 640 480
7 | MENU COLOR border 30;44 #40ffffff #a0000000 std
8 | MENU COLOR title 1;36;44 #9033ccff #a0000000 std
9 | MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
10 | MENU COLOR unsel 37;44 #50ffffff #a0000000 std
11 | MENU COLOR help 37;40 #c0ffffff #a0000000 std
12 | MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
13 | MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
14 | MENU COLOR msg07 37;40 #90ffffff #a0000000 std
15 | MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
16 |
17 | LABEL linux
18 | MENU LABEL iStoreOS Installer for Virtual Machine
19 | MENU DEFAULT
20 | KERNEL /live/vmlinuz
21 | APPEND initrd=/live/initrd boot=live
--------------------------------------------------------------------------------
/supportFiles/override.conf:
--------------------------------------------------------------------------------
1 | [Service]
2 | ExecStart=
3 | ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
4 |
--------------------------------------------------------------------------------
/supportFiles/sources.list:
--------------------------------------------------------------------------------
1 | deb http://deb.debian.org/debian/ buster main
2 | deb-src http://deb.debian.org/debian/ buster main
3 |
4 | deb http://security.debian.org/debian-security buster/updates main
5 | deb-src http://security.debian.org/debian-security buster/updates main
6 |
7 | # buster-updates, previously known as 'volatile'
8 | deb http://deb.debian.org/debian/ buster-updates main
9 | deb-src http://deb.debian.org/debian/ buster-updates main
--------------------------------------------------------------------------------