khadas / fenix

One-stop script set to build Ubuntu/Debian images
GNU General Public License v2.0
208 stars 135 forks source link

VIM1 images for Ubuntu 22.04 and Debian 11 won't boot #228

Closed innovara closed 4 months ago

innovara commented 1 year ago

Hi,

I built images for Ubuntu 22.04 (server) and Debian 11 (server) for TF cards and they won't boot up. I tried numerous combinations and the result is always the same. The Khadas logo shows up, it goes, it comes back (loop). I wish I had proper logs or error messages to give you but I failed to find the way to do that.

Furthermore, I tried all the images in https://dl.khadas.com/Firmware/vim1/ubuntu/generic/ for Ubuntu 22.04 (server and gnome) and they don't work either. I have the same problem.

About my build environment, I tried from Ubuntu 22.04 and Ubuntu 20.04 on virtual machines and Ubuntu 22.04 on a physical machine with identical results.

I've tried different TF cards, including different models and makers, and different power cables just in case.

I asked in the community forum if anybody had used these images successfully but it doesn't seem very active.

I've been using the VIM1 with the TF image for Ubuntu 20.04 (downloaded from Khadas) and it works perfectly well. I can flash that one any time and it just works. I've also been able to flash Ubuntu 18.04 to the eMMC and it works too.

Have you been able to confirm that the VIM1 works with the images the script builds for Ubuntu 22.04 and Debian 11 with linux kernels 6.0 and 6.1?

Is there any way I can enable a debug mode while building the image to provide you with more useful details of what goes wrong?

Thank you

innovara commented 1 year ago

This is the solution for those who may end up here asking themselves the same question.

The problem is that the images for Ubuntu 22.04 under the ‘generic’ folder (dl.khadas.com - Index of /products/vim1/firmware/ubuntu/generic/) which are meant to be for TF cards are in fact for eMMC.

However, those are not images that you would burn with the USB tool. Those are images that you burn with the handy oowow tool (https://dl.khadas.com/products/vim1/firmware/oowow/). Using oowow you can connect to the internet and download the images from dl.khadas.com - Index of /.images/vim1/ or you can download the image to a pendrive and burn it to the eMMC. I am not going to go into the details of how you go about either of those options but basically you need to burn the oowow image to a microSD card and boot from it, then the rest.

The Fenix script is what I guess they use to build those images, therefore they are also for the eMMC card (tested and confirmed). This is despite all the documentations and script saying to the contrary. It’s quite a shame that all that amount of work to put together so many pieces of code gets ruined by not documenting it at all or incorrectly. Or at least not keeping the documentation up to date.

Lastly, currently the pre-built images for Ubuntu and the Fenix script, use the linux kernel 6.1.y from the Khadas repository and their standard config file doesn’t include the nf_tables module. That is a massive problem in Ubuntu 22.04, and I imagine Debian 11, because it’s their default firewalling framework and according to my testing, the legacy iptables doesn’t work properly without it.

With a bit of editing, you can enable it, and then build the image with the Fenix script. I’m going to send a PR and hopefully they’ll enable it. The file is ./build/linux/arch/arm64/configs/kvims_defconfig and you have to add the following:

CONFIG_NF_TABLES=m
CONFIG_NF_TABLES_INET=y
CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_NUMGEN=m
CONFIG_NFT_CT=m
CONFIG_NFT_CONNLIMIT=m
CONFIG_NFT_LOG=m
CONFIG_NFT_LIMIT=m
CONFIG_NFT_MASQ=m
CONFIG_NFT_REDIR=m
CONFIG_NFT_NAT=m
CONFIG_NFT_TUNNEL=m
CONFIG_NFT_OBJREF=m
CONFIG_NFT_QUEUE=m
CONFIG_NFT_QUOTA=m
CONFIG_NFT_REJECT=m
CONFIG_NFT_REJECT_INET=m
CONFIG_NFT_COMPAT=m
CONFIG_NFT_HASH=m
CONFIG_NFT_XFRM=m
CONFIG_NFT_SOCKET=m
CONFIG_NFT_OSF=m
CONFIG_NFT_TPROXY=m
CONFIG_NFT_SYNPROXY=m
CONFIG_NF_DUP_NETDEV=m
CONFIG_NFT_DUP_NETDEV=m
CONFIG_NFT_FWD_NETDEV=m
CONFIG_NFT_REJECT_NETDEV=m
pascalbourges commented 10 months ago

Hi, i am new with vim1, i have boot on oowow, and install vim1-ubuntu-22.04-server-linux-6.1-fenix-1.4-221229.img.xz from download. It seems ok but after reboot, the vim1 loop. I have nevers access ubuntu. The only i can flash with usb burning tool is https://dl.khadas.com/products/vim1/firmware/ubuntu/emmc/vim1-ubuntu-18.04-xfce-linux-4.9-fenix-1.1.1-220725-emmc.img.xz Can you detail me how to install ubuntu 22 or better last debian, but i have nevers get a debian ok.

innovara commented 10 months ago

Did you use the option 'Write Image to eMMC' to flash this image: https://dl.khadas.com/products/vim1/firmware/ubuntu/generic/vim1-ubuntu-22.04-server-linux-6.1-fenix-1.4-221229.img.xz?

pascalbourges commented 10 months ago

Yes, but i have loops on boot, there is a quick message about partition not found or something like this.

Le mar. 3 oct. 2023 à 21:26, innovara @.***> a écrit :

Did you use the option 'Write Image to eMMC' to flash this image: https://dl.khadas.com/products/vim1/firmware/ubuntu/generic/vim1-ubuntu-22.04-server-linux-6.1-fenix-1.4-221229.img.xz ?

— Reply to this email directly, view it on GitHub https://github.com/khadas/fenix/issues/228#issuecomment-1745587812, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6BHVJAKE2VYBBY7ZQ5WUDLX5RRGLAVCNFSM6AAAAAAUE3J67GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGU4DOOBRGI . You are receiving this because you commented.Message ID: @.***>

innovara commented 10 months ago

Unfortunately, the VIM1 that I use is on a remote location so I can't really test anything in this regard.

If I recall correctly, there is an option under Advance to wipe/format the eMMC memory. I would certainly do that before flashing the image.

I built my own image with the Fenix script because nftables is not enabled on theirs. But their image worked in terms of booting, etc. I can give you some details about how to do that but this is not the correct place for it, I think. It's better if you register on their forum to continue this conversation and ask for help under the VIM1 section: https://forum.khadas.com. Others might be able to help as well.

I have also just built the images for Ubuntu and Debian but as I said I can't test them. I only know that the Fenix script does its job and I could share them with you.

Lastly, a couple of links that may help you: https://forum.khadas.com/t/ubuntu-22-04-on-vim1-doesnt-boot/18253/2 https://forum.khadas.com/t/how-to-add-uboot-to-vim1-ubuntu-generic-6-1-image/20286