OpenWrt Forum Archive

Topic: Debian-chroot on trunk(r29773)@wzr-hp-ag300h

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want to run Debian on my Buffalo WZR-HP-AG300H. What follows is what worked for me and some background. Your milage may vary.

Simply chrooting into debian will not work, and we have to recompile openwrt.

On a powerful computer:

svn co svn://svn.openwrt.org/openwrt/trunk/
cd trunk/
./scripts/feeds update -a
make menuconfig # Target system=Atheros AR71xxx, Target profile=WZR-HP-AG300H, Advanced configuration options-->Target options-->Deselect 'Use software floating point'
make defconfig
make kernel_menuconfig # activate 'Enable FPU emulation'
make # firmware images will be put in bin/ar71xx/

The final make will take some time (½ day on my atom netbook), but the build can be parallelized if you have enough cores. I used a small cluster at my university (32 Xeon cores, 64GB RAM) and did everything in /dev/shm (=half of RAM). Keeping everything in shared memory ram, does speed up the build up quite a lot smile So instead of half a day, it now takes just me 15 minutes.

Note that simply just enabling in-kernel FPU emulation should do the trick, however for some unexplicable reason, PCI wifi devices could not be found if I did not disable msoft-float.
Disabling this is safe enough, but FPU operations becomes even slower (has to trap into kernel mode, instead of just calling a library function in user-space). Also in-kernel FPU emulation is not compiled in per default in openwrt, as msoft-float (for obvious reasons) is used. Debian packages are however not compiled with msoft-float (and you don't want to recompile all the debian packages!), so slower FPU emulation must be used.

Then simply scp openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin to /tmp on your router, and update the router:

sysupgrade -v openwrt-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin

Now, with the FPU-stuff taken care of, chrooting will no longer hang and we can actually install debian with debootstrap. I may post how to do this later.

#On PC as root:
debootstrap --foreign --arch=mips --variant=minbase squeeze /mnt/usb/deb6
Now unmount usb drive and plug into router and mount it the same place.

# Once only:
mount proc /mnt/usb/deb6/proc/ -t proc
chroot /mnt/usb/deb6 /debootstrap/debootstrap --second-stage

# Once every boot-up of openwrt:
mount proc /mnt/usb/deb6/proc/ -t proc

# Simply login to debian
chroot /mnt/usb/deb6 bash

apt-get install command-not-found nano nmap htop screen socat less vnc4server twm



Hahah, I am running iceweasel (aka firefox) on it now. How perverse is that wink

The discussion might have continued from here.