friendlyarm / sd-fuse_rk3568

36 stars 15 forks source link

Custom E-Flasher image errors #10

Open robertsLando opened 1 year ago

robertsLando commented 1 year ago

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:

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:

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:

$ sudo
sudo: /etc/sudo.conf is world writable
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Could you help me please?

Thanks

robertsLando commented 12 months ago

kindly ping @lawrencetg

friendlyarm commented 12 months ago

It may be caused by mismatched kernel module versions. Please switch to the kernel-6.1.y branch, and after executing build-rootfs-img.sh, recompile the kernel using build-kernel.sh.

scp pi@192.168.1.60:/rootfs.tar.gz ./rootfs.tar.gz

git clone https://github.com/friendlyarm/sd-fuse_rk3568 --single-branch -b kernel-6.1.y

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

# re-compile kernel, it will re-fill kernel modules to rootfs.img
sudo ./build-kernel.sh 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
xiaoxiaobai123 commented 11 months ago

@friendlyarm 一样的问题 piaNanoPi-R5S: sudo systemctl status sshdsudo: /etc/sudo.conf is world writable,sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

我的镜像是基于rk3568-eflasher-debian-bullseye-core-5.10-arm64-20230908.img,装了开发环境后重新制作的 img

friendlyarm commented 8 months ago

@friendlyarm 一样的问题 piaNanoPi-R5S: sudo systemctl status sshdsudo: /etc/sudo.conf is world writable,sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

我的镜像是基于rk3568-eflasher-debian-bullseye-core-5.10-arm64-20230908.img,装了开发环境后重新制作的 img

刚又试了一下没有遇到这个问题,可能是有文件的权限被损坏导致,注意事项:

1)切换到root用户来操作 2)对rootfs进行解包或打包的操作时,需要使用sudo,如下所示

mkdir rootfs
sudo tar xvzf rootfs.tar.gz -C rootfs
sudo ./build-rootfs-img.sh rootfs debian-bookworm-core-arm64
./mk-emmc-image.sh debian-bookworm-core-arm64
robertsLando commented 8 months ago

I tried it as it was still not working so I gave up

xiaoxiaobai123 commented 4 months ago

@friendlyarm 问题解决了, 用的http://112.124.9.243/dvdfiles/rk3568/images-for-eflasher/ 里面的内核就好了。

05mip commented 2 months ago

Was there ever a solution to this? @friendlyarm @lawrencetg

05mip commented 2 months ago

I figured it out. The original box was flashed with the eflasher friendly core image from the Google Drive which I believe runs on kernel 6.1.25 but some of the eflasher images on this page http://112.124.9.243/dvdfiles/rk3568/images-for-eflasher/ run on 6.1.57.

I just swapped the kernel files to make it work. You could also create a new kernel image if needed