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!