I have a NanoPI-RC5 4GB, I installed all the software I needed and then i wanted to create an eflasher image to burn it to other devices.
To do this I followed the following steps:
On the device:
On the host:
Then I used the rpi imager tool to write the image to the sd card. At this point I mouynted the sd card on the NanoPI and let it write my image on the eMMC. All this steps completed successfully but when I removed the sd card and booted the device I got some errors on:
1. Interfaces are not detected, both LAN and WAN ports doesn't work, also running `nmcli device show` doens't show any interfaces, only loopback (lo)
2. sudo command is not working:
The only working way I found to make a working backup is to use the backup tool of EFLASHER image, probelm with that is the backup created equals the EMMC size (in my case it is ~30GB) and that not very portable and also so slow to restore in another device. In case the first method don't work I could also suggest to add a shrink image utility that shirnks the image to only the occupied size and extends rootfs filesytem on first boot.
Thanks in advance
To do this I followed the following steps:
On the device:
Code: Select all
sudo su
cd /
tar --warning=no-file-changed -cvpzf /rootfs.tar.gz \
--exclude=/rootfs.tar.gz --exclude=/var/lib/docker/runtimes \
--exclude=/etc/firstuser --exclude=/etc/friendlyelec-release \
--exclude=/usr/local/first_boot_flag --one-file-system /
On the host:
Code: Select all
scp pi@192.168.1.60:/rootfs.tar.gz ./rootfs.tar.gz
git clone https://github.com/friendlyarm/sd-fuse_rk3568 --single-branch -b master
mv rootfs.tar.gz sd-fuse_rk3568
cd sd-fuse_rk3568
# extract the backup rootfs into the rootfs folder
mkdir rootfs && tar xzf rootfs.tar.gz -C rootfs
# download the base image
wget http://112.124.9.243/dvdfiles/rk3568/images-for-eflasher/debian-bullseye-core-arm64-images.tgz
tar xzf debian-bullseye-core-arm64-images.tgz
# build the image with the backup of rootfs
sudo ./build-rootfs-img.sh ./rootfs debian-bullseye-core-arm64
# download eflasher image
wget http://112.124.9.243/dvdfiles/rk3568/images-for-eflasher/emmc-flasher-images.tgz
tar xzf emmc-flasher-images.tgz
# burn the previous image into the emmc-flasher image
./mk-emmc-image.sh debian-bullseye-core-arm64 autostart=yes
# this will create file under `out` folder
cd out
# compress the image
gzip rk3568-eflasher-debian-bullseye-core-5.10-arm64-20231016.img
Then I used the rpi imager tool to write the image to the sd card. At this point I mouynted the sd card on the NanoPI and let it write my image on the eMMC. All this steps completed successfully but when I removed the sd card and booted the device I got some errors on:
1. Interfaces are not detected, both LAN and WAN ports doesn't work, also running `nmcli device show` doens't show any interfaces, only loopback (lo)
2. sudo command is not working:
Code: Select all
$ sudo
sudo: /etc/sudo.conf is world writable
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
The only working way I found to make a working backup is to use the backup tool of EFLASHER image, probelm with that is the backup created equals the EMMC size (in my case it is ~30GB) and that not very portable and also so slow to restore in another device. In case the first method don't work I could also suggest to add a shrink image utility that shirnks the image to only the occupied size and extends rootfs filesytem on first boot.
Thanks in advance