> ## Documentation Index
> Fetch the complete documentation index at: https://oom-wg.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 写入镜像到当前槽位的 init_boot 或 boot 分区

> 写入提供的镜像，并用零填充目标分区剩余空间

如果请求体为空，后端会从 `url` 查询参数下载镜像




## OpenAPI

````yaml /apis/ssu/openapi.yml put /system/boot
openapi: 3.1.0
info:
  title: ShiroSU HTTP 接口
  version: 1.0.0
  description: |
    `suu man --server` 运行服务所提供的 HTTP 接口

    所有 HTTP 和 WebSocket 路由均以 `/api/v1/superuser` 作为根路径

    所有 HTTP 请求都通过 `Authorization` 请求头校验，
    所有 WebSocket 连接通过 `ws` 查询参数校验，临时一次性票证由 HTTP 请求 `POST /ws` 获取

    所有路径除了部分 `PUT`/`DELETE` 方法之外，任何请求都不会返回 `404`，
    返回 `404` 即说明请求的路径不存在也就是功能不支持/版本过时
servers:
  - url: http://{host}:{port}/api/v1/superuser
    description: ShiroSU 后端的本地或局域网地址
    variables:
      host:
        default: 127.0.0.1
      port:
        default: '5355'
security:
  - bearerAuth: []
tags:
  - name: WebSocket
  - name: 状态
  - name: 配置
  - name: 系统
  - name: 主题
  - name: 软件包
  - name: 模块
paths:
  /system/boot:
    put:
      tags:
        - 系统
      summary: 写入镜像到当前槽位的 init_boot 或 boot 分区
      description: |
        写入提供的镜像，并用零填充目标分区剩余空间

        如果请求体为空，后端会从 `url` 查询参数下载镜像
      operationId: flashBootImage
      parameters:
        - $ref: '#/components/parameters/DownloadUrl'
      requestBody:
        required: false
        content:
          application/x-raw-disk-image:
            schema:
              type: string
              format: binary
      responses:
        '204':
          description: 镜像已写入
        '400':
          $ref: '#/components/responses/DownloadBadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          description: 未找到支持的启动分区
        '413':
          $ref: '#/components/responses/DownloadPayloadTooLarge'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/JvmBadGateway'
        '503':
          $ref: '#/components/responses/JvmUnavailable'
components:
  parameters:
    DownloadUrl:
      name: url
      in: query
      required: false
      description: 可选下载地址，仅请求体为空时使用
      schema:
        type: string
        format: uri
  responses:
    DownloadBadRequest:
      description: 未提供请求体、请求体读取失败、下载地址无效、下载结果为空、文件无效
    Forbidden:
      description: 鉴权失败，或 WebSocket 票证无效
    DownloadPayloadTooLarge:
      description: 请求体或下载内容过大
    InternalServerError:
      description: 后端执行操作失败
    JvmBadGateway:
      description: JVM 交互失败、下载响应失败、远端返回非成功状态或响应内容无法解析
    JvmUnavailable:
      description: JVM 服务不可用
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        后端管理密码

        同时支持 `Authorization: Bearer <password>` 和 `Authorization: <password>`

````