Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install OpenWRT on EMMC (Odroid N2+) #201

Closed
RhynoTech opened this issue Jan 27, 2022 · 7 comments
Closed

Install OpenWRT on EMMC (Odroid N2+) #201

RhynoTech opened this issue Jan 27, 2022 · 7 comments

Comments

@RhynoTech
Copy link

Seem to be having issues installing OpenWRT on my Odroid N2+ EMMC module. I've tried both the custom dtb file and the regular N2 in the drop down list. Each time I get the below error. Currently running OpenWRT on the microSD card. I have tried to plug in the microSD card into a USB adapter but can't seem to boot from the petiboot menu for some reason. I do have a EMMC microSD adapter. Is there something I'm doing wrong or can I install the correct img directly to the EMMC module using my computer?

Thanks again for all your help.

image

@ophub
Copy link
Owner

ophub commented Jan 28, 2022

install_emmc="$(lsblk -l -o NAME | grep -oE '(mmcblk[0-9]?boot0)' | sed "s/boot0//g")"

try booting with usb, Maybe your sd card can be checked to contain mmcblk[0-9]?boot0, and it is recognized that it is already in emmc

@RhynoTech
Copy link
Author

RhynoTech commented Jan 28, 2022

Well that does make sense, the microSD card is mounted as mmcblk. Now as far as booting the Odroid N2+ from USB this has been a bit of a challenge.

I've tried booting the N2 using SPI into petitboot but was unable to get it to recognize the OpenWRT USB. I even updated petitboot to the latest version as I found some people have been able to boot from USB but only specific versions of Armbian.

Then I tried to load it using a microSD card modifying the uEnv.txt file on the boot partition and changed the root=UUID=<etc> to match the USB device root=/dev/sda1 essentially using the microSD card to boot the USB drive. This did actually work but when I tried to remove the microSD card to avoid the conflict of the mmcblk everything failed.

Last thing I tried was flashing the OpenWRT img directly to the EMMC module and modifying the uEnv.txt and changing the following to FDT=/dtb/amlogic/meson-g12b-odroid-n2-plus.dtb. Again this failed to boot fully and gave some errors.

I'm out of ideas, is there a way I can modify the EMMC module directly to get this to work? Thanks again for any help you can provide.

@ophub
Copy link
Owner

ophub commented Jan 28, 2022

Since the 5.4 kernel does not require special boot files such as u-boot, you can dd directly to emmc. Then switch to 5.10 or other kernels by updating and upgrading.

Or you can modify the installation script and install it as the correct path of your emmc. like

install_emmc="$(lsblk -l -o NAME | grep -oE '(mmcblk[0-9]?boot0)' | sed "s/boot0//g")"

#Fill in according to the actual situation
install_emmc=mmcblk2

@RhynoTech
Copy link
Author

Well... that was staring me in the face in your first comment lol

Something I noticed from my earlier experiments was that the meson-g12b-odroid-n2-plus.dtb isn't included in the release but exists in the repo. Is this intentional?

After adding that file to the boot partition along with the other dtb files and modifying the install script to write to the mmcblk2 device. It seems to install the files but fails to mount.

I turned off the N2+ removed the microSD and it boots up, unfortunately not successfully and spits out some errors.

Sorry for the bad image, the only display I have seems to get cut off.

I'm trying to take advantage of the processing power on the N2+ to get maximum speeds for OpenVPN. Is that what the dtb file is for, setting the CPU voltage etc?

Thanks again for your assistance.

PXL_20220128_064329913

@ophub
Copy link
Owner

ophub commented Jan 28, 2022

Since the box is expensive, there are few users and lack of testing. If you match the appropriate dtb and u-boot files, please give your feedback and modify the default configuration file.

45:Hardkernel ODroid N2:s922x:meson-g12b-odroid-n2.dtb:u-boot-gtkingpro.bin:/lib/u-boot/odroid-n2-u-boot.bin.sd.bin:NA:2C@1800Mhz(A53)+4C@1908Mhz(A73),4GB Mem,1Gb Net

meson-g12b-odroid-n2.dtb
meson-g12b-odroid-n2-plus.dtb

You can try the 5.4 kernel first, it doesn't need u-boot, so just select the correct .dtb and you can use it.
Then test which /boot/u-boot file is appropriate

@RhynoTech
Copy link
Author

RhynoTech commented Jan 28, 2022

I can confirm its working. I've added a new entry to the above install script which is just a copy of entry 45 then modified the name, dtb file and description of the cpu. After running the script in the terminal and not installing the u-boot when asked I was able to confirm that everything installed correctly and is currently running off the EMMC module.

Sorry for my lack of understanding but what is the benefit of using u-boot? Also whats the difference between 5.4 and 5.10, I just assumed 5.10 is where most of the new development takes place and 5.4 is more stable?

I will do some more testing with the u-boot file tomorrow as I need to get some sleep before work but thanks again for all your help.

Would it help if I created a MR/PR that included some of these changes. I also found your changes for when you added the N2 to the make file for automated building of the image. If my tests work out I could potential add those changes as well. Let me know what works best for you and I'll do my best to help out ;)

@ophub
Copy link
Owner

ophub commented Jan 28, 2022

5.4 and 5.10/5.15 are the official long-term maintenance kernels of kernel.org, which will be very stable. Generally speaking, newer versions will add new feature support and be better.

However, in versions 5.10 and later, there is an additional /boot/u-boot.ext file to boot.

After you determine which dtb file is in 5.4, it has the same name in 5.10.

download and test: openwrt_s922x-n2_k5.10.94_2022.01.28.1402.img.gz

@ophub ophub closed this as completed Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants