OpenWrt Forum Archive

Topic: Booting Debian

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

Is it possible to (real)boot Debian using openwrt? Here is what I have done:

I have WL-500GX, 1GB usb memory stick. On PC I did

debootstrap --foreign --arch mipsel sarge /mnt/usb

(!I'm not copypasting this, there may be mistakes, but all the process went on without any significant errors - this code is just to give idea of process)

I mounted memory stick into WL then and

chroot /mnt/disc0_1 sh
/debootstrap/debootstrap --second-stage

As I said, everything went on without errors and after apt-setup and installing some utilities I believe I have basic (although not fully functional) Debian instalation which I can use after chroot.

Here comes the question. As it is described here:
http://wiki.openwrt.org/UsbStorageHowto … a50d94382a
one can easily boot from usb device. Is it possible to exec Debian init instead of OpenWRT one? Or better formulated, wil it bring the router to a working state? As I don't see inside, I don't know what can I expect and since nobody stated this question here although I think it's very straight, it may be total rubbish, but I had to ask.

I have my router mostly for testing purposes so I would like to run Debian to use all it's packages playing with http/xxxsql/ipv6 programs and settings and so on, which would be more complicated with only openwrt.

(Last edited by calavera on 28 Aug 2006, 12:02)

The concept of a preinit, or one init routine launching another init routine is pretty well illustrated by the usb storage howto. The only real difference is that it runs "exec /bin/busybox init" instead of running /sbin/init directly (which could lead to a loop if the pivot failed)

Thank you for your answer. I think I will give it a try. In fact I had the exact idea HOW to do it (like you wrote - exec debian intit instead of busybox), but I was not sure, IF I can do it. For example ssh. I suppose that when I use debian init, there will be no dropbear ssh (started by openwrt) so I need to have ssh server prepared and configured in the debian distro (which is not by default). That is one thing that could cause some troubles. I was asking about such things - what should I set up before I do pivot_root. In other words, what is done during openwrt init (and not in debian by default), that is necessary for basic function of a router. I hope i made myself clear, I'm not native English speaker, sorry.

Anyway since you didn't tell any objections, I consider it generaly a good idea to exec debian init. That's enough for me to start testing. I hope I will manage to have full debian server with openwrt kernel in the end. I think it's a good combination, isn't it (not regarding the speed:-)?

Debian and OpenWrt serve two entirely different purposes; I have no idea what your goals are.

It'll just switch the root device and start Debian, it would only start OpenWrt if the pivot failed -- assuming you wrote your init script properly. If you didn't write your init script properly you could always reflash OpenWrt or stick the USB stick into another machine and try to fix the mess. I have no intentions of providing detailed support.

http://www.cyrius.com/debian/bcm947xx/wgt634u/

Have a look at that (both the wgt634u and asus are the same processor). Its a waste of time and very slow though (I have done it but on a wgt634u)
That will give you a full debian install though (openwrt is not there at all)

Maybe netbsd would be interesting on one of those devices but debian is too slow to be of use.

I've read that, it was an inspiration for me. I chose the init way because I'm to scared to play with cfe. But since I'm not able to get my wl500gx visible on the lan (although booting seems to be ok), I'm working on a serial console now so I can open a console session without any net at all. It would take a long time to find errors without it.

I'm interested in your experience with the speed of Debian. What do you exactly mean by saying that it's slow? My router only routes my notebook and my friends pc to 512kb internet so it's more attractive for me to have full linux box (I'm working on win) ready all the time instead of insisting on high troughtput. But if you confirm that Debian is useless for usual work via ssh because of speed, I'm not interested in Debian at all. Thanks.

(Last edited by calavera on 30 Aug 2006, 21:54)

I succesfully compiled kernel and now able to boot full Debian system.
But i can't compile modules for it, only "included-in-kernel" features.
I have latest trunk from svn. i can compile "standart" firmware, all ok.

http://wpkg.org/Running_Debian_on_ASUS_WL-500G_deluxe
Followed these instructions ("Building your own kernel"), but no luck...

"5. Configure the kernel as you want - in trunk/build_mipsel/linux/"
I know,that the correct path is "trunk/build_dir/linux-brcm47xx/linux-2.6.25.17" for my kernel.
but
"9. Remove .image and .modules in build_mipsel/linux/
10. Go back to trunk/ directory and run make again (now it compiles also the modules we want)"
has no effect for modules, there is still "MODPOST 58 modules" during make process. no matter how much modules i selected in "make ARCH=mips menuconfig".
Please help me, how can i compile all needed modules?

P.S.: My box is ASUS WL-500GP

The discussion might have continued from here.