What's new

Linksys WRT1900AC, WRT1900ACS, WRT1200AC and WRT3200ACM Router Debian Implementation

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I'm glad you are enjoying Debian on your Linksys WRT router.

The McDebian 4.4.16 firmware and wireless drivers for are quite stable and wireless should be active upon boot by default.

I turned off the wireless radios. I just want to get the system stable first. I just did an apt-get update/upgrade. It didn't work as I thought. You must have some of the kernel in the firmware, not just the bootloader. It couldn't install the new kernel initrd image. I thought that would have been on the USB. Oops.
 
I turned off the wireless radios. I just want to get the system stable first. I just did an apt-get update/upgrade. It didn't work as I thought. You must have some of the kernel in the firmware, not just the bootloader. It couldn't install the new kernel initrd image. I thought that would have been on the USB. Oops.
Yes the firmware includes Kernel 4.4.16 and the rootfs on the USB the modules for 4.4.16. After the upgrade was the system still operational?
 
Yes the firmware includes Kernel 4.4.16 and the rootfs on the USB the modules for 4.4.16. After the upgrade was the system still operational?

Yes it seems to be fine, but it is still running 4.4.16. The errors were creating the initrd and creating the modules directory. I'm sorry I didn't keep them. I'll do a --fix-missing tonight and post the output.
 
Yes. My bad. it is only using 3.18. So your's in a roll your own kernel. I lost power overnight and the device was restarted. It is all ok, came back up without error.

Need to brush up on UUID and fstab, as my plug in drives and swap space didn't assign correctly...
 
I thought that the most current Debian distro uses an older kernel than 4.4.16

Erm - no, not the latest/greatest - there's a couple of side branches in ARM space with Debian and downstream folks...

it's an area of much interest at the moment...

10M RPi's might have something to do with that ;)

Challenge for many WiFi chipsets is that IOCTL's keep moving around... and with Linksys, the MRVL drivers are basically two sides - open is one, and closed is another - and the closed driver is much better, but the ugly kernel issues pop up...
 
Last edited:
Yes. My bad. it is only using 3.18. So your's in a roll your own kernel. I lost power overnight and the device was restarted. It is all ok, came back up without error.

Need to brush up on UUID and fstab, as my plug in drives and swap space didn't assign correctly...
I'm curious what you come up with for your fstab.
 
I've yet to buy a WRT1200AC but it seems to be pot luck what version you end up with.

Does your Debian replace the firmware or run along side it?
 
I've yet to buy a WRT1200AC but it seems to be pot luck what version you end up with.

Does your Debian replace the firmware or run along side it?
It replaces it.

I recommend purchasing a low cost USB to TTL cable so you can have complete control over the router's firmware.
 
Hi! I've tried McDebian on my WRT3200ACM and it works like a charm. It's really useful on such a powerfull device. I even got it to run a full Nextcloud server.

What I found I'm missing is traffic shaping (SQM). I've been successful in compiling and installing the sch_cake.ko module, but I've noticed that the sch_ingress.ko module is also missing. I tried to compile it on linux 4.9.12 kernel, but after installing, it won't work. Doing modprobe sch_ingress will say ERROR: Unknown symbol in module.

So I decided to do a kernel upgrade and compile all modules I needed. I am now wondering if the procedure is OK before going ahead and maybe bricking my router. What I did is as follows:

1. Getting linux kernel sources from kernel.org. At the time of writing, the most recent stable release is linux-4.11.0.

2. Getting other sources I needed.
Code:
git clone https://github.com/kaloz/mwlwifi.git
git clone https://github.com/dtaht/sch_cake.git
git clone https://github.com/Chadster766/McDebian.git

3. Moving all necessary files into place and modify as needed.
MWLWIFI
Code:
# mwlwifi
cp -Rf /usr/src/mwlwifi /usr/src/linux-4.11/drivers
cp -Rf /usr/src/mwlwifi/bin/firmware /usr/src/linux-4.11/firmware/mwlwifi
mv -f /usr/src/linux-4.11/drivers/mwlwifi/Makefile.kernel /usr/src/linux-4.11/drivers/mwlwifi/Makefile

# Modify Kconfig and Makefile for mwlwifi
sed -i 's/^endmenu$/source "drivers\/mwlwifi\/Kconfig"\n\nendmenu/' /usr/src/linux-4.11/drivers/Kconfig
echo 'obj-$(CONFIG_MWLWIFI)           += mwlwifi/' >> /usr/src/linux-4.11/drivers/Makefile
sed -i '/fw-shipped-$(CONFIG_YAM) += yam\/1200.bin yam\/9600.bin/a fw-shipped-$(CONFIG_MWLWIFI) += mwlwifi\/88W8864.bin mwlwifi\/88W8897.bin mwlwifi\/88W8964.bin' /usr/src/linux-4.11/firmware/Makefile
SCH_CAKE
Code:
# sch_cake
cp -f /usr/src/sch_cake/*.c /usr/src/sch_cake/*.h /usr/src/linux-4.11/net/sched

# Modify Kconfig and Makefile for sch_cake
sed -i '/^obj-$(CONFIG_NET_SCH_PIE).*/a obj-$(CONFIG_NET_SCH_CAKE)         += sch_cake.o' /usr/src/linux-4.11/net/sched/Makefile
sed -i 's/^comment "Classification"$/config NET_SCH_CAKE\n\ttristate "Cake (Common Applications Kept Enhanced)"\n\t---help---\n\t  Cake is the rollup of 3 years of deployment experience of the htb + fq_codel.\n\ncomment "Classification"/' /usr/src/linux-4.11/net/sched/Kconfig

4. Copying armada-385-linksys-rango.dts and .config from latest McDebian and making changes.
Code:
# Copy files
cp -f /usr/src/McDebian/linux-4.9.12/arch/arm/boot/dts/* /usr/src/linux-4.11/arch/arm/boot/dts
cp -f /usr/src/McDebian/linux-4.9.12/.config /usr/src/linux-4.11/.config

# Add armada-385-linksys-rango.dtb to Makefile
sed -i '/armada-385-linksys-cobra.dtb/a armada-385-linksys-rango.dtb \\' /usr/src/linux-4.11/arch/arm/boot/dts/Makefile

# Enable sch_ingress and sch_cake modules
scripts/config --module NET_SCH_INGRESS
scripts/config --module NET_SCH_CAKE

4. Downloading McDebian rootfs and extracting it to /srv/chroot/mcdebian.

5. Making modules, zImage and DTB and install modules to rootfs.
Code:
# Run menuconfig to solve conflicts between 4.9.12 and 4.11.0
make ARCH=arm CROSS_COMPILE=arm-none-eabi- menuconfig

make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j4 modules
make ARCH=arm CROSS_COMPILE=arm-none-eabi- INSTALL_MOD_PATH=/srv/chroot/mcdebian modules_install
make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j4 zImage
make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j4 dtbs

# Merge DTB into zImage
cat /usr/src/linux-4.11/arch/arm/boot/dts/armada-385-linksys-rango.dtb >> /usr/src/linux-4.11/arch/arm/boot/zImage

6. Making images.
Code:
# uImage
mkimage -A arm -O linux -T kernel -C none -a 0x200000 -e 0x200000 -n "linux-4.11.0" -d arch/arm/boot/zImage  uImage

# uInitrd
# NOTE THAT I AM USING THE MCDEBIAN'S ROOTFS initrd.img-4.2.4 IMAGE
cp /srv/chroot/mcdebian/boot/initrd.img-4.2.4 /usr/src/linux-4.11/initrd.gz
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x4200000 -e 0x4200000 -n "initrd image" -d initrd.gz  uInitrd

Up until here, I've had no errors, except for a warning when compiling armada-385-linksys-rango.dtb. Now, I'm not really sure on how to proceed with the flashing. I do have a USB to serial adapter, but I'm having some trouble with it.

I was wondering if there's a way to create an image so as to flash directly from factory GUI, LEDE or DD-WRT. Any help would be appreciated.

Thanks for your hard work on McDebian!
 
I'm sorry I haven't responded sooner. I've been very busy.

I'm not sure about your point #6 "Making images" because I've always used the McDebian rootfs since I couldn't figure out how to get the
initrd.gz to work. It's awesome you are working on that because it has some advantages.

I recommend you make sure you have serial console access to the WRT3200ACM so you can experiment as much as you like without having to worry about bricking your WRT3200ACM.
 
Finally got my serial adapter to work. Apparently there's a weird issue with some Silicon Labs serial adapters and the WRT3200ACM. When I try to connect to the serial port, the router won't boot, but I read about this workaround: disconnecting the TX cable and plugging it in right after starting the router and then it works.
I'll prepare the kernel upgrade and probably make next weekend's project to flash the WRT3200ACM and get SQM to work.
Thanks again!
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top