Vogtinator / nspire-linux-configs

Configuration files used for building the various images for linux on TI-nspire calculators
6 stars 4 forks source link

Creating a Initrd using Buildroot #3

Open kwonj5549 opened 6 months ago

kwonj5549 commented 6 months ago

How do I go about creating a busybox rootfs initrd? I've tried building with Buildroot using the configs in this repo, but I keep getting compilation errors, and I can't figure out what's wrong.

Vogtinator commented 6 months ago

You can read the buildroot documentation. Any armv5l busybox config should work.

kwonj5549 commented 6 months ago

I got it to detect and mount the rootfs initrd but it doesn't get to the root login screen. I am using the busybox.config from this repo and this is my buildroot config. config.txt

Vogtinator commented 6 months ago

Do you see any startup on the screen? If not, make sure console= is set properly, probably console=tty0

kwonj5549 commented 6 months ago

Yes I see start up on the screen

Vogtinator commented 6 months ago

Also the busybox startup, i.e. starting network...? You can also try init=/bin/sh

kwonj5549 commented 6 months ago

It shows this screen image then it gets stuck here image. Also where do I change the init=/bin/sh

Vogtinator commented 6 months ago

dbus-uuidgen? That's definitely userspace but not something I'd expect in a busybox based initrd.

init=/bin/sh is a kernel cmdline parameter which needs to be set in the bootloader config, so the ll2 script you're using.

kwonj5549 commented 6 months ago

I am using the start_initrd.ll2 from the ti nspire linux builds

kwonj5549 commented 6 months ago

Also if i dont have my usb wifi dongle plugged in it doesnt even get to the second screen

Vogtinator commented 6 months ago

Depending on which kernel and DTB you're using there can be some weird behaviour with USB.

kwonj5549 commented 6 months ago

image I got rid of the dbus package so it doesn't show the message but it's still not working. I'm using the zimage, dtb, and start initrd script from the nspire Linux builds.

Vogtinator commented 6 months ago

No idea, I haven't really worked with buildroot for quite a while now. You should definitely try init=/bin/sh though.

kwonj5549 commented 6 months ago

Apparently something was wrong with my original .ll2 script because when I deleted and reuploaded the file it worked. Thanks for your help!

kwonj5549 commented 6 months ago

Also how would I build my own kernel because I'm trying to add a new network driver and it needs a new kernel to be built? Ive tried doing it using the config in the cxii branch but I cannot get it past the linux loader screen, and would I need to make a new dtb?

Vogtinator commented 6 months ago

The config in the CX II branch also needs the kernel from the https://github.com/Vogtinator/linux/tree/cxII-clean branch.

I've got a more recently rebased branch locally which I haven't pushed yet because it takes ages to upload 2years worth of kernel changes...

kwonj5549 commented 6 months ago

Ok, I got the kernel to work, but I need to load the rtl8812au driver for my usb wifi dongle(TP link ac600 nano). I tried putting the source for the driver from rtl8812au into /drivers/net/wireless and updating the kconfig and makefiles and then rebuilt the kernel. However, the usb dongle still shows up as usb0 instead of wlan0 because I don't think the drivers are being loaded or something.

Vogtinator commented 6 months ago

usb0 probably means it's in USB device mode, not host mode.

kwonj5549 commented 6 months ago

How can I get it into usb host mode.

Vogtinator commented 6 months ago

See https://github.com/Vogtinator/linux/commits/cxII-usb-host/

kwonj5549 commented 6 months ago

I built a new kernel using the cxii-usb-host using the cxii-clean config and it still says usb0.

Vogtinator commented 6 months ago

You also need the DTB from that branch.

kwonj5549 commented 6 months ago

now nothing shows up, but thats because I need the driver for the dongle right?

Vogtinator commented 6 months ago

Yep.

kwonj5549 commented 6 months ago

are there any other kernel settings i need to enable?

Vogtinator commented 6 months ago

No idea, you'll have to check the driver code.

kwonj5549 commented 6 months ago

Hmm i can't get it to show up. I don't think my driver is being loaded or something because I don't see anything about 8821au when I do dmesg. Also should "lsusb" print nothing?

Vogtinator commented 6 months ago

lsusb should show it, at least the root port for the USB controller. Make sure the kernel config has the USB host stuff enabled (not sure what exactly) and the DT is the correct one.

kwonj5549 commented 6 months ago

it says /sys/bus/usb/devices: No such file or directory. Im also unsure of what to enable for the USB Host

Vogtinator commented 6 months ago

Check the kernel USB driver section in make menuconfig.

kwonj5549 commented 6 months ago

Would it be support for host side usb? image

Vogtinator commented 6 months ago

Yes, and FOTG210 HCD + then whatever device drivers.

kwonj5549 commented 6 months ago

hmm it keeps saying new usb device found and then usb disconnect over and over again and unable to enumerate usb device. Also ifconfig -a isn't showing my device still.image