Use systemd-nspawn
on Arch Linux with debootstrap:
sudo debootstrap --include=systemd-container --components=main,universe jammy ubuntu22.04-rk3568 http://archive.ubuntu.com/ubuntu/
Packages to install:
apt install wget curl git python2 android-sdk-libsparse-utils build-essential bison bc cpio time gawk unzip unzip libncurses-dev file python3-distutils
Load environment:
sudo systemd-nspawn -b --bind ~/tmp/repos/sd-fuse_rk3568:/build/sd-fuse_rk3568 -D ~/tmp/ubuntu22.04-rk3568
./build.sh rk3568.mk
...
[INFO]: prepare rootfs.img ...
WARNING: tempfile is deprecated; consider using mktemp instead.
Creating filesystem with parameters:
Size: 444596224
Block size: 4096
Blocks per group: 32768
Inodes per group: 6784
Inode size: 256
Journal blocks: 1696
Label: rootfs
Blocks: 108544
Block groups: 4
Reserved block group size: 31
Suggest size: 406847488
Created filesystem with 10881/27136 inodes and 94843/108544 blocks
'/build/friendlywrt22-rk3568/scripts/sd-fuse/prebuilt/parameter.template' -> 'friendlywrt22/parameter.txt'
generating friendlywrt22/parameter.txt done.
0
generating friendlywrt22/rootfs.img done.
0
Generating empty userdata.img (size:104857600)
Creating filesystem with parameters:
Size: 104857600
Block size: 4096
Blocks per group: 32768
Inodes per group: 6400
Inode size: 256
Journal blocks: 1024
Label: userdata
Blocks: 25600
Block groups: 1
Reserved block group size: 7
Suggest size: 25165824
Created filesystem with 11/6400 inodes and 1438/25600 blocks
-----------------------------------------
rootfs dir:
/build/friendlywrt22-rk3568/scripts/sd-fuse/out/rootfs.8yKkb9usV
boot dir:
/build/friendlywrt22-rk3568/scripts/sd-fuse/out/boot.cVJLeBie5
-----------------------------------------
Creating RAW image: out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img (1000 MB)
---------------------------------
0+0 records in
0+0 records out
0 bytes copied, 2.0559e-05 s, 0.0 kB/s
----------------------------------------------------------------
[out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img] capacity = 953MB, 999999488 bytes
current out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img partition:
----------------------------------------------------------------
parsing ./friendlywrt22/parameter.txt:
create new GPT 9:
----------------------------------------------------------------
copy from: ./friendlywrt22 to out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img
[RAW. 0]: 284 KB | ./friendlywrt22/idbloader.img > 100% : done.
[RAW. 1]: 4096 KB | ./friendlywrt22/uboot.img > 100% : done.
[RAW. 2]: 48 KB | ./friendlywrt22/misc.img > 100% : done.
[RAW. 3]: 1 KB | ./friendlywrt22/dtbo.img > 100% : done.
[RAW. 4]: 3387 KB | ./friendlywrt22/resource.img > 100% : done.
[RAW. 5]: 37832 KB | ./friendlywrt22/kernel.img > 100% : done.
[RAW. 6]: 7308 KB | ./friendlywrt22/boot.img > 100% : done.
[RAW. 8]: 375850 KB | ./friendlywrt22/rootfs.img > 100% : done.
[RAW. 9]: 5752 KB | ./friendlywrt22/userdata.img > 100% : done.
----------------------------------------------------------------
---------------------------------
RAW image successfully created (15:19:08).
-rw-rw-r-- 1 build build 999999488 Sep 25 15:19 out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img
Tip: You can compress it to save disk space.
-----------------------------------------
Run the following command for sdcard install:
sudo dd if=out/friendlywrt_22.03_20220925_rk3568_arm64_sd.img bs=1M of=/dev/sdX
-----------------------------------------