User Tools

Site Tools


inbox:doc:openwrt_x86

Openwrt on x86 compatible systems

disclaimer: A search on the wiki was done for generic installation and information of openwrt on x86 systems, but the results returned nothing specific. In the case please verify if this page should be merged

Requirements

- A x86 (intel ISA) compatible pc, most intel/amd/via based pc satisfy this condition
  - the system should have an internal HD (normal IDE/SATA HD, IDE CFcards, IDE SDcards)
  - the system should allow to connect and boot cd-roms or usb sticks or similar removible storage

Installation

There are several possibilities, slowly all will be mentioned.

Using usb sticks with no internet

- We need 2 usb sticks, one with a linux rescue image (debian, gparted, parted magic, etc...)
  and one with the openwrt image (see for example http://downloads.openwrt.org/backfire/10.03.1/x86_generic/ or
  http://downloads.openwrt.org/attitude_adjustment/12.09/x86/generic/ and similar .
  Actually if you know how to save additional data on the linux rescue usb stick you don't need 2 sticks.
- First we start the linux rescue system (could be that the BIOS boot options need to be modified)
  _WITHOUT_ connecting the other usb stick.
- Once the rescue syste is started, we connect the other usb stick and we write on the internal disk
  the openwrt image.
  If the internal disk is recognized as /dev/sda (and we don't want to save any data) this means:
  - clean the internal disk from partition ( fdisk /dev/sda and then delete all the partitions
    and after that write the new partition table )
  - mounting the second usb stick with the openwrt image (for example 'mount /dev/sdc1 /mnt/')
  - writing the image on the disk (for example: 
    'dd if=/mnt/openwrt-x86-generic-combined-squashfs.img of=/dev/sda' )
  - eventually resizing the owrt partition created transferring the image (not difficult to do
    if the image use an ext file system and not a squasfs [compressed]).

Using usb sticks with internet

- We need a usb sticks with a linux rescue image (debian, gparted, parted magic, etc...)
  and one with the openwrt image (see for example http://downloads.openwrt.org/backfire/10.03.1/x86_generic/ or
  http://downloads.openwrt.org/attitude_adjustment/12.09/x86/generic/ and similar .
  Actually if you know how to save additional data on the linux rescue usb stick you don't need 2 sticks.
- First we start the linux rescue system (could be that the BIOS boot options need to be modified)
- Once the rescue syste is started, we connect the other usb stick and we write on the internal disk
  the openwrt image.
  If the internal disk is recognized as /dev/sda (and we don't want to save any data) this means:
  - clean the internal disk from partition ( fdisk /dev/sda and then delete all the partitions
    and after that write the new partition table )
  - mounting the second usb stick with the openwrt image (for example 'mount /dev/sdc1 /mnt/')
  - Getting the image on the /tmp/ directory of the linux rescue system and writing it on
    the internal disk. (this is the annoying part because if there is no browser
    you need to type a long url, and two sticks avoid problems)
    For example 'cd /tmp/ ; wget http://downloads.openwrt.org/backfire/10.03.1/x86_generic/openwrt-x86-generic-rootfs-ext2.img.gz'
  - In the case work on the downloaded image (that yould require to be unzipped, for example)
  - writing the image on the disk (for example: 
    'dd if=/mnt/openwrt-x86-generic-combined-squashfs.img of=/dev/sda' )
  - eventually resizing the owrt partition created transferring the image (not difficult to do
    if the image use an ext file system and not a squasfs [compressed]).

Drivers

Could be possible that you need intel drivers (or not only) for NIC adapters, so be prepared to download (manually) a lot of kmod-* packages to be sure that your system will run. You can install then with opkg install <filename>.

Resizing partitions

Resizing ext partitions

- using a rescue linux system
- identify the partition to resize, assuming that after it there are free blocks.
- with fdisk delete the partition and create another one, of the same type 
  (normally primary and type 83 Linux), ***starting at the same sector/block number***
  and ending on the last free contiguous sector.
  Then write the partition table.
- use resize2fs on the partition created to let it use all the new space.
- use 'fsck -f' on the partition created to check that everything is ok.

inbox/doc/openwrt_x86.txt · Last modified: 2015/03/02 15:49 by pier4r