在網路上有人出清二手的 Orange Pi Zero,雖然是十多年前的產品,但拿來當 Klipper 的上位機還蠻適合的。
Orange Pi Zero 和 Orange Pi One 類似,但有 wifi,不用再另外花錢買 wifi 裝置。另外,只有一個 DRAM 晶片,因此記憶體最大只有 512MB,預設是 256MB。使用 H2+ CPU,是 H3 CPU 的閹割版,但對 klipper 的運作影響不大。
賣家出貨,512MB 和 256MB,隨機出貨,256MB 的板子比較多。
Pi Zero 與 Pi One 的差異
Orange Pi One 發表於 2016年 1月,CPU 為 H3,2個記憶體晶片,標準 512MB,最多可以升級至 1GB。Pi Zero 則發表於 2016年 12月,CPU 為 H2+,H2+ 為 H3 的降級版,1個記憶體晶片,標準 256MB,最多可以升級至 512MB。
Armbian/build 建立的 Pi Zero 的 image,在使用時有一些問題,如 reboot 會卡在 "Restarting system"。後來無意中,發現使用 Pi One 的 image 也可以開機,且 reboot 可正常開機。看電路圖,Pi One 和 Pi Zero 很類似,可能這樣才能用 Pi One 的 image 來啟動 Pi Zero 吧。
$ # Create a temp folder on a disk that has a lot of space:
sudo mkdir -p /bigtmp
# Set generous access to the temp folder:
sudo chmod 777 /bigtmp
# Change TMPDIR env to the big folder you just created:
export TMPDIR=/bigtmp
# install package
Mounting an Armbian .img file on Linux using a loop device is a very common task, typically done to inspect, modify, or extract files from the image before flashing it to an SD card.
Armbian images (like most single-board computer OS images) are usually disk images containing multiple partitions (e.g., a small boot partition and a larger root filesystem partition). Therefore, you need to expose these individual partitions from the .img file and mount them separately.
Here's a step-by-step guide on how to do it:
Prerequisites:
Armbian .img file: Make sure you have the .img file. If it's compressed (e.g., .img.xz, .img.gz), you need to decompress it first.
Decompress .xz:unxz your_armbian_image.img.xz
Decompress .gz:gunzip your_armbian_image.img.gz
Required Tools: Most Linux distributions have these pre-installed or readily available.
losetup: For creating and managing loop devices.1
mount: For mounting filesystems.
fdisk (or parted): For inspecting partition tables.2
sudo: For elevated privileges.3
Step-by-Step Guide:
1. Create Mount Points
You'll need separate directories on your host system where you want to mount the partitions from the image. A typical Armbian image has at least two partitions: a boot partition (often FAT32) and a root filesystem partition (often Ext4).
sudo: Required for losetup as it interacts with kernel devices.
your_armbian_image.img: Replace this with the actual path to your Armbian .img file.
-P (or --partscan): This tells losetup to scan the image for partitions and automatically create separate loop devices for each partition found (e.g., /dev/loop0p1, /dev/loop0p2).
--find: Finds the first available (unused) loop device.
--show: Prints the name of the main loop device it used (e.g., /dev/loop0). Make a note of this device, as you'll need it for detaching later.
Example Output:
If it outputs /dev/loop0, then you should now have /dev/loop0p1 and /dev/loop0p2 (or more, depending on the image) available as distinct partition devices. You can verify this with:
Bash
ls -l /dev/loop0p*
You should see entries like /dev/loop0p1 and /dev/loop0p2.
3. Inspect Partition Types (Optional but Recommended)
Before mounting, you can quickly check the filesystem type of each partition to ensure you use the correct mount options (though mount is often smart enough to auto-detect).
This indicates an Ext4 filesystem, typical for the root filesystem.
4. Mount the Partitions
Now, mount the individual partitions to your created mount points.
Bash
# Mount the boot partition (usually FAT32)
sudo mount /dev/loop0p1 /mnt/armbian_boot
# Mount the root filesystem partition (usually Ext4)
sudo mount /dev/loop0p2 /mnt/armbian_rootfs
If mount complains about a wrong fs type, you might need to specify it explicitly:
sudo mount -t vfat /dev/loop0p1 /mnt/armbian_boot
sudo mount -t ext4 /dev/loop0p2 /mnt/armbian_rootfs
5. Access and Modify Files
You can now navigate into the mounted directories and access/modify files as needed.
Bash
ls /mnt/armbian_boot
ls /mnt/armbian_rootfs
cd /mnt/armbian_rootfs
# ... make your changes ...
6. Unmount the Partitions and Detach the Loop Device
This is a critical step to avoid data corruption. Always unmount the partitions and detach the loop device gracefully before removing the image file or doing anything else with it.
Bash
# Unmount the partitions first
sudo umount /mnt/armbian_boot
sudo umount /mnt/armbian_rootfs
# Detach the main loop device (replace /dev/loop0 with the actual device from step 2)
sudo losetup -d /dev/loop0
Alternative (Older/Less Common for Multi-Partition Images): kpartx
If losetup -P doesn't work for some reason (e.g., very old kernel), kpartx is an alternative.
Install kpartx:
Bash
sudo apt install kpartx # For Debian/Ubuntu# sudo pacman -S kpartx # For Arch Linux
Create device mapper entries:
Bash
sudo kpartx -av your_armbian_image.img
This will output lines showing where it created mappings, e.g., /dev/mapper/loop0p1, /dev/mapper/loop0p2.
Mount: Use these /dev/mapper/ devices to mount:
Bash
sudo mount /dev/mapper/loop0p1 /mnt/armbian_boot
sudo mount /dev/mapper/loop0p2 /mnt/armbian_rootfs