[
  {
    "path": ".github/FUNDING.yml",
    "content": "\ncustom: https://wkdaily.cpolar.top/01\n"
  },
  {
    "path": ".github/workflows/build-custom.yml",
    "content": "name: \"Build Custom OpenWrt Installer ISO\"\n\non:\n  workflow_dispatch:\n    inputs:\n      download_url:\n        description: '请输入下载地址(扩展名 .img.gz/.img.xz/.img.zip)'\n        required: true\n        default: 'https://default.example.com/file.img.gz'\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n\n      - name: Set executable permissions\n        run: |\n          chmod +x \"${{ github.workspace }}/custom.sh\"\n          chmod +x \"${{ github.workspace }}/supportFiles/custom/build.sh\"\n\n      - name: Validate Download URL\n        run: |\n          DEFAULT_URL=\"https://default.example.com/file.img.gz\"\n          USER_INPUT_URL=\"${{ github.event.inputs.download_url }}\"\n          \n          if [[ \"$USER_INPUT_URL\" == \"$DEFAULT_URL\" ]]; then\n            echo \"❌ 错误：请修改默认下载地址！当前地址为无效占位符。\"\n            exit 1\n          fi\n          \n          if [[ ! \"$USER_INPUT_URL\" =~ ^https?://.+\\.[gG][zZ]$|^https?://.+\\.[xX][zZ]$|^https?://.+\\.[zZ][iI][pP]$ ]]; then\n            echo \"❌ 错误：地址需以 http(s) 开头且扩展名为 .gz/.xz/.zip\"\n            echo \"当前输入：$USER_INPUT_URL\"\n            exit 1\n          fi\n\n      - name: \"Build Image\"\n        run: |\n          download_url=\"${{ github.event.inputs.download_url }}\"\n          ./custom.sh \"$download_url\"\n\n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"Custom-Installer-x86_64-ISO\"\n          body_path: \"${{ github.workspace }}/supportFiles/custom/info.md\"\n          files: |\n            output/custom-installer-x86_64.iso\n          token: \"${{ secrets.GITHUB_TOKEN }}\""
  },
  {
    "path": ".github/workflows/build-esiropenwrt.yml",
    "content": "name: \"Build eSirOpenWrt Installer ISO\"\n\non:\n workflow_dispatch:\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n      - name: \"Get Date\"\n        run: |\n          echo \"DATESTAMP=$(date +'%Y-%m-%d')\" >> $GITHUB_ENV \n\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n      \n      - name: Set executable permissions\n        run: |\n          chmod +x ${{ github.workspace }}/esir.sh\n          chmod +x ${{ github.workspace }}/supportFiles/esirplayground/build.sh\n\n      - name: \"Build Image\"\n        run: |\n          ./esir.sh\n      \n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"eSirOpenWrt-Installer-x86_64-ISO\"\n          body_path: ${{ github.workspace }}/supportFiles/esirplayground/info.md\n          files: |\n            output/esiropenwrt-installer-x86_64.iso\n          token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/build-ezopwrt.yml",
    "content": "name: \"Build EzOpWrt Installer ISO\"\n\non:\n workflow_dispatch:\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n      - name: \"Get Date\"\n        run: |\n          echo \"DATESTAMP=$(date +'%Y-%m-%d')\" >> $GITHUB_ENV \n\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n      \n      - name: Set executable permissions\n        run: |\n          chmod +x ${{ github.workspace }}/ezopwrt.sh\n          chmod +x ${{ github.workspace }}/supportFiles/ezopwrt/build.sh\n\n      - name: \"Build Image\"\n        run: |\n          ./ezopwrt.sh\n      \n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"EzOpWrt-Installer-x86_64-ISO\"\n          body_path: ${{ github.workspace }}/supportFiles/ezopwrt/info.md\n          files: |\n            output/ezopwrt-installer-x86_64.iso\n          token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/build-haos.yml",
    "content": "name: \"Build HAOS Installer ISO\"\n\non:\n  workflow_dispatch:\n    inputs:\n      download_url:\n        description: '请输入haos下载地址(扩展名 .img.gz/.img.xz/.img.zip)'\n        required: true\n        default: 'https://github.com/home-assistant/operating-system/releases/download/15.0/haos_generic-x86-64-15.0.img.xz'\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n\n      - name: Set executable permissions\n        run: |\n          chmod +x \"${{ github.workspace }}/haos.sh\"\n          chmod +x \"${{ github.workspace }}/supportFiles/haos/build.sh\"\n\n      - name: Validate Download URL\n        run: |\n          USER_INPUT_URL=\"${{ github.event.inputs.download_url }}\"\n          \n          if [[ ! \"$USER_INPUT_URL\" =~ ^https?://.+\\.[gG][zZ]$|^https?://.+\\.[xX][zZ]$|^https?://.+\\.[zZ][iI][pP]$ ]]; then\n            echo \"❌ 错误：地址需以 http(s) 开头且扩展名为 .gz/.xz/.zip\"\n            echo \"当前输入：$USER_INPUT_URL\"\n            exit 1\n          fi\n\n      - name: \"Build Image\"\n        run: |\n          download_url=\"${{ github.event.inputs.download_url }}\"\n          ./haos.sh \"$download_url\"\n\n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"HAOS-Installer-x86_64-ISO\"\n          body_path: \"${{ github.workspace }}/supportFiles/haos/info.md\"\n          files: |\n            output/haos-installer-x86_64.iso\n          token: \"${{ secrets.GITHUB_TOKEN }}\""
  },
  {
    "path": ".github/workflows/build-imm.yml",
    "content": "name: \"Build ImmortalWrt Installer ISO\"\n\non:\n workflow_dispatch:\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n      - name: \"Get Date\"\n        run: |\n          echo \"DATESTAMP=$(date +'%Y-%m-%d')\" >> $GITHUB_ENV \n\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n      \n      - name: Set executable permissions\n        run: |\n          chmod +x ${{ github.workspace }}/imm.sh\n          chmod +x ${{ github.workspace }}/supportFiles/immortalwrt/build.sh\n\n      - name: \"Build Image\"\n        run: |\n          ./imm.sh\n      \n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"ImmortalWrt-Installer-x86_64-ISO\"\n          body_path: ${{ github.workspace }}/supportFiles/immortalwrt/info.md\n          files: |\n            output/immortalwrt-installer-x86_64.iso\n          token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/build-istoreos-24.10.1.yml",
    "content": "name: \"Build iStoreOS 24.10.1 Installer ISO\"\n\non:\n workflow_dispatch:\n\njobs:\n  build-release:\n    name: \"Build and Release\"\n    runs-on: \"ubuntu-22.04\"\n\n    steps:\n\n      - name: \"Checking out git repository\"\n        uses: actions/checkout@v2\n      \n      - name: Set executable permissions\n        run: |\n          chmod +x ${{ github.workspace }}/istoreos.sh\n          chmod +x ${{ github.workspace }}/supportFiles/istoreos/build.sh\n\n      - name: \"Build iStoreOS Installer ISO\"\n        run: |\n          ./istoreos.sh\n      \n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"iStoreOS-Installer-x86_64-ISO\"\n          body_path: ${{ github.workspace }}/supportFiles/istoreos/info.md\n          files: |\n            output/istoreos-installer-x86_64.iso\n          token: ${{ secrets.GITHUB_TOKEN }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: \"Build Armbian Installer ISO\"\n\non:\n  workflow_dispatch:\n    inputs:\n      version_type:\n        description: \"版本类型\"\n        required: true\n        default: \"standard\"\n        type: choice\n        options:\n          - \"standard\"\n          - \"debian12_minimal\"\n          - \"ubuntu24_minimal\"\n          - \"homeassistant_debian12_minimal\"\n\njobs:\n  build-release:\n    runs-on: ubuntu-22.04\n    env:\n      VERSION_TYPE: ${{ github.event.inputs.version_type }}\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Build Image\n        run: ./build.sh\n\n      - name: \"Prepare Release Assets\"\n        run: |\n          # 根据版本类型重命名ISO文件\n          if [ \"$VERSION_TYPE\" = \"debian12_minimal\" ]; then\n            mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-debian12_minimal.iso\n          fi\n\n          if [ \"$VERSION_TYPE\" = \"ubuntu24_minimal\" ]; then\n            mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-ubuntu24_minimal.iso\n          fi\n\n          if [ \"$VERSION_TYPE\" = \"homeassistant_debian12_minimal\" ]; then\n            mv output/armbian-installer-x86_64-standard.iso output/armbian-installer-x86_64-homeassistant_debian12_minimal.iso\n          fi\n          \n\n      - name: \"Publish\"\n        uses: softprops/action-gh-release@v2.2.1\n        with:\n          tag_name: \"Armbian-Installer-x86_64-ISO\"\n          body_path: ${{ github.workspace }}/info.md\n          files: |\n            output/armbian-installer-x86_64-${{ github.event.inputs.version_type }}.iso\n          token: ${{ secrets.GITHUB_TOKEN }}"
  },
  {
    "path": ".gitignore",
    "content": "**/output\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2021 Daniel William Powers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# img-installer\n它是一个基于Debian Live系统的img镜像安装器。采用github action构建打包。目前实现了在x86-64设备上 快速安装armbian和openwrt的功能。 \n![1](https://github.com/user-attachments/assets/6635cb83-6164-4be7-ab1e-fff421b3dc2f)\n\n\n## 背景解读\n- 嵌入式设备的系统通常采用img格式,一般出现在ARM设备中，安装方式通常是线刷、烧录SD卡等方式。\n- 但近年来，openwrt 和 armbian 也逐渐兼容适配通用型x86-64设备,随着软路由和NAS虚拟机逐渐普及。\n- 显然针对ARM设备的烧录方法 不太适合x86-64设备（含虚拟机）。无论是借助PE还是借助dd 都需要传递固件文件。显得低效和复杂。\n- 如何让openwrt/armbian 等小众x86-64的Linux系统 像安装普通系统一样简单呢 希望本项目给你一个满意的答案。\n\n## 使用方式\n[图文教学](https://club.fnnas.com/forum.php?mod=viewthread&tid=26293)\n1. 虚拟机使用：各种虚拟机直接选择iso即可\n2. 物理机使用：建议将iso放入ventoy的U盘中\n3. https://www.ventoy.net/cn/download.html\n4. 视频教学：[![YouTube](https://img.shields.io/badge/YouTube-123456?logo=youtube&labelColor=ff0000)](https://youtu.be/6FWyACrNQIg)\n[![Bilibili](https://img.shields.io/badge/Bilibili-123456?logo=bilibili&logoColor=fff&labelColor=fb7299)](https://www.bilibili.com/video/BV1DQXVYFENr)\n- 【第一集 ESXI虚拟机 和 物理机使用】https://youtu.be/6FWyACrNQIg   【B站】https://www.bilibili.com/video/BV1DQXVYFENr\n- 【第二集 飞牛NAS】https://youtu.be/RRBFc58SwXQ  【B站】https://www.bilibili.com/video/BV1gPXCYyEc2\n- 【第三集 Hyper-V、绿联NAS虚拟机、飞牛虚拟机使用教程】 https://www.bilibili.com/video/BV1BoZVYsE7b\n- 【第四集 PVE虚拟机里如何使用img安装器】https://www.bilibili.com/video/BV1Rx5Qz4EZB\n\n6. 具体的操作方法是:在安装器所在系统里输入 `ddd` 命令 方可调出安装菜单\n   ![localhost lan - VMware ESXi 2025-03-20 10-14-45](https://github.com/user-attachments/assets/ddae80a0-9ff5-4d63-83b5-1f49da18b008)\n\n\n## 项目说明和相关Feature\n1. 此项目生成的ISO同时 支持物理机 和 虚拟机的安装\n2. 此项目生成的安装器用于各种常见的img格式嵌入式系统:`OpenWrt`、`Armbian`、`HAOS`、`LibreELEC`等\n3. 其中OpenWrt分为istoreos、immortalwrt、EzOpWrt、eSirOpenWrt 安装器。实际上安装任意一种即可，因为换固件可在网页里随时换。\n4. istoreos 在虚拟机上并没有安装器,因此本项目算是一种补充。（物理机安装istoreos就可以忽略本项目了）\n5. armbian 安装器 目前构建2种 一种是minimal 一种是标准版 较低配置的x86-64设备建议使用minimal 比如（wyse3040瘦客户机）\n6. HAOS可自定义下载地址,默认构建HAOS 15.0 `haos_generic-x86-64-15.0.img.xz`\n7. 支持自定义openwrt镜像生成iso安装器,其中openwrt镜像的压缩包格式是`img.gz` `img.zip` `img.xz`三种\n\n\n\n## ISO自动制作流程\n本项目也是基于开源项目[debian-live](https://github.com/dpowers86/debian-live)制作.因此我的代码也是全程开源 MIT协议不变。\n1. 首先构建一个debian live系统 该系统带EFI引导。\n2. 在该系统内融入我们需要的img镜像和自己制作的dd写盘脚本。一起打包到filesystem.squashfs文件系统中。该过程包含了压缩,从而保证了最终的体积较小。\n3. 最后将新的squashfs文件和相关文件一起打包为ISO\n\n## 项目参考\n- https://willhaley.com/blog/custom-debian-live-environment/\n- https://github.com/dpowers86/debian-live\n- https://github.com/sirpdboy/openwrt/releases\n- https://github.com/esirplayground\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=wukongdaily/armbian-installer&type=Date)](https://star-history.com/#wukongdaily/armbian-installer&Date)\n\n\n\n## ❤️赞助作者 ⬇️⬇️\n#### 项目开发不易 感谢您的支持鼓励。<br>\n[![点击这里赞助我](https://img.shields.io/badge/点击这里赞助我-支持作者的项目-orange?logo=github)](https://wkdaily.cpolar.cn/01) <br>\n"
  },
  {
    "path": "autobuild/autobuild.sh",
    "content": "#!/bin/bash\n# 接受从AutoBuildImmortalWrt Action 过来的固件 制作为ISO\nmkdir -p imm\nRECEIVE_FILE=\"$1\"\nfilename=$(basename \"$RECEIVE_FILE\")  # 提取文件名\nOUTPUT_PATH=\"imm/$filename\"\nmv $RECEIVE_FILE $OUTPUT_PATH\necho \"保存路径: $OUTPUT_PATH\"\necho \"✅ 验证文件类型!\"\nfile \"$OUTPUT_PATH\"\n\n# 根据扩展名解压\nextension=\"${filename##*.}\"  # 获取文件扩展名\ncase $extension in\n  gz)\n    echo \"gz正在解压$OUTPUT_PATH\"\n    gunzip -f \"$OUTPUT_PATH\" || true\n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  zip)\n    echo \"zip正在解压$OUTPUT_PATH\"\n    unzip -j -o \"$OUTPUT_PATH\" -d imm/  # -j 忽略目录结构 \n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  xz)\n    echo \"xz正在解压$OUTPUT_PATH\"\n    xz -d --keep \"$OUTPUT_PATH\"  # 保留原文件 \n    final_name=\"${OUTPUT_PATH%.*}\"\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  *)\n    echo \"❌ 不支持的压缩格式: $extension\"\n    exit 1\n    ;;\nesac\n\n\n# 检查最终文件\nif [ -f \"imm/custom.img\" ]; then\n  echo \"✅ 解压成功\"\n  ls -lh imm/\n  echo \"✅ 准备合成 自定义OpenWrt 安装器\"\nelse\n  echo \"❌ 错误：最终文件 imm/custom.img 不存在\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n    -v $(pwd)/output:/output \\\n    -v $(pwd)/supportFiles:/supportFiles:ro \\\n    -v $(pwd)/imm/custom.img:/mnt/custom.img \\\n    debian:buster \\\n    /supportFiles/custom/build.sh\n"
  },
  {
    "path": "autobuild/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 格式ISO: 此文件是通过AutoBuildImmortalWrt项目构建的\n#### 适用范围：所有虚拟机和物理机通用 皆可引导 用于安装ImmortalWrt\n#### 使用方法：\n- 虚拟机使用：各种虚拟机直接选择iso 作为开机引导即可\n- 物理机使用：建议将iso放入ventoy的U盘中\n#### 运行ISO的中的debian live系统 大概10几秒后 输入命令 `ddd` 即可调用安装菜单\n<img width=\"50%\" height=\"50%\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b47821ed-dc1d-41b5-8a6e-814bf222a2f4\" />\n\n#### 安装后 默认情况 若没有更改 则固件信息如下\n- 用户名root 密码 无\n- 该固件刷入【单网口设备】默认采用DHCP模式,自动获得ip。类似NAS的做法 可在上一级路由器查询，若是虚拟机则输入 `ip a` 查看\n- 该固件刷入【多网口设备】默认WAN口采用DHCP模式，LAN 口ip为  `192.168.100.1 `其中eth0为WAN 其余网口均为LAN\n#### 为什么这样设计\n- 因为很多人在第一次刷入固件后 都做了很多重复的工作 要编辑`/etc/config/network` 不适合手残党和新手。而且我觉得每次这样修改有点傻 千年不变的糟糕用户体验要变一变 为什么不去web页面里修改呢 有界面操作更简单啊\n- 【单网口】设备直接就是自动获得ip 则不需要你每次都在命令行里修改了。尤其在虚拟机里，ip a 就能查看ip 用此ip就能访问。web页面在修改任何东西 都很简单了。尤其旁路用户 进web页再设置\n- 【多网口】设备用 192.168.100.1 访问web ui\n"
  },
  {
    "path": "build.sh",
    "content": "#!/bin/bash\nmkdir -p armbian\n\n# 读取环境变量 (带默认值)\nVERSION_TYPE=\"${VERSION_TYPE:-standard}\"\nif [ \"$VERSION_TYPE\" = \"debian12_minimal\" ]; then\n  echo \"构建debian12_minimal-armbian...\"\n  FILE_NAME=\"Armbian_25.2.1_Uefi-x86_bookworm_current_6.12.13_minimal.img.xz\"\nelif [ \"$VERSION_TYPE\" = \"ubuntu24_minimal\" ]; then\n  echo \"构建ubuntu24_minimal-armbian...\" \n  FILE_NAME=\"Armbian_25.2.1_Uefi-x86_noble_current_6.12.13_minimal.img.xz\"\nelif [ \"$VERSION_TYPE\" = \"homeassistant_debian12_minimal\" ]; then\n  echo \"构建homeassistant全家桶版armbian...\" \n  FILE_NAME=\"Armbian_25.2.3_Uefi-x86_bookworm_current_6.12.17-homeassistant_minimal.img.xz\"\nelse \n  echo \"构建standard-armbian...\"\n  FILE_NAME=\"Armbian_25.2.1_Uefi-x86_noble_current_6.12.13.img.xz\"\nfi\n\nREPO=\"wukongdaily/img-installer\"\nTAG=\"2025-03-12\"\nOUTPUT_PATH=\"armbian/armbian.img.xz\"\n\nDOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == \"'\"$FILE_NAME\"'\") | .browser_download_url')\n\nif [[ -z \"$DOWNLOAD_URL\" ]]; then\n  echo \"错误：未找到文件 $FILE_NAME\"\n  exit 1\nfi\n\necho \"下载地址: $DOWNLOAD_URL\"\necho \"下载文件: $FILE_NAME -> $OUTPUT_PATH\"\ncurl -L -o \"$OUTPUT_PATH\" \"$DOWNLOAD_URL\"\n\nif [[ $? -eq 0 ]]; then\n  echo \"下载armbian成功!\"\n  file armbian/armbian.img.xz\n  echo \"正在解压为:armbian.img\"\n  xz -d armbian/armbian.img.xz\n  ls -lh armbian/\n  echo \"准备合成 armbian 安装器\"\nelse\n  echo \"下载失败！\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/armbian/armbian.img:/mnt/armbian.img \\\n        debian:buster \\\n        /supportFiles/build.sh"
  },
  {
    "path": "custom.sh",
    "content": "#!/bin/bash\nset -euo pipefail  \n\n# 校验参数是否存在\nif [ -z \"$1\" ]; then\n  echo \"❌ 错误：未提供下载地址！\"\n  exit 1\nfi\n\nmkdir -p imm\nDOWNLOAD_URL=\"$1\"\nfilename=$(basename \"$DOWNLOAD_URL\")  # 从 URL 提取文件名\nOUTPUT_PATH=\"imm/$filename\"\n\necho \"下载地址: $DOWNLOAD_URL\"\necho \"保存路径: $OUTPUT_PATH\"\n\n# 下载文件\nif ! curl -k -L -o \"$OUTPUT_PATH\" \"$DOWNLOAD_URL\"; then\n  echo \"❌ 下载失败！\"\n  exit 1\nfi\n\necho \"✅ 下载成功!\"\nfile \"$OUTPUT_PATH\"\n\n# 根据扩展名解压\nextension=\"${filename##*.}\"  # 获取文件扩展名\ncase $extension in\n  gz)\n    echo \"gz正在解压$OUTPUT_PATH\"\n    gunzip -f \"$OUTPUT_PATH\" || true\n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  zip)\n    echo \"zip正在解压$OUTPUT_PATH\"\n    unzip -j -o \"$OUTPUT_PATH\" -d imm/  # -j 忽略目录结构 \n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  xz)\n    echo \"xz正在解压$OUTPUT_PATH\"\n    xz -d --keep \"$OUTPUT_PATH\"  # 保留原文件 \n    final_name=\"${OUTPUT_PATH%.*}\"\n    mv \"$final_name\" \"imm/custom.img\"\n    ;;\n  *)\n    echo \"❌ 不支持的压缩格式: $extension\"\n    exit 1\n    ;;\nesac\n\n\n# 检查最终文件\nif [ -f \"imm/custom.img\" ]; then\n  echo \"✅ 解压成功\"\n  ls -lh imm/\n  echo \"✅ 准备合成 自定义OpenWrt 安装器\"\nelse\n  echo \"❌ 错误：最终文件 imm/custom.img 不存在\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n    -v $(pwd)/output:/output \\\n    -v $(pwd)/supportFiles:/supportFiles:ro \\\n    -v $(pwd)/imm/custom.img:/mnt/custom.img \\\n    debian:buster \\\n    /supportFiles/custom/build.sh\n"
  },
  {
    "path": "debugBuild.sh",
    "content": "#!/bin/bash\nmkdir -p output\ndocker run --privileged -it --rm -v $(pwd)/output:/output -v $(pwd)/supportFiles:/supportFiles:ro -w /supportFiles debian:buster\n"
  },
  {
    "path": "esir.sh",
    "content": "#!/bin/bash\n\nREPO=\"wkccd/esirOpenWrt\"\nTAG=$(curl -sL \"https://api.github.com/repos/$REPO/releases/latest\" | jq -r '.tag_name // empty')\n[ -z \"$TAG\" ] && TAG=$(curl -sL \"https://api.github.com/repos/$REPO/tags\" | jq -r '.[0].name')\necho \"最新TAG: $TAG\"\n# 获取该 Tag 下所有以 .img.gz 结尾的文件\nDOWNLOAD_URLS=$(curl -sL \"https://api.github.com/repos/$REPO/releases/tags/$TAG\" \\\n  | jq -r '.assets[] | select(.name | endswith(\"img.gz\")) | .browser_download_url')\n# 保存位置\nmkdir -p imm\nOUTPUT_PATH=\"imm/esiropenwrt.img.gz\"\n\nif [ -z \"$DOWNLOAD_URLS\" ]; then\n  echo \"Error: No .img.gz files found under tag $TAG\"\n  exit 1\nfi\n\nFIRST_DOWNLOAD_URL=$(echo \"$DOWNLOAD_URLS\" | head -n1)\necho \"下载地址: $FIRST_DOWNLOAD_URL\"\ncurl -L -o \"$OUTPUT_PATH\" \"$FIRST_DOWNLOAD_URL\"\n\nif [[ $? -eq 0 ]]; then\n  echo \"下载esiropenwrt成功!\"\n  file imm/esiropenwrt.img.gz\n  echo \"正在解压为:esiropenwrt.img\"\n  gzip -d imm/esiropenwrt.img.gz\n  ls -lh imm/\n  echo \"准备合成 eSirOpenWrt 安装器\"\nelse\n  echo \"下载失败！\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/imm/esiropenwrt.img:/mnt/esiropenwrt.img \\\n        debian:buster \\\n        /supportFiles/esirplayground/build.sh"
  },
  {
    "path": "ezopwrt.sh",
    "content": "#!/bin/bash\n\nREPO=\"sirpdboy/openwrt\"\nTAG=$(curl -sL \"https://api.github.com/repos/$REPO/releases/latest\" | jq -r '.tag_name // empty')\n[ -z \"$TAG\" ] && TAG=$(curl -sL \"https://api.github.com/repos/$REPO/tags\" | jq -r '.[0].name')\necho \"最新TAG: $TAG\"\n# 获取该 Tag 下所有以 .img.gz 结尾的文件\nDOWNLOAD_URLS=$(curl -sL \"https://api.github.com/repos/$REPO/releases/tags/$TAG\" \\\n  | jq -r '.assets[] | select(.name | endswith(\"img.gz\")) | .browser_download_url')\n# 保存位置\nmkdir -p imm\nOUTPUT_PATH=\"imm/ezopwrt.img.gz\"\n\nif [ -z \"$DOWNLOAD_URLS\" ]; then\n  echo \"Error: No .img.gz files found under tag $TAG\"\n  exit 1\nfi\n\nFIRST_DOWNLOAD_URL=$(echo \"$DOWNLOAD_URLS\" | head -n1)\necho \"下载地址: $FIRST_DOWNLOAD_URL\"\ncurl -L -o \"$OUTPUT_PATH\" \"$FIRST_DOWNLOAD_URL\"\n\nif [[ $? -eq 0 ]]; then\n  echo \"下载ezopwrt成功!\"\n  file imm/ezopwrt.img.gz\n  echo \"正在解压为:ezopwrt.img\"\n  gzip -d imm/ezopwrt.img.gz\n  ls -lh imm/\n  echo \"准备合成 EzOpWrt 安装器\"\nelse\n  echo \"下载失败！\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/imm/ezopwrt.img:/mnt/ezopwrt.img \\\n        debian:buster \\\n        /supportFiles/ezopwrt/build.sh\n"
  },
  {
    "path": "haos.sh",
    "content": "#!/bin/bash\nset -euo pipefail  \n\n# 校验参数是否存在\nif [ -z \"$1\" ]; then\n  echo \"❌ 错误：未提供下载地址！\"\n  exit 1\nfi\n\nmkdir -p imm\nDOWNLOAD_URL=\"$1\"\nfilename=$(basename \"$DOWNLOAD_URL\")  # 从 URL 提取文件名\nOUTPUT_PATH=\"imm/$filename\"\n\necho \"下载地址: $DOWNLOAD_URL\"\necho \"保存路径: $OUTPUT_PATH\"\n\n# 下载文件\nif ! curl -k -L -o \"$OUTPUT_PATH\" \"$DOWNLOAD_URL\"; then\n  echo \"❌ 下载失败！\"\n  exit 1\nfi\n\necho \"✅ 下载成功!\"\nfile \"$OUTPUT_PATH\"\n\n# 根据扩展名解压\nextension=\"${filename##*.}\"  # 获取文件扩展名\ncase $extension in\n  gz)\n    echo \"gz正在解压$OUTPUT_PATH\"\n    gunzip -f \"$OUTPUT_PATH\" || true\n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/haos.img\"\n    ;;\n  zip)\n    echo \"zip正在解压$OUTPUT_PATH\"\n    unzip -j -o \"$OUTPUT_PATH\" -d imm/  # -j 忽略目录结构 \n    final_name=$(find imm -name '*.img' -print -quit)\n    mv \"$final_name\" \"imm/haos.img\"\n    ;;\n  xz)\n    echo \"xz正在解压$OUTPUT_PATH\"\n    xz -d --keep \"$OUTPUT_PATH\"  # 保留原文件 \n    final_name=\"${OUTPUT_PATH%.*}\"\n    mv \"$final_name\" \"imm/haos.img\"\n    ;;\n  *)\n    echo \"❌ 不支持的压缩格式: $extension\"\n    exit 1\n    ;;\nesac\n\n\n# 检查最终文件\nif [ -f \"imm/haos.img\" ]; then\n  echo \"✅ 解压成功\"\n  ls -lh imm/\n  echo \"✅ 准备合成 自定义HAOS 安装器\"\nelse\n  echo \"❌ 错误：最终文件 imm/haos.img 不存在\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/imm/haos.img:/mnt/haos.img \\\n        debian:buster \\\n        /supportFiles/haos/build.sh\n"
  },
  {
    "path": "imm.sh",
    "content": "#!/bin/bash\nmkdir -p imm\n#https://github.com/wukongdaily/AutoBuildImmortalWrt/releases/download/Autobuild-x86-64/immortalwrt-24.10.0-x86-64-generic-squashfs-combined-efi.img.gz\n\nREPO=\"wukongdaily/AutoBuildImmortalWrt\"\nTAG=\"img-installer\"\nFILE_NAME=\"immortalwrt-24.10.2-x86-64-generic-squashfs-combined-efi.img.gz\"\nOUTPUT_PATH=\"imm/immortalwrt.img.gz\"\n\nDOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == \"'\"$FILE_NAME\"'\") | .browser_download_url')\n\n# 此处可以替换op固件下载地址,但必须是 直链才可以,网盘那种地址是不行滴。举3个例子\n# 原版OpenWrt\n# 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\"\n# 原版immortalwrt\n# 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\"\n# 原版KWRT\n# DOWNLOAD_URL=\"https://dl.openwrt.ai/releases/24.10/targets/x86/64/kwrt-03.08.2025-x86-64-generic-squashfs-combined-efi.img.gz\"\n\nif [[ -z \"$DOWNLOAD_URL\" ]]; then\n  echo \"错误：未找到文件 $FILE_NAME\"\n  exit 1\nfi\n\necho \"下载地址: $DOWNLOAD_URL\"\necho \"下载文件: $FILE_NAME -> $OUTPUT_PATH\"\ncurl -L -o \"$OUTPUT_PATH\" \"$DOWNLOAD_URL\"\n\nif [[ $? -eq 0 ]]; then\n  echo \"下载immortalwrt-24.10.1成功!\"\n  file imm/immortalwrt.img.gz\n  echo \"正在解压为:immortalwrt.img\"\n  gzip -d imm/immortalwrt.img.gz\n  ls -lh imm/\n  echo \"准备合成 immortalwrt 安装器\"\nelse\n  echo \"下载失败！\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/imm/immortalwrt.img:/mnt/immortalwrt.img \\\n        debian:buster \\\n        /supportFiles/immortalwrt/build.sh\n"
  },
  {
    "path": "info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 此安装器本身的Debian Live系统SSH用户名:root 密码:1234\n#### 安装器中的Armbian系统\n#### web地址:插好网线 详见屏幕信息\n#### ssh默认用户名 `root` 密码：1234\n#### Armbian镜像出处:https://github.com/wukongdaily/armbian-installer/releases/tag/2025-03-12\n"
  },
  {
    "path": "istoreos.sh",
    "content": "#!/bin/bash\nmkdir -p openwrt\n\nREPO=\"wukongdaily/img-installer\"\nTAG=\"2025-03-12\"\nFILE_NAME=\"istoreos-24.10.1-2025060614-x86-64-squashfs-combined-efi.img.gz\"\nOUTPUT_PATH=\"openwrt/istoreos.img.gz\"\nDOWNLOAD_URL=$(curl -s https://api.github.com/repos/$REPO/releases/tags/$TAG | jq -r '.assets[] | select(.name == \"'\"$FILE_NAME\"'\") | .browser_download_url')\n\nif [[ -z \"$DOWNLOAD_URL\" ]]; then\n  echo \"错误：未找到文件 $FILE_NAME\"\n  exit 1\nfi\n\necho \"下载地址: $DOWNLOAD_URL\"\necho \"下载文件: $FILE_NAME -> $OUTPUT_PATH\"\ncurl -L -o \"$OUTPUT_PATH\" \"$DOWNLOAD_URL\"\n\nif [[ $? -eq 0 ]]; then\n  echo \"下载istoreos成功!\"\n  echo \"正在解压为:istoreos.img\"\n  gzip -d openwrt/istoreos.img.gz\n  ls -lh openwrt/\n  echo \"准备合成 istoreos 安装器\"\nelse\n  echo \"下载失败！\"\n  exit 1\nfi\n\nmkdir -p output\ndocker run --privileged --rm \\\n        -v $(pwd)/output:/output \\\n        -v $(pwd)/supportFiles:/supportFiles:ro \\\n        -v $(pwd)/openwrt/istoreos.img:/mnt/istoreos.img \\\n        debian:buster \\\n        /supportFiles/istoreos/build.sh\n"
  },
  {
    "path": "supportFiles/99-dhcp-en.network",
    "content": "[Match]\nName=e*\n\n[Network]\nDHCP=yes\n\n[DHCP]\nClientIdentifier=mac\n\n"
  },
  {
    "path": "supportFiles/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/armbian.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/armbian-installer-x86_64-standard.iso\nchmod -v 666 /output/armbian-installer-x86_64-standard.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/custom/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\n\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\n\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\n\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/custom/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/custom.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/custom/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/custom/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/custom-installer-x86_64.iso\nchmod -v 666 /output/custom-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/custom/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"==========================================\"\n    echo \"  Custom OpenWrt Installer by wukongdaily\"\n    echo \"==========================================\"\n    echo \"1. Install Custom OpenWrt\"\n    echo \"0. Quit\"\n    echo \"=====================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"Custom OpenWrt installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"custom.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/custom/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"Custom OpenWrt x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/custom/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的Custom OpenWrt\n#### 固件地址:\n#### 用户名:  密码:\n#### 默认软件包大小:  "
  },
  {
    "path": "supportFiles/custom/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL Custom OpenWrt Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"=====================================\"\n    echo \"  Armbian x86-UEFI Installer by wukongdaily\"\n    echo \"=====================================\"\n    echo \"1. Install Armbian x86-UEFI\"\n    echo \"0. Quit\"\n    echo \"=====================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"Armbian installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"armbian.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/esirplayground/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\n\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/esirplayground/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/esiropenwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/esirplayground/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/esirplayground/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/esiropenwrt-installer-x86_64.iso\nchmod -v 666 /output/esiropenwrt-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/esirplayground/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"=====================================================\"\n    echo \"  eSirPlayGround OpenWrt Installer by wukongdaily\"\n    echo \"=====================================================\"\n    echo \"1. Install eSirPlayGround OpenWrt GDQ\"\n    echo \"0. Quit\"\n    echo \"=====================================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"eSirOpenWrt installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"esiropenwrt.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/esirplayground/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"eSirPlayGround OpenWrt x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/esirplayground/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的openwrt-gdq-version-v1.2025.-x86-64-generic-squashfs-uefi.img.gz\n#### 固件地址 `192.168.5.1`\n#### 用户名 `root` 密码：无\n#### 默认软件包大小 1GB \n#### 内核版本6.6.73 \n#### Luci 版本24.10.0 firewall4\n\n- 固件出处：https://t.me/esirplayground"
  },
  {
    "path": "supportFiles/esirplayground/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL eSirPlayGround OpenWrt Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/ezopwrt/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/ezopwrt/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/ezopwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/ezopwrt/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/ezopwrt/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/ezopwrt-installer-x86_64.iso\nchmod -v 666 /output/ezopwrt-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/ezopwrt/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"=====================================\"\n    echo \"  EzOpWrt Installer by wukongdaily\"\n    echo \"=====================================\"\n    echo \"1. Install EzOpWrt Vip-Super\"\n    echo \"0. Quit\"\n    echo \"=====================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"EzOpWrt installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"ezopwrt.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/ezopwrt/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"EzOpWrt x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/ezopwrt/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的EzOpWrt Vip-Super 24.10\n#### 固件地址 `192.168.10.1`\n#### 用户名 `root` 密码：无\n#### 默认软件包大小 2GB \n\n- 固件出处：https://github.com/sirpdboy/openwrt/releases/"
  },
  {
    "path": "supportFiles/ezopwrt/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL EzOpWrt Vip-Super Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/grub-standalone.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\nset prefix=($root)/boot/grub/\nconfigfile /boot/grub/grub.cfg\n"
  },
  {
    "path": "supportFiles/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"Armbian x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/haos/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\n\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/haos/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/haos.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/haos/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/haos/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/haos-installer-x86_64.iso\nchmod -v 666 /output/haos-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/haos/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"==========================================\"\n    echo \"  HAOS Installer by wukongdaily\"\n    echo \"==========================================\"\n    echo \"1. Install HAOS\"\n    echo \"0. Quit\"\n    echo \"=====================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"HAOS installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"haos.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/haos/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"HAOS x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/haos/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的haos-installer-x86_64.iso 用于快速安装HAOS\n#### 默认版本15.0 haos_generic-x86-64-15.0.img.xz\n#### 出处:https://github.com/home-assistant/operating-system/releases/\n\n<img src=\"https://github.com/user-attachments/assets/c5b02f19-12b7-463f-9e01-e080152bed66\" width=\"50%\" height=\"50%\">\n\n<img src=\"https://github.com/user-attachments/assets/880fbb54-d83d-4f07-b64a-1c71a7ff57b3\" width=\"50%\" height=\"50%\">"
  },
  {
    "path": "supportFiles/haos/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL HAOS Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/immortalwrt/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\n\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\n\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\n\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/immortalwrt/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/immortalwrt.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/immortalwrt/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/immortalwrt/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/immortalwrt-installer-x86_64.iso\nchmod -v 666 /output/immortalwrt-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/immortalwrt/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"=====================================\"\n    echo \"  Immortalwrt Installer by wukongdaily\"\n    echo \"=====================================\"\n    echo \"1. Install Immortalwrt 24.10.1 (1GB)\"\n    echo \"0. Quit\"\n    echo \"=====================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"Immortalwrt installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"immortalwrt.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/immortalwrt/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"ImmortalWrt x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/immortalwrt/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的Immortalwrt 24.10.2 x86-64-efi\n#### 固件地址 `192.168.100.1`\n#### 用户名 `root` 密码：无\n#### 默认软件包大小 1GB \n#### 默认带docker\n#### 下列属性刷机前必读\n\n- 该固件刷入【单网口设备】默认采用DHCP模式,自动获得ip。类似NAS的做法\n- 该固件刷入【多网口设备】默认WAN口采用DHCP模式，LAN 口ip为 192.168.100.1\n- 其中eth0为WAN 其余网口均为LAN (自动将剩余其他网口桥接 无需手动)\n- 默认情况下 只要你知道wan口分配的ip 就能访问web页\n- immortalwrt终端中使用 `ip a` 可查看网口信息 \n"
  },
  {
    "path": "supportFiles/immortalwrt/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL ImmortalWrt 24.10 Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/installChroot.sh",
    "content": "#!/bin/bash\n# This shell script is executed inside the chroot\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\necho Set hostname\necho \"installer\" > /etc/hostname\n\n# Set as non-interactive so apt does not prompt for user input\nexport DEBIAN_FRONTEND=noninteractive\n\necho Install security updates and apt-utils\napt-get update\napt-get -y install apt || true\napt-get -y upgrade\n\necho Set locale\napt-get -y install locales\nsed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen\ndpkg-reconfigure --frontend=noninteractive locales\nupdate-locale LANG=en_US.UTF-8\n\necho Install packages\napt-get install -y --no-install-recommends linux-image-amd64 live-boot systemd-sysv\napt-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\n\necho Clean apt post-install\napt-get clean\n\necho Enable systemd-networkd as network manager\nsystemctl enable systemd-networkd\n\necho Set resolv.conf to use systemd-resolved\nrm /etc/resolv.conf\nln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf\n\necho \"PermitRootLogin yes\" >> /etc/ssh/sshd_config\necho \"PermitEmptyPasswords yes\" >> /etc/ssh/sshd_config\necho \"root:1234\" | chpasswd\nsystemctl enable ssh\n\necho Remove machine-id\nrm /etc/machine-id\n\necho List installed packages\ndpkg --get-selections|tee /packages.txt\n"
  },
  {
    "path": "supportFiles/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL Armbian Installer\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/istoreos/build.sh",
    "content": "#!/bin/bash\n# Based from https://willhaley.com/blog/custom-debian-live-environment/\nset -e\n\necho \"🔧 修复 buster 的源...\"\n\ncat > /etc/apt/sources.list <<EOF\ndeb http://archive.debian.org/debian buster main contrib non-free\ndeb http://archive.debian.org/debian-security buster/updates main\nEOF\n\necho 'Acquire::Check-Valid-Until \"false\";' > /etc/apt/apt.conf.d/99no-check-valid-until\n\napt-get update\n\necho \"🚀 开始执行 build.sh ...\"\necho Install required tools\napt-get update\napt-get -y install debootstrap squashfs-tools xorriso isolinux syslinux-efi  grub-pc-bin grub-efi-amd64-bin mtools dosfstools parted\n\necho Create directory where we will make the image\nmkdir -p $HOME/LIVE_BOOT\n\necho Install Debian\ndebootstrap --arch=amd64 --variant=minbase buster $HOME/LIVE_BOOT/chroot http://archive.debian.org/debian/\n\necho Copy supporting documents into the chroot\ncp -v /supportFiles/installChroot.sh $HOME/LIVE_BOOT/chroot/installChroot.sh\ncp -v /supportFiles/istoreos/ddd $HOME/LIVE_BOOT/chroot/usr/bin/ddd\nchmod +x $HOME/LIVE_BOOT/chroot/usr/bin/ddd\ncp -v /supportFiles/sources.list $HOME/LIVE_BOOT/chroot/etc/apt/sources.list\n\necho Mounting dev / proc / sys\nmount -t proc none $HOME/LIVE_BOOT/chroot/proc\nmount -o bind /dev $HOME/LIVE_BOOT/chroot/dev\nmount -o bind /sys $HOME/LIVE_BOOT/chroot/sys\n\necho Run install script inside chroot\nchroot $HOME/LIVE_BOOT/chroot /installChroot.sh\n\necho Cleanup chroot\nrm -v $HOME/LIVE_BOOT/chroot/installChroot.sh\nmv -v $HOME/LIVE_BOOT/chroot/packages.txt /output/packages.txt\n\necho Copy in systemd-networkd config\ncp -v /supportFiles/99-dhcp-en.network $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchown -v root:root $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\nchmod -v 644 $HOME/LIVE_BOOT/chroot/etc/systemd/network/99-dhcp-en.network\n\necho Enable autologin\nmkdir -p -v $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/\ncp -v /supportFiles/override.conf $HOME/LIVE_BOOT/chroot/etc/systemd/system/getty@tty1.service.d/override.conf\n\necho Unmounting dev / proc / sys\numount $HOME/LIVE_BOOT/chroot/proc\numount $HOME/LIVE_BOOT/chroot/dev\numount $HOME/LIVE_BOOT/chroot/sys\n\necho Create directories that will contain files for our live environment files and scratch files.\nmkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp}\n\necho Compress the chroot environment into a Squash filesystem.\ncp /mnt/istoreos.img ${HOME}/LIVE_BOOT/chroot/mnt/\nls ${HOME}/LIVE_BOOT/chroot/mnt/\nmksquashfs $HOME/LIVE_BOOT/chroot $HOME/LIVE_BOOT/staging/live/filesystem.squashfs -e boot\n\necho Copy kernel and initrd\ncp -v $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* $HOME/LIVE_BOOT/staging/live/vmlinuz\ncp -v $HOME/LIVE_BOOT/chroot/boot/initrd.img-* $HOME/LIVE_BOOT/staging/live/initrd\n\necho Copy boot config files\ncp -v /supportFiles/istoreos/isolinux.cfg $HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg\ncp -v /supportFiles/istoreos/grub.cfg $HOME/LIVE_BOOT/staging/boot/grub/grub.cfg\ncp -v /supportFiles/grub-standalone.cfg $HOME/LIVE_BOOT/tmp/grub-standalone.cfg\ntouch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM\n\necho Copy boot images\ncp -v /usr/lib/ISOLINUX/isolinux.bin \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v /usr/lib/syslinux/modules/bios/* \"${HOME}/LIVE_BOOT/staging/isolinux/\"\ncp -v -r /usr/lib/grub/x86_64-efi/* \"${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/\"\n\necho Make UEFI grub files\ngrub-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\"\n\ncd $HOME/LIVE_BOOT/staging/EFI/boot\nSIZE=`expr $(stat --format=%s $HOME/LIVE_BOOT/tmp/bootx64.efi) + 65536`\ndd if=/dev/zero of=efiboot.img bs=$SIZE count=1\n/sbin/mkfs.vfat efiboot.img\nmmd -i efiboot.img efi efi/boot\nmcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/\n\necho Build ISO\nxorriso \\\n    -as mkisofs \\\n    -iso-level 3 \\\n    -o \"${HOME}/LIVE_BOOT/debian-custom.iso\" \\\n    -full-iso9660-filenames \\\n    -volid \"DEBIAN_CUSTOM\" \\\n    -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \\\n    -eltorito-boot \\\n        isolinux/isolinux.bin \\\n        -no-emul-boot \\\n        -boot-load-size 4 \\\n        -boot-info-table \\\n        --eltorito-catalog isolinux/isolinux.cat \\\n    -eltorito-alt-boot \\\n        -e /EFI/boot/efiboot.img \\\n        -no-emul-boot \\\n        -isohybrid-gpt-basdat \\\n    -append_partition 2 0xef ${HOME}/LIVE_BOOT/staging/EFI/boot/efiboot.img \\\n    \"${HOME}/LIVE_BOOT/staging\"\n\necho Copy output\ncp -v $HOME/LIVE_BOOT/debian-custom.iso /output/istoreos-installer-x86_64.iso\nchmod -v 666 /output/istoreos-installer-x86_64.iso\nls -lah /output\n"
  },
  {
    "path": "supportFiles/istoreos/ddd",
    "content": "#!/bin/bash\n\nshow_menu() {\n    clear\n    echo \"=================================================\"\n    echo \"  iStoreOS Installer for all virtual machine\"\n    echo \"  by wukongdaily\"\n    echo \"=================================================\"\n    echo \"1. Install iStoreOS\"\n    echo \"0. Quit\"\n    echo \"=================================================\"\n}\n\ndetect_disk() {\n    # Get all available disks\n    local disks=($(lsblk -d -n -o NAME,RO,TYPE | awk '$3 == \"disk\" && $2 == \"0\" {print \"/dev/\"$1}'))\n\n    # Error handling\n    if [ ${#disks[@]} -eq 0 ]; then\n        echo \"Error: No available disk devices detected!\" >&2\n        exit 1\n    fi\n\n    # Display disk list with sizes\n    echo \"Available disks:\" >&2\n    for i in \"${!disks[@]}\"; do\n        size=$(lsblk -d -n -b -o SIZE ${disks[i]} | awk '{printf \"%.2f GB\", $1/1000000000}')\n        printf \"%2d. %-12s %8s\\n\" $((i+1)) \"${disks[i]}\" \"$size\" >&2\n    done\n\n    # User selection logic\n    while true; do\n        read -p \"Select target disk number (1-${#disks[@]}): \" choice\n        if [[ \"$choice\" =~ ^[0-9]+$ ]] && (( choice >= 1 && choice <= ${#disks[@]} )); then\n            selected_disk=\"${disks[choice-1]}\"\n            echo \"[Security Notice] Selected disk: $selected_disk\" >&2\n            echo \"$selected_disk\"\n            return\n        else\n            echo \"Invalid input. Please enter a valid number between 1-${#disks[@]}\"\n        fi\n    done\n}\n\nconfirm_danger() {\n    local target_disk=$1\n    local image_file=$2\n    \n    echo \"!! DANGEROUS OPERATION CONFIRMATION !!\"\n    echo \"──────────────────────────────────────\"\n    echo \"Target device: $target_disk\"\n    echo \"Image file:    $image_file\"\n    echo \"──────────────────────────────────────\"\n    echo \"This will ERASE ALL DATA on $target_disk!\"\n    read -p \"Confirm write operation? (Type uppercase YES to proceed): \" confirm\n\n    if [ \"$confirm\" != \"YES\" ]; then\n        echo \"Operation cancelled\"\n        exit 0\n    fi\n\n}\n\ninstall_system() {\n    local image_name=$1\n    local image_file=\"/mnt/$image_name\"\n    local target_disk\n    \n    # Get user-selected disk\n    target_disk=$(detect_disk)\n    \n    # Display disk information\n    echo -e \"\\nDisk Information:\"\n    fdisk -l \"$target_disk\" | grep Disk | head -1\n    \n    # Check image file existence\n    if [ ! -f \"$image_file\" ]; then\n        echo -e \"\\nError: Image file $image_file not found!\"\n        echo \"Please:\"\n        echo \"1. Place the image file in /mnt directory\"\n        echo \"2. Verify file permissions\"\n        exit 1\n    fi\n    \n    # Final confirmation\n    confirm_danger \"$target_disk\" \"$image_file\"\n    \n    echo -e \"\\nStarting system write... (Press Ctrl+C to cancel)\"\n    sleep 2\n    \n    # Perform write operation\n    dd if=\"$image_file\" of=\"$target_disk\" bs=4M conv=fsync status=progress\n    \n    echo \"──────────────────────────────────────\"\n    echo \"iStoreOS installed successfully:\"\n}\n\nwhile true; do\n    show_menu\n    read -p \"Enter your choice [0-1]: \" choice\n    \n    case $choice in\n        1)\n            install_system \"istoreos.img\"\n            break\n            ;;\n        0)\n            echo \"Exiting installer\"\n            exit 0\n            ;;\n        *)\n            echo \"Invalid option, please try again\"\n            sleep 2\n            ;;\n    esac\ndone"
  },
  {
    "path": "supportFiles/istoreos/grub.cfg",
    "content": "search --set=root --file /DEBIAN_CUSTOM\n\nset default=\"0\"\nset timeout=5\n\n# If X has issues finding screens, experiment with/without nomodeset.\n# Load EFI video drivers. This device is EFI so keep the\n# video mode while booting the linux kernel.\n\ninsmod efi_gop\ninsmod font\nif loadfont ${prefix}/fonts/unicode.pf2\nthen\n        insmod gfxterm\n        set gfxmode=auto\n        set gfxpayload=keep\n        terminal_output gfxterm\nfi\n\nmenuentry \"iStoreOS x86-UEFI Installer [EFI/GRUB]\" {\n    linux ($root)/live/vmlinuz boot=live\n    initrd ($root)/live/initrd\n}\n\n\n\n"
  },
  {
    "path": "supportFiles/istoreos/info.md",
    "content": "[![Github](https://img.shields.io/badge/Release文件可在国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) \n\n#### 适用范围:所有虚拟机和物理机\n#### 安装器中的iStoreOS \n#### 固件地址 `192.168.100.1`\n#### 用户名 `root` 密码：password\n#### 默认软件包大小 2GB \n#### 默认带docker\n#### 下列属性刷机前必读\n\n- 该固件刷入【单网口设备】默认采用DHCP模式,自动获得ip。类似NAS的做法\n- 该固件刷入【多网口设备】默认WAN口采用DHCP模式，LAN 口ip为 192.168.100.1\n- 其中eth0为WAN 其余网口均为LAN (自动将剩余其他网口桥接 无需手动)\n- iStoreOS终端中使用 `quickstart` 可查看网口信息 \n- 默认情况下 只要你知道wan口分配的ip 就能访问web页 前提是你在`quickstart`  中启用了 `ALLOW WAN ACCESS`\n- 出处：https://fw0.koolcenter.com/iStoreOS/x86_64_efi/istoreos-22.03.7-2024122712-x86-64-squashfs-combined-efi.img.gz\n"
  },
  {
    "path": "supportFiles/istoreos/isolinux.cfg",
    "content": "UI vesamenu.c32\n\nMENU TITLE Boot Menu\nDEFAULT linux\nTIMEOUT 50\nMENU RESOLUTION 640 480\nMENU COLOR border       30;44   #40ffffff #a0000000 std\nMENU COLOR title        1;36;44 #9033ccff #a0000000 std\nMENU COLOR sel          7;37;40 #e0ffffff #20ffffff all\nMENU COLOR unsel        37;44   #50ffffff #a0000000 std\nMENU COLOR help         37;40   #c0ffffff #a0000000 std\nMENU COLOR timeout_msg  37;40   #80ffffff #00000000 std\nMENU COLOR timeout      1;37;40 #c0ffffff #00000000 std\nMENU COLOR msg07        37;40   #90ffffff #a0000000 std\nMENU COLOR tabmsg       31;40   #30ffffff #00000000 std\n\nLABEL linux\n  MENU LABEL iStoreOS Installer for Virtual Machine\n  MENU DEFAULT\n  KERNEL /live/vmlinuz\n  APPEND initrd=/live/initrd boot=live"
  },
  {
    "path": "supportFiles/override.conf",
    "content": "[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin root --noclear %I $TERM\n"
  },
  {
    "path": "supportFiles/sources.list",
    "content": "deb http://archive.debian.org/debian buster main contrib non-free\ndeb-src http://archive.debian.org/debian buster main contrib non-free\n\ndeb http://archive.debian.org/debian-security buster/updates main\ndeb-src http://archive.debian.org/debian-security buster/updates main"
  }
]