OpenWrt 21.02.2 drivers

Hello!
I am trying to make a router from Samsung N145 Plus laptop. (21.02.2 x64)
When i boot it from usb flash drive i cannot get any connection to it. As i understand that is because of missing drivers. When i boot windows 7 ethernet adapter shows: Generic Marvell Yukon 88e8040 PCI-E fast ethernet and wireless connection: intell centrino wireless-N 100.
Where can i get these drivers and how to install them? Is it possible to install from usb flash drive?
Sorry for my questions if they are dumb, i am new to linux.

Have you tried booting a more general linux USB live desktop distro at all to see if the wired network and wireless network hardware function?

Although it might not be your purpose to run a linux Desktop it will certainly help you figure out the puzzle to determine which drivers/kernel modules you need in the OpenWrt image to get your hardware functioning here's a start. Open a terminal on a regular USB live linux (desktop) distro and type:

lspci -v #will show that the marvel yukon uses the 'sky2' kernel module (driver)
lspci -n #will show device id xxxx:yyyy and driver module

lsusb #shows device-id
lsusb -t #shows driver modules used

Linux kernel modules (drivers) don't actually name up identical to OpenWrt kmod here is a list:
https://openwrt.org/packages/index/kernel-modules

Driver modules ofter don't come alone as in dependencies especially installing them on OpenWrt doesn't satisfy dependencies automatically. You will probably need a few modules and sometimes firmware before a device works with a driver. To figure out multiple modules used by USB devices its a good idea to boot a common linux desktop distro without the USB device connected and than run from terminal lsmod | sort than connect USB device and run again lsmod | sort to compare which modules were loaded.

The default OpenWrt x86/amd64 image, won't come with this 'driver' by default so you need to use the 'imagebuilder' to make your own image.
This can be done on your local machine or by using a webfrontend imagebuilder and configure it to contain the kernel driver package kmod-sky2.

Go to the following link and 'customize' the 'package' selection to contain the driver:
https://asu.aparcar.org/?version=21.02.2&target=x86%2F64&id=generic

Also remember that Intel Wireless cards mostly do 'client mode' and limited or not 'accesspoint mode'!

It is also possible to transfer driver / kmod files via USB flashdrive, but as a linux newby this will take serious more effert first you need to figure which drivers.

Since you need to have kmod's for usb chipset, masterstorage, filesystem (FAT32/NTFS/EXFAT) support, manually mount the partition on the USB flashdrive and than maybe complete dependencies of all related ipk files manually...
https://downloads.openwrt.org/releases/21.02.2/targets/x86/64/packages/

1 Like

i did not tried any other linux on that pc, i very liked your solution with web imagebuilder.
As a wireless card i intend to use rtl8812au or rtl8188su
could you please point me how to add those drivers too? Do i have to just add packadge name without .ipk from supplementary file page?
And how can i figure out if i need any dependincies for them?
Adding pciutils or usbutils would also be useful?

The driver method for wireless is the same, however it might need 'firmware' files sometimes which might also come with other packages. If you get the wired ethernet working with dns/defaultroute/gateway you might just: wget http://someexamplewebsite.com/networkfirmware/example.fw and directy download it to the router copy it to /lib/firmware/

First start with a USB live linux desktop distro and figure out if all the drivers/modules/firmware fit in to place. By using dmesg on the linux desktop it may show which devices load/need firmware!

This samsung netbook also comes with Atheros wifi chipset in some models which can handle "Accesspoint mode" fine.

Do i have to just add packadge name without .ipk from supplementary file page?

Yes so for marvell driver just add to the list kmod-sky2 and NOT kmod-sky2_5.4.179-1_x86_64.ipk.

And how can i figure out if i need any dependincies for them?

If I'm not mistaken the builder does a lot of dependency resolving it self.

1 Like

Thank You for your help!
Could you please point me the driver for that intel driver too?
The desktop linux option i will try later, need to go to work right now.

Cannot and will not write up every step beforehand (crystal ball...) There are alot of steps that might be different depending on your success rate and specific hardware needs. In my opinion its better to just start with the small things.

Get the right OpenWrt image to install and or boot, it may or may not boot OpenWrt directly from a USB flashdrive. If it runs from a USB flashdrive it may only boot the kernel and cannot find the USB filesystem afterwords...
You might need to flash OpenWrt to a disk connected to the internal hdd SATA controller. Using a USB live linux (desktop) distro you can erase/overwrite the internal hdd to install OpenWrt using:dd if=openwrt.img of=/dev/sdX conv=sync status=progress. Since its a laptop/netbook you can see the kernel boot from the display without any network hardware working. You can logon to the router from the keyboard on the netbook itself. But without any network interfaces or usb connectivity the fun cannot begin.

From there first try to get a wired ethernet interface (Marvell Yukon sky2) to work using a customized imagebuilder build (see earlier topic) and logon into the router with ssh from the network and configure it with LAN dhcp server disabled and LAN (static IP/DHCP-client) & gateway & dns so it can access the internet and manage it from one single interface and you can get the opkg package manager to work.

From there if internet works on the OpenWrt you can experiment on the router itself with opkg update;opk install whatever-module-or-package-name until USB interfaces work, USB storage devices work, Filesystems work, USB wifi etc. or PCI wireless works. All with opkg. Goodluck.

Sorry did not understand what about is the first part of your message.
But i already followed your previous advise, made in webbuilder custom firmware with driver you provided and ethernet port works! And i can now even get in luci interface from my pc to openwrt! :slight_smile: I also installed rtl8812 driver and rtl 8xxxu driver in configurator, but seems some dependencies are not there, after connecting 8812au dongle, i can see nearby wifi points but can not connect to them. (after connecting attemtp seems like dongle does not respond anymore)

You helped me alot!

Good to hear you have some success, since we(forum users) are still speculating about your whole setup/configuration how do you connect to the internet in the first place?

My guess was wired but since you mentioned you need to share the internet from your laptop sounds to me you're likely using wireless or just have 1 single wired ethernet interface availble with no network switch or even a hub? This makes it harder to work only on the netbook openwrt router or laptop not at the same time...

There are multiple way's to configure a OpenWrt router, with graphical frontend luci (webinterface), via command line interface uci, or all by hand doing opkg, ifconfig -a,iwconfig, iwlist chan interfacename, iwlist scan interfacename, whatever with just plain text editing using vi or nano and manually restarting services after you edit config files /etc/init.d/someservice restart. These are roughly 3 ways to configure the router, the 4th way might actually be including the config within the imagebuilder.

The command line interface can be accessed directly from your netbooks keyboard and screen compared to graphical interface luci whichs depends on your other laptop being connected. As a shell text editor for newby's I suggest also suggest you to add nano text editor to the custom firmware just like you added kmod-sky2 earlier. And from the netbook edit some config files directly for instance: nano /etc/config/network or /etc/config/network/dhcp. You can quit/exit the nano text editor using keyboard shortcut CTRL-X to save and quit with answering Y. The native text editor vi is harder to explain for newcomers but is good to learn since it ships on alot of linux/unix embedded systems.

If you are certain that your OpenWrt image installs/works as in boots/reboots with keeping it settings saved and have access to the internet with a working WAN or LAN-client config? Are you here yet?

Than you can continue to discover the wireless stack(drivers plus config/management tools) or other interfaces with ease. Again the wireless config and management tools differ among the different manufacturers. You mentioned you already had some success using scanning. If your internet options are limited in your current situation do you happen to have USB-ethernet dongle or USB-bluettooth dongle or even USB-mobile phone tether Android/IOS?

I have a regular windows pc, my internet connections are: neighbors wifi, and android phone wifi or usb tethering. My goal is to make a router from that old laptop, that is going to get internet as wifi client and pass it to my pc, by wire or by wifi (i understand that i need two wifi interfaces for that). And of course i need firewall (if i understand that correctly) so that my home network was isolated and i did not see neighbors tv in my YouTube :D. I already done that once for my friend with xiaomi 4a router where i installed openwrt, i am not sure if i configured there all correctly, but devices from another apartment became invisible in YouTube apps. (Where YouTube suggests to play video on another device). :slight_smile:
Yes, i have a Bluetooth dongle, and i have an old mikrotik router (rb951ui-2nd) and asus rt-ac58u v2 (not yet compatible with openwrt) both stock firmware.
I also understand tha i can try to configure it from laptops keyboard, but thats a little bit complicated for me, because most of the time i am triyng to copy paste commands from internet and dont really understand what they are doing. I have a lot to learn here.
right now i tried to get connetion to laptop openwrt from pc like that: pc gets internet by wifi, laptop is connected by wire, on a pc i allowed to share connection in wifi properties to local network. But i cant figure out what ip settings i need to use for a pc and laptop. Tried to put dhcp client in openwrt luci and also tried to input static ip (in network-iterfaces-lan) no luck yet.

In my opinion the first goal needs to be internet on the netbook/OpenWrt router, so you can easily and quick experiment with opkg to get the right packages and modules which is a lot easier than blindly building imagebuilder images/reflashing them and try if the work...

Does the mikrotik router come with a wifi interface and multi ethernet port switch? Configure it the right way so the wireless WAN does DHCP-client to nearby wifi internet and the wired LAN interface of the mikrotik does DHCP server to your netbook Openwrt router and your laptop.

If this is not an option, focus on getting Android tether working on netbook OpenWrt router by including as much of the packages named in this howto into your current the netbuilder image:

Thank You
I edited myprevious post, added some information.
Yes getting internet on the openwrt is my main goal now and from the moment i got the ethernet adapter working.
Could you please tell me what settings i should put in openwrt to allow it to get internet from lan port (laptop has only one ethernet port) and still be accessible. Like you wrote me before: configure it with LAN dhcp server disabled and LAN (static IP/DHCP-client) & gateway & dns so it can access the internet and manage it from one single interface
I am following your advice and reading your posts carefully, but that moment needs more explanation for me.
And please if that is ok, i feel more comfortable with luci, than with commands in terminal.

tried to get connetion to laptop openwrt from pc like that: pc gets internet by wifi, laptop is connected by wire, on a pc i allowed to share connection in wifi properties to local network. But i cant figure out what ip settings i need to use for a pc and laptop. Tried to put dhcp client in openwrt luci and also tried to input static ip (in network-iterfaces-lan) no luck yet.

This is a good point to start from here (windows internet connection sharing) if you don't know how to setup it the mikrotik router! Thats fine.

But sorry to say you gonna need to get used to do all three way's of doing setup the OpenWrt router GUI/CLI, since you are currently developing your own netbook Router :wink: so you are little bit of a developer not only a user therefor have to do a little bit of everything. Don't blindly type commands.

I might sound harsh but its a lot harder for me to explain GUI webinterface options with words or even screenshots than dropping a single line or block of code. To get your router connected via its LAN interface to the internet.

The first commands you need to learn is opening and closing the texteditor nano than edit and save some files and restarting the services. Please come back if you have nano text editor included in your netbook OpenWrt router imagebuilder. From there we will continue step by step.

Am I correct you can access the OpenWrt shell via the netbook its keyboard and lcd screen?

Yes, correct, i can use netbooks keyboard an lcd, also i can ssh to it from pc cmd, and also luci.
I understand that i need to learn commands and trying to learn them, but it takes a lot of time, because i need explanation for every command and even sometimes explanation for explanations :smiley:
And also takes a lot of googling about how that firewall, ip and etc. stuff works, and how i need to configure it

Please start with a clean imagerbuilder image with only kmod-sky2 and nano no other settings edited. And have your windows machine share its wifi to ethernet port. We may have you up and running in no time ;-).

And also takes a lot of googling about how that firewall, ip and etc. stuff works, and how i need to configure it

One thing at the time...

EDIT: text editor nano comes with these 2 dependencies add them all if it didn't work:
libncurses6 terminfo nano

Done!
image built and flashed onto usb stick, i choose squash efi version if that matters.
Also i believe that settings i made are saved because if i choose password it stays after reboot.
What i should do next? i need to configure network and dhcp files, but what ip settings or other settings i need to write there?

i choose squash efi version

Your dated netbook probably didn't come with UEFI firmware support, however I also guess that OpenWrt EFI image also contains MBR/BIOS compatible loader as well and therefor boots on your system. Going squashfs is definitly the way to go for router with some Power-cut/loss survive options, whoever there might be a bug in squashfs that if you re-image the filesystem for an upgrade or to reset it it will keep the older settings... so you have to re-image it. Combined means kernel+filesystem.

What i should do next? i need to configure network and dhcp files, but what ip settings or other settings i need to write there?

Yep, good to see the password was saved after reboot. Its good to EDIT/write up in the end most steps how your startted and things that worked for you in your "original post" but that will come later.

The following assumptions are made, that your Windows internet connection sharing from wifi to ethernet on your laptop is working. I guess windows acomplishes this by turning on a DHCP server with some NAT&forwarding and subnet config and if you connect a wired device with DHCP client it just works with internet?

Although netbook/OpenWrt router has one interface which is by default configured as LAN with static IP and DHCP server, you won't get the connectivity you wan't since windows laptop also is DHCP server and OpenWrt will not look for internet on the LAN interface...

WAN and LAN naming are just more consumer based terms that might give an idea where the internet resides and where the local network resides assisted with some firewall and nat rules. But a router is just a device that routes between networks... no direction whatsoever...

We have roughly 2 options to make OpenWrt connect to internet:
Option1: Alter the single interface from LAN to WAN in /etc/config/network, but since its your only interface you would also have to alter the firewall rules for ssh and luci webinterface access if you want to access them by your Laptop you lockout yourself. This is the easiest way to start and see if internet connection sharing is working, we won't connect with laptop to ssh or luci webinterface because you can just check with shell on the netbook keyboard lcdscreen if internet is working.

cd /etc/config #changes directory to config folder
ls #lists content of folder
ls -la #list contents of folder in with size and text in list order
cp network network.bak #makes a copy/backup of config file
cat network #shows content of file in the shell without text editor

Paste the content of /etc/config/network back to the forum so we can adjust for LAN>WAN setting and make sure internet is working by restarting network interfaces or reboot router and than check if opkg update works.

Than we change the setting from Option1 back from WAN>LAN and go to Option 2 below.

Option2: Keep the LAN interface in OpenWrt but make it behave as a client. Therefor we will disable the DHCP server on the lan interface edit /etc/config/dhcp and edit/add the following settings to /etc/config/network a default gateway,dns server static ip address that matches the subnet of the windows internet connection sharing.

Paste the content of /etc/config/network back to the forum

:man_facepalming:
Just understand that you won't be able to post this request because you probably cannot copy the content of your lcd screen without a network connection or photo...

I will take the example /etc/config/network file from a Raspberry Pi 1 which also comes with only a single interface and adjust accordingly...

Example Rpi1 for "Option 1" internet by WAN interface

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd7c:9473:1f0f::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

Alter with nano the last block to resemble this:


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd7c:9473:1f0f::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

config interface 'wan' #notice change from lan > wan?
	option device 'br-lan'
	option proto 'dhcp' #notice change from static > dhcp?
#	option ipaddr '192.168.1.1'
#	option netmask '255.255.255.0'
#	option ip6assign '60'
#notice the comment'#' at the beginning of the above 3 lines

Reboot the netbook/OpenWrt router with reboot and check with ifconfig and or opkg update if internet is working? In otherwords did it request and receive and IP-address from the Windows internet connection sharing host?

!!!EDIT!!!
Example Rpi1 for "Option2" internet by LAN interface
Again you willl be editing /etc/config/network however not the firewall this time since that is not active on the LAN instead you must disable the DHCP-server in /etc/config/dhcp file. First disable DHCP-server on the LAN by adding option ignore 1 and restarting dnsmasq / odhcpd service see example below:

nano /etc/config/dhcp
...
config dhcp 'lan'
	option interface 'lan'
	option ignore '1' # <--- add this line
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	option ra_slaac '1'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
....

/etc/init.d/dnsmasq restart #dnsmasq takes care of ipv4 dhcp

/etc/init.d/odhcpd restart #takes part of the ipv6 dhcp

Than edit /etc/config/network to have a 'gateway' and 'dns' on LAN interface:

nano /etc/config/network #see snippet below
...
config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp' #if static ip, uncomment 2 lines below
#	option ipaddr '192.168.43.139'
#	option netmask '255.255.255.0'
#	option ip6assign '60'
	option gateway '192.168.43.1'
	option dns	'8.8.8.8'
...

/etc/init.d/network restart #or reboot the router to make changes active

1 Like

OK!
Bridged the connection in windows, checked that another device got the internet by the cable.
Plugged it in openwrt, changed etc/config/network like You showed me.
opkg update was succesful, traceroute google.com also succesful
Now as expected luci is not anymore reachable from pc.
Whats the next step? drivers?
P.S. Realised that up and down arrow keys are dead on netbook, connected external keyboard :rofl:

Good that internet is working! To keep the right jargon/terms, did the Windows connection sharing give you the option to NAT or to bridge since these things clearly mean something else. I can also understand that as a newcomer you just named the whole connected situation from nearby wifi>wifi-laptop-windows-ics-ethernet > ethernet-netbook-openwrt-shell a bridge. Which is fine for now.

First what is the ip adress of the netbook/OpenWrt router type in the shell of the router:
ifconfig -a

Than try to ping ipadressofrouter from the windows ics machine to the openwrt router. If it works I show step to open firewall for ssh than luci.

In windows I higlighted two interfaces, mouse right click, create bridge connection.
Cant say anything more about that, sorry
ifconfig -a
inet addr: 192.168.43.139 bcast: 192.168.43.255
windows cmd:
ping 192.168.43.139
interval reached
sent 4 packets, lost 4 packets, 100% loss
(my windows is not english, so i translated as i could)

p.s. What means:
ce: hpet increased min_delta_ns to 20115 nsec