# Buid OpenWRT in Gentoo way?

## fpemud

I'm going to build a x86 home router.

Is it doable that I build and install OpenWRT in Gentoo's way? For example to write ebuild for each OpenWRT component. 

I don't like building OpenWRT image on another machine and flash it into the target machine.

----------

## Roman_Gruber

I'm not sure if I understood your question completly.

Yes you may build software on your gentoo box.

Yes you may create ebuilds to automate those software building process.

----------

## szatox

And yes, you can build the image using your router, but it's gonna take ages, so you better stop here, take a step back, and go towards "cross compilation" instead

----------

## Ant P.

If it's x86 there's not much to be gained from OpenWRT, its main advantage is installing on ARM systems with 4MB of storage and difficult hardware.

You might even find it easier to build Gentoo the OpenWRT way (build on a host to separate root, package it all up on squashfs/jffs, transfer that fs image to the target).

----------

## fpemud

To be clear, I'd like to build OpenWRT on the router.

Generally, you should build OpenWRT on another machine and flash the image into the router.

I don't like this process.

I'd like to install Gentoo on the router first, then build and install OpenWRT component on the router just like installing gnome.

My home router does more than routing, so it would be power enough.

OpenWRT is sophisticate, I don't think I'm good at messing with the configuration of dnsmasq etc.

----------

