From b17e734c8f0e284ddbbd6bbe5bcefe8b383b1cae Mon Sep 17 00:00:00 2001 From: paxx12 <245230251+paxx12@users.noreply.github.com> Date: Wed, 26 Nov 2025 15:57:07 +0100 Subject: [PATCH] Restructure release process and documentation - Add GitHub workflows for automated releases and PR builds - Reorganize documentation into docs/ directory - Add versioning scripts for semantic version computation - Update build system to support custom output filenames - Move kernel module scripts to appropriate overlay directory --- .github/workflows/build.yaml | 63 ---------- .github/workflows/pre_release.yaml | 93 +++++++++++++++ .github/workflows/pull_request.yaml | 94 +++++++++++++++ Makefile | 37 +++--- README.dev.md | 94 --------------- README.md | 78 ++++++------- RELEASE.md | 15 +++ docs/camera_support.md | 43 +++++++ docs/data_persistence.md | 24 ++++ docs/development.md | 109 ++++++++++++++++++ docs/install.md | 50 ++++++++ docs/ssh_access.md | 23 ++++ docs/usb_ethernet.md | 16 +++ overlays/basic/scripts/01_store_version.sh | 15 +++ .../scripts/01_compile_kernel_modules.sh | 1 - scripts/next_version.sh | 26 +++++ vars.mk | 2 +- 17 files changed, 562 insertions(+), 221 deletions(-) delete mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/pre_release.yaml create mode 100644 .github/workflows/pull_request.yaml delete mode 100644 README.dev.md create mode 100644 RELEASE.md create mode 100644 docs/camera_support.md create mode 100644 docs/data_persistence.md create mode 100644 docs/development.md create mode 100644 docs/install.md create mode 100644 docs/ssh_access.md create mode 100644 docs/usb_ethernet.md create mode 100755 overlays/basic/scripts/01_store_version.sh rename overlays/{basic => kernel-modules}/scripts/01_compile_kernel_modules.sh (99%) create mode 100755 scripts/next_version.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index a95fbb28..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,63 +0,0 @@ -on: - push: - branches: - - main - paths-ignore: - - '*.md' - - .github/workflows/*.yaml - pull_request: - workflow_dispatch: - -jobs: - custom-firmware-build: - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - name: Load values vars.mk - run: cat vars.mk >> "$GITHUB_ENV" - - - name: Cache Firmwares - uses: actions/cache@v4 - with: - path: firmware/ - key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} - - - name: Cache Kernel - uses: actions/cache@v4 - with: - path: tmp/kernel/ - key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} - - - name: Install build dependencies - run: | - sudo apt-get update -y && - sudo apt-get install -y build-essential cmake \ - gcc-aarch64-linux-gnu pkg-config squashfs-tools git-core \ - bc libssl-dev - - - name: Download firmware - run: make firmware - - - name: Build with Basic firmware - run: make basic_firmware BASIC_FIRMWARE_FILE=firmware_basic.bin - - - name: Build with Extended firmware - run: make extended_firmware EXTENDED_FIRMWARE_FILE=firmware_extended.bin - - - name: Clear Kernel Git Repo - run: git -C tmp/kernel/ clean -fdx - - - uses: actions/upload-artifact@v4 - with: - name: basic-build - path: firmware_basic.bin - - - uses: actions/upload-artifact@v4 - with: - name: extended-build - path: firmware_extended.bin diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml new file mode 100644 index 00000000..b878785b --- /dev/null +++ b/.github/workflows/pre_release.yaml @@ -0,0 +1,93 @@ +on: + push: + branches: + - main + paths-ignore: + - '*.md' + - .github/workflows/*.yaml + workflow_dispatch: + +jobs: + custom-firmware-build: + runs-on: ubuntu-24.04-arm + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + + - name: Load values vars.mk + run: cat vars.mk >> "$GITHUB_ENV" + + - name: Restore Firmwares Cache + id: cache-firmwares + uses: actions/cache/restore@v4 + with: + path: firmware/ + key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} + + - name: Restore Kernel Cache + id: cache-kernel + uses: actions/cache/restore@v4 + with: + path: tmp/kernel/ + key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} + + - name: Install build dependencies + run: | + sudo apt-get update -y && + sudo apt-get install -y build-essential cmake \ + gcc-aarch64-linux-gnu pkg-config squashfs-tools git-core \ + bc libssl-dev + + - name: Set GIT_VERSION + shell: bash + run: | + nextVer=$(./scripts/next_version.sh paxx12) + echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV + + - name: Download firmware + run: make firmware + + - name: Build with Basic firmware + run: make build PROFILE=basic OUTPUT_FILE=U1_basic_${{ env.GIT_VERSION }}.bin + + - name: Build with Extended firmware + run: make build PROFILE=extended OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}.bin + + - name: Clear Kernel Git Repo + run: git -C tmp/kernel/ clean -fdx + + - name: Generate RELEASE details + run: | + echo "# Release ${{ env.GIT_VERSION }}" > RELEASE.tmp + echo "" >> RELEASE.tmp + cat RELEASE.md >> RELEASE.tmp + + - name: 'Release debian files' + uses: ncipollo/release-action@v1 + with: + tag: "v${{ env.GIT_VERSION }}" + allowUpdates: false + updateOnlyUnreleased: true + generateReleaseNotes: true + prerelease: true + bodyFile: RELEASE.tmp + artifacts: "U1_*.bin" + + - name: Save Firmwares Cache + if: steps.cache-firmwares.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: firmware/ + key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} + + - name: Save Kernel Cache + if: steps.cache-kernel.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: tmp/kernel/ + key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 00000000..1f89e5d9 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,94 @@ +on: + pull_request: + workflow_dispatch: + +jobs: + custom-firmware-build: + runs-on: ubuntu-24.04-arm + permissions: + pull-requests: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + + - name: Load values vars.mk + run: cat vars.mk >> "$GITHUB_ENV" + + - name: Restore Firmwares Cache + id: cache-firmwares + uses: actions/cache/restore@v4 + with: + path: firmware/ + key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} + + - name: Restore Kernel Cache + id: cache-kernel + uses: actions/cache/restore@v4 + with: + path: tmp/kernel/ + key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} + + - name: Install build dependencies + run: | + sudo apt-get update -y && + sudo apt-get install -y build-essential cmake \ + gcc-aarch64-linux-gnu pkg-config squashfs-tools git-core \ + bc libssl-dev + + - name: Set GIT_VERSION + shell: bash + run: | + nextVer=$(./scripts/next_version.sh paxx12 test-pr-${{ github.event.pull_request.number }}) + echo "GIT_VERSION=${nextVer//v/}" | tee -a $GITHUB_ENV + + - name: Download firmware + run: make firmware + + - name: Build with Basic firmware + run: make build PROFILE=basic OUTPUT_FILE=U1_basic_${{ env.GIT_VERSION }}.bin + + - name: Build with Extended firmware + run: make build PROFILE=extended OUTPUT_FILE=U1_extended_${{ env.GIT_VERSION }}.bin + + - name: Clear Kernel Git Repo + run: git -C tmp/kernel/ clean -fdx + + - uses: actions/upload-artifact@v4 + with: + name: basic-build + path: U1_basic_*.bin + + - uses: actions/upload-artifact@v4 + with: + name: extended-build + path: U1_extended_*.bin + + - name: Comment PR with artifact links + uses: actions/github-script@v7 + with: + script: | + const body = `✅ Build artifacts ready: [Download builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: body + }); + + - name: Save Firmwares Cache + if: steps.cache-firmwares.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: firmware/ + key: firmwares-${{ runner.os }}-${{ runner.arch }}-${{ env.FIRMWARE_VERSION }} + + - name: Save Kernel Cache + if: steps.cache-kernel.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: tmp/kernel/ + key: kernels-${{ runner.os }}-${{ runner.arch }}-${{ env.KERNEL_SHA }} diff --git a/Makefile b/Makefile index 8f4da78f..2cb4db33 100644 --- a/Makefile +++ b/Makefile @@ -4,23 +4,26 @@ all: tools # ================= Build Tools ================= -DEBUG_FIRMWARE_FILE := firmware/firmware_debug.bin -BASIC_FIRMWARE_FILE := firmware/firmware_basic.bin -EXTENDED_FIRMWARE_FILE := firmware/firmware_extended.bin - -$(DEBUG_FIRMWARE_FILE): firmware/$(FIRMWARE_FILE) tools - ./scripts/enable_debug_misc.sh $< tmp/debug $@ - -$(BASIC_FIRMWARE_FILE): firmware/$(FIRMWARE_FILE) tools - ./scripts/create_firmware.sh $< tmp/basic $@ overlays/basic overlays/camera-native - -$(EXTENDED_FIRMWARE_FILE): firmware/$(FIRMWARE_FILE) tools - ./scripts/create_firmware.sh $< tmp/extended $@ overlays/basic overlays/camera-new overlays/fluidd-upgrade - -basic_firmware: $(BASIC_FIRMWARE_FILE) -extended_firmware: $(EXTENDED_FIRMWARE_FILE) -debug_firmware: $(DEBUG_FIRMWARE_FILE) -extract_firmware: firmware/$(FIRMWARE_FILE) tools +OUTPUT_FILE := firmware/firmware.bin + +ifeq (basic,$(PROFILE)) +OVERLAYS += basic kernel-modules camera-native +else ifeq (extended,$(PROFILE)) +OVERLAYS += basic kernel-modules camera-new fluidd-upgrade +endif + +$(OUTPUT_FILE): firmware/$(FIRMWARE_FILE) tools +ifeq (,$(OVERLAYS)) + @echo "No overlays specified. Set PROFILE variable to 'basic' or 'extended'." + @exit 1 +endif + ./scripts/create_firmware.sh $< tmp/extended $@ $(addprefix overlays/,$(OVERLAYS)) + +.PHONY: build +build: $(OUTPUT_FILE) + +.PHONY: extract +extract: firmware/$(FIRMWARE_FILE) tools ./scripts/extract_squashfs.sh $< tmp/extracted # ================= Tools ================= diff --git a/README.dev.md b/README.dev.md deleted file mode 100644 index ab9b9c5f..00000000 --- a/README.dev.md +++ /dev/null @@ -1,94 +0,0 @@ -# Development - -## Prerequisites - -- Linux build environment -- make -- wget -- squashfs-tools -- C compiler (gcc) -- **Run in a container as a root** - -## Quick Start - -### 1. Build Tools - -```bash -make tools -``` - -### 2. Download Firmware - -```bash -make firmware -``` - -### 3. Extract Firmware - -```bash -make extract_firmware -``` - -Extracted contents will be in `tmp/extracted/` - -### 4. Create Custom Firmware - -```bash -make custom_firmware -``` - -Output: `firmware/firmware_custom.bin` - -### 5. Create Debug Firmware - -```bash -make debug_firmware -``` - -Output: `firmware/firmware_debug.bin` - -## Project Structure - -``` -. -├── custom/ Custom rootfs modifications -├── firmware/ Downloaded and generated firmware files -├── scripts/ Build and modification scripts -│ ├── create_custom_firmware.sh -│ ├── enable_debug_misc.sh -│ └── extract_squashfs.sh -├── tmp/ Temporary build artifacts -├── tools/ Firmware manipulation tools -│ ├── rk2918_tools/ Rockchip image tools -│ └── upfile/ Firmware unpacking tool -├── Makefile Build configuration -└── vars.mk Firmware version variables -``` - -## Configuration - -Edit `vars.mk` to change firmware version: - -```makefile -FIRMWARE_FILE=U1_0.9.0.121_20251106132913_upgrade.bin -FIRMWARE_VERSION=0.9.0.121 -``` - -## Testing - -```bash -make test -``` - -## Tools - -### rk2918_tools - -- `afptool` - Android firmware package tool -- `img_maker` - Create Rockchip images -- `img_unpack` - Unpack Rockchip images -- `mkkrnlimg` - Create kernel images - -### upfile - -Firmware unpacking utility for Snapmaker update files. diff --git a/README.md b/README.md index 9e4d215c..a5a0e640 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,54 @@ -# Snapmaker U1 Firmware Tools +# Custom Snapmaker U1 Firmware -Tools for extracting, modifying, and rebuilding Snapmaker U1 firmware. +This project builds custom firmware for the Snapmaker U1 3D printer, +enabling debug features like SSH access and adding additional capabilities. -## Overview +> **Warning**: Installing custom firmware may void warranty and could potentially damage your device. +> Use at your own risk. -This project provides utilities to work with Snapmaker U1 firmware images. -It enables creating custom firmware builds, and enabling debug features, -like SSH access. +## Download -## Firmware Variants +Get the latest pre-built firmware from [Releases](https://github.com/paxx12/SnapmakerU1/releases). -| Variant | Description | -|---------|-------------| -| **Basic** | SSH, USB ethernet, native camera (~1Hz in Fluidd). Retains all base functionality and cloud features. | -| **Extended** | Basic + new camera stack with HW-accelerated streams. Modifies some base functionality; cloud features may not work. | +For installation instructions, see [Installation Guide](docs/install.md) +and the [release notes](https://github.com/paxx12/SnapmakerU1/releases/latest). -### Common Features +## Features -- Enable SSH: `root/snapmaker` and `lava/snapmaker` -- Enable DHCP on USB ethernet adapters -- Disable WiFi power saving +### Basic Firmware -### Extended Firmware Updates +- [SSH Access](docs/ssh_access.md) - Remote shell access with `root/snapmaker` and `lava/snapmaker` +- [USB Ethernet Adapters](docs/usb_ethernet.md) - Hot-plug support for USB ethernet devices +- [Data Persistence](docs/data_persistence.md) - Persistent storage across firmware updates +- Enable fluidd automatically with camera feed. -- Hardware-accelerated camera stack (Rockchip MPP/VPU) -- v4l2-mpp: MIPI CSI and USB camera support with hot-plug detection -- WebRTC low-latency streaming -- Fluidd upgraded to v1.35.0 -- Moonraker timelapse support -- Native camera disabled (re-enable with `/oem/.camera-native`) -- udev hot-plug support for USB cameras and USB ethernet adapters - -Access native camera at `http:///webcam/` and USB camera at `http:///webcam2/`. +### Extended Firmware -## Pre-builts +All basic firmware features plus: -1. Go to [Actions](https://github.com/paxx12/SnapmakerU1/actions/workflows/build.yaml). You need GitHub account. -1. Download `basic-build` or `extended-build` artifact. -1. Unpack the `.zip` -1. Put the `.bin` file onto USB device (FAT32/exFAT format). -1. Go to `About > Firmware version > Local Update > Select the .bin file` -1. Connect using `ssh root@` with `snapmaker` password. +- [Camera Support](docs/camera_support.md) - Hardware-accelerated camera stack (Rockchip MPP/VPU) +- [USB Camera Support](docs/camera_support.md) - Support for external USB cameras +- WebRTC low-latency streaming +- Fluidd v1.35.0 with timelapse plugin -**This will void your warranty, but you get SSH access.** +Known issues: -Revert: flash stock firmware from [Snapmaker's site](https://wiki.snapmaker.com/en/snapmaker_u1/firmware/release_notes). +- The time-lapses are not available via mobile app when using Snapmaker Cloud. -## Persistence of data +## Documentation -By default the Snapmaker firmware wipes all user changes on every reboot. -This makes it bulletproof. +- [Installation Guide](docs/install.md) - How to install custom firmware +- [Building from Source](docs/development.md) - Development guide for building custom firmware +- [SSH Access](docs/ssh_access.md) - How to access the printer via SSH +- [USB Ethernet](docs/usb_ethernet.md) - USB ethernet adapter configuration +- [Camera Support](docs/camera_support.md) - Camera features and WebRTC streaming +- [Data Persistence](docs/data_persistence.md) - Persistent storage configuration -If for some reason you want to persist system-level changes to `/etc` (e.g., SSH passwords -or authorized keys), create the file with `touch /oem/.debug`. -Remove it with `rm /oem/.debug` and reboot to restore a pristine system. +## Dependent projects -The `/home/lava/printer_data` directory persists with and without `/oem/.debug`. +- [v4l2-mpp](https://github.com/paxx12/v4l2-mpp) - Custom project built to provide + Hardware-accelerated camera stack ## License See individual tool directories for licensing information. - -## Disclaimer - -This project is for educational and development purposes. Modifying firmware may void warranties and could potentially damage your device. Use at your own risk. diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..96d66151 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,15 @@ +## Install + +For detailed installation instructions, see the [Installation Guide](docs/install.md). + +Quick steps: + +1. Download `.bin` and put on FAT32 formatted USB device +2. On the printer go to `Settings` > `About` > `Firmware Version` > `Local Update` +3. Select `.bin` and confirm. + +## Revert + +1. Download `.bin` from the [Snapmaker U1 Wiki](https://wiki.snapmaker.com/en/snapmaker_u1/firmware/release_notes). +2. Follow the same as for install. + diff --git a/docs/camera_support.md b/docs/camera_support.md new file mode 100644 index 00000000..d6317078 --- /dev/null +++ b/docs/camera_support.md @@ -0,0 +1,43 @@ +# Camera Support + +**Available in: Extended firmware only** + +The extended firmware includes hardware-accelerated camera support. + +## Features + +- Hardware-accelerated camera stack (Rockchip MPP/VPU) +- v4l2-mpp: MIPI CSI and USB camera support +- WebRTC low-latency streaming +- Hot-plug detection for USB cameras + +## Accessing Cameras + +### Internal Camera + +Access the native camera at: +``` +http:///webcam/ +``` + +### USB Camera + +Access USB camera at: +``` +http:///webcam2/ +``` + +## Disabling Native Camera + +The native camera is enabled by default in extended firmware. +To disable it, create: + +```bash +touch /oem/.camera-native +``` + +## Timelapse Support + +Fluidd timelapse plugin is included (no settings support). + +Note: Time-lapses are not available via mobile app in cloud mode. diff --git a/docs/data_persistence.md b/docs/data_persistence.md new file mode 100644 index 00000000..eccb09ea --- /dev/null +++ b/docs/data_persistence.md @@ -0,0 +1,24 @@ +# Data Persistence + +**Available in: Basic and Extended firmware** + +By default the Snapmaker firmware wipes all user changes on every reboot. +This makes it bulletproof. + +## Persisting System Changes + +To persist system-level changes to `/etc` (e.g., SSH passwords or authorized keys), create the file with: + +```bash +touch /oem/.debug +``` + +To restore a pristine system, remove the file and reboot: + +```bash +rm /oem/.debug +``` + +## Printer Data + +The `/home/lava/printer_data` directory persists with and without `/oem/.debug`. diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 00000000..c1225586 --- /dev/null +++ b/docs/development.md @@ -0,0 +1,109 @@ +# Building from Source + +## Prerequisites + +- Linux build environment +- `make` +- `wget` +- `squashfs-tools` +- `gcc-aarch64-linux-gnu` +- `cmake` +- `pkg-config` +- `git-core` +- `bc` +- `libssl-dev` + +Prefer to run builds in a dockerized environment. + +## Quick Start + +Build tools and download firmware: + +```bash +make tools +make firmware +``` + +Build basic firmware: + +```bash +make build PROFILE=basic OUTPUT_FILE=firmware/U1_basic.bin +``` + +Build extended firmware: + +```bash +make build PROFILE=extended OUTPUT_FILE=firmware/U1_extended.bin +``` + +## Profiles + +The build system supports two profiles: + +- `basic` - simple modifications not changing key components of the firmware +- `extended` - extensive modifications changing key components of the firmware + +## Overlays + +- `basic` - SSH access, USB ethernet support +- `kernel-modules` - Required kernel modules +- `camera-native` - Extensions to camera stack (integration in `fluidd`, ~1hz) +- `camera-new` - Hardware-accelerated camera stack (MPP/VPU) +- `fluidd-upgrade` - Upgrade fluidd with timelapse plugin + +## Project Structure + +``` +. +├── .github/ Automated release builds +├── overlays/ Profile overlay directories +│ ├── basic/ SSH, USB ethernet, udev rules +│ ├── kernel-modules/ Kernel module compilation +│ ├── camera-native/ Extensions to camera stack +│ ├── camera-new/ Hardware-accelerated camera (MPP/VPU) +│ └── fluidd-upgrade/ Fluidd upgrade +├── firmware/ Downloaded and generated firmware files +├── scripts/ Build and modification scripts +├── tmp/ Temporary build artifacts +├── tools/ Firmware manipulation tools +│ ├── rk2918_tools/ Rockchip image tools +│ └── upfile/ Firmware unpacking tool +├── Makefile Build configuration +└── vars.mk Firmware version and kernel configuration +``` + +## Configuration + +Edit `vars.mk` to configure base firmware and kernel. + +## Extract Firmware + +To extract and examine the base firmware: + +```bash +make extract +``` + +Output: `tmp/extracted/` + +## Release Process + +The project uses GitHub Actions for automated releases: + +1. Changes pushed to `main` trigger a pre-release build +2. Both basic and extended firmwares are built +3. Version is auto-incremented using `scripts/next_version.sh` +4. Release artifacts are published to GitHub Releases + +## Tools + +### rk2918_tools + +- `afptool` - Android firmware package tool +- `img_maker` - Create Rockchip images +- `img_unpack` - Unpack Rockchip images +- `mkkrnlimg` - Create kernel images + +### upfile + +Firmware unpacking utility for Snapmaker update files. diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 00000000..89d8793c --- /dev/null +++ b/docs/install.md @@ -0,0 +1,50 @@ +# Installation Guide + +This guide covers installing custom firmware on your Snapmaker U1 3D printer. + +> **Warning**: Installing custom firmware may void warranty and could potentially damage your device. Use at your own risk. + +## Prerequisites + +- USB drive formatted as FAT32 +- Downloaded firmware `.bin` file from [Releases](https://github.com/paxx12/SnapmakerU1/releases) + +## Installation Steps + +1. **Download Firmware** + - Get the latest `.bin` file from the [Releases page](https://github.com/paxx12/SnapmakerU1/releases) + - Choose between Basic or Extended firmware based on your needs + +2. **Prepare USB Drive** + - Format a USB drive as FAT32 + - Copy the downloaded `.bin` file to the root of the USB drive + +3. **Install on Printer** + - Insert the USB drive into the printer + - On the printer touchscreen, navigate to: `Settings` > `About` > `Firmware Version` > `Local Update` + - Select the `.bin` file from the USB drive + - Confirm the installation + - Wait for the update to complete (printer will reboot) + +## Post-Installation + +After installation completes: + +- The printer will automatically reboot +- For SSH access, see [SSH Access documentation](ssh_access.md) +- For camera features, see [Camera Support documentation](camera_support.md) +- Fluidd interface will be available (Extended firmware only) + +## Reverting to Stock Firmware + +If you need to revert to the original Snapmaker firmware: + +1. Download the official `.bin` file from the [Snapmaker U1 Wiki](https://wiki.snapmaker.com/en/snapmaker_u1/firmware/release_notes) +2. Follow the same installation steps as above + +## Troubleshooting + +- **Update fails**: Ensure the USB drive is formatted as FAT32 +- **File not found**: Make sure the `.bin` file is in the root directory of the USB drive +- **Printer won't boot**: Try reverting to stock firmware +- For additional help, open an issue on the [GitHub repository](https://github.com/paxx12/SnapmakerU1/issues) diff --git a/docs/ssh_access.md b/docs/ssh_access.md new file mode 100644 index 00000000..5e25efd3 --- /dev/null +++ b/docs/ssh_access.md @@ -0,0 +1,23 @@ +# SSH Access + +**Available in: Basic and Extended firmware** + +The custom firmware enables SSH access to the Snapmaker U1 printer. + +## Credentials + +- User: `root` / Password: `snapmaker` +- User: `lava` / Password: `snapmaker` + +## Connecting + +```bash +ssh root@ +``` + +Replace `` with your printer's IP address. + +## Changing Passwords + +To persist password changes across reboots, you need to enable data persistence. +See [Data Persistence](data_persistence.md) for details. diff --git a/docs/usb_ethernet.md b/docs/usb_ethernet.md new file mode 100644 index 00000000..df06c71d --- /dev/null +++ b/docs/usb_ethernet.md @@ -0,0 +1,16 @@ +# USB Ethernet Adapters + +**Available in: Basic and Extended firmware** + +The custom firmware includes hot-plug support for USB ethernet adapters. + +## Features + +- Automatic DHCP configuration +- Hot-plug detection via udev rules +- Works with standard USB ethernet adapters + +## Usage + +Simply plug in a USB ethernet adapter to the printer's USB port. +The adapter will be automatically detected and configured with DHCP. diff --git a/overlays/basic/scripts/01_store_version.sh b/overlays/basic/scripts/01_store_version.sh new file mode 100755 index 00000000..002c1e26 --- /dev/null +++ b/overlays/basic/scripts/01_store_version.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +ROOTFS_DIR="$(realpath "$1")" + +if [[ -n "$GIT_VERSION" ]]; then + ABBRV=$(git describe --abbrev --always) + + # 0.9.0-paxx12-1-gabcdef0 + echo -n "${GIT_VERSION#v}-${ABBRV}" > "$ROOTFS_DIR/etc/CUSTOM_VERSION" +fi diff --git a/overlays/basic/scripts/01_compile_kernel_modules.sh b/overlays/kernel-modules/scripts/01_compile_kernel_modules.sh similarity index 99% rename from overlays/basic/scripts/01_compile_kernel_modules.sh rename to overlays/kernel-modules/scripts/01_compile_kernel_modules.sh index 00b1b41d..3b2ef2c2 100755 --- a/overlays/basic/scripts/01_compile_kernel_modules.sh +++ b/overlays/kernel-modules/scripts/01_compile_kernel_modules.sh @@ -1,6 +1,5 @@ #!/bin/bash - if [[ $# -ne 1 ]]; then echo "Usage: $0 " exit 1 diff --git a/scripts/next_version.sh b/scripts/next_version.sh new file mode 100755 index 00000000..acdb5157 --- /dev/null +++ b/scripts/next_version.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +ROOT_DIR="$(realpath "$(dirname "$0")/..")" + +source "$ROOT_DIR/vars.mk" + +CODENAME="$1" +VERSION="$2" + +if [[ -n "$VERSION" ]]; then + echo "v$FIRMWARE_VERSION-$CODENAME-$VERSION" + exit 0 +fi + +lastVer=$(git tag --sort version:refname --list "v$FIRMWARE_VERSION-$CODENAME-*" | tail -n1) + +if [[ -n "$lastVer" ]]; then + newVer=(${lastVer//-/ }) + newVer[-1]="$((${newVer[-1]}+1))" + nextVer="${newVer[*]}" + nextVer="${nextVer// /-}" + echo "$nextVer" +else + echo "v$FIRMWARE_VERSION-$CODENAME-1" +fi + diff --git a/vars.mk b/vars.mk index 4b4bdc76..cf24b7c1 100644 --- a/vars.mk +++ b/vars.mk @@ -1,4 +1,4 @@ FIRMWARE_FILE=U1_0.9.0.121_20251106132913_upgrade.bin -FIRMWARE_VERSION=0.9.0.121 +FIRMWARE_VERSION=0.9.0 KERNEL_GIT_URL=https://github.com/rockchip-linux/kernel.git KERNEL_SHA=8533b2249e1550b233a4836d039d64e3bb2fed7a