Page 1 of 1

Build openWRT firmware for P-2812HNU-Fx

Posted: 02 Feb 2015, 18:43
by admin
For device: P-2812HNU-F1
Building OS: Linux Debian Jessie 8.0
Version: r44236 -DG07-

Image

I used mainly this openWRT wiki page:
http://wiki.openwrt.org/doc/howto/buildroot.exigence

Make sure your linux version has the following installed (default openWRT):

git-core
libssl-dev
build-essential
subversion
--
I use apt-show-versions |grep {package} to check the packages.

And below here, most stuff if from oxo @ forum page:
https://forum.openwrt.org/viewtopic.php?id=53511

Perform next commands:

Code: Select all

sudo apt-get update
To make sure all needed packages for Lantiq chipsets etc, are working afterwards,
do also install the following packages:

Code: Select all

sudo apt-get install libncurses5-dev 
					      zlib1g-dev 
					      gawk 
					      gcc-multilib 
					      flex 
					      gettext
					      quilt  
					      lzop
# thanks aam 4 the last 2 packages

Code: Select all

git clone git://git.openwrt.org/openwrt.git

Code: Select all

cd openwrt
Make sure you're on the right execution path: pwd.
Download and install all available "feeds"

Code: Select all

./scripts/feeds update -a
./scripts/feeds install -a
-DG- You must select a target before "make defconfig" or default broadcom is selected:
https://forum.openwrt.org/viewtopic.php ... 70#p140470
Only use this the FIRST time your build a firmware package.
Updates can be made with the same package and take only 10 minutes to build new one,
NOT if you re-run the 'echo CONFIG_TARGET_lantiq=y > .config' command!

Code: Select all

echo CONFIG_TARGET_lantiq=y > .config
make defconfig

Code: Select all

make prereq

Code: Select all

make menuconfig
Within Menuconfig you make your selections:
- Target System:Lantiq
- Subtarget:XRX200
- Target Profile:ZyXEL P-2812HNU-F1
- Bootloaders:both

LUCI should be set default, check and select if not.
Some other packages, like USB drive support are default DISABLED.
I will add a reply with USB vfat example.
Personally i added Privoxy and its luci-app-privoxy and is working fine when you build them together, otherwise it's not working.
-EDIT- Within the Luci webinterface, just installing luci-app-privoxy will result in good working setup of Privoxy itself too!

Just before make, make sure SED is unset:
SED should not be set. If it is, run `unset SED` before compiling. (See Ticket 10612.)

Code: Select all

unset SED

Code: Select all

make
This will build your first firmware package, and can take some time.
--
When receiving an error during this run, 'make V=s' should be run to determine what causes this error.
This is also written on screen, if there is an error.

Within 'openwrt/bin/lantiq/' you will find needed firmare files to flash earlier openwrt versions.
Or debrick a ZyXEL firmware running box to run openWRT.

Reading https://forum.openwrt.org/viewtopic.php?id=53511 and you can also update your current openWRT build-environment.
Packages that seems to be installable by the WEB gui, return a kernel error, means in most cases that you have to rebuild your firmware package and INCLUDE the missing package in the build-process.

-----

Re: Build openWRT firmware for P-2812HNU-Fx

Posted: 02 Feb 2015, 22:38
by admin
USB memory stick support (vfat).

Playing around with newly own build firmware discovered that a 8GB USB pendrive, thats all the time attached, was still not seen by openWRT.

Found 1st missing:
- block-mount
- kmod-fs-vfat

block-mount could be installed with the WEB gui, but kmod-fs-vfat returns a kernel error.
Below an example of the error trying to install kmod-fs-ntfs:

Image

It seems that those packages returning a kernel error mostly need to be installed during a (re-)build openWRT process with these packages. As in my example, after this rebuild (and some reading about USB devices) i needed more packages:

- kmod-nls-base
- kmod-nls-cp437
- kmod-nls-iso8859-1
- kmod-nls-utf8

Within:

Code: Select all

make menuconfig
Select the missing packages, and use:

Code: Select all

make
And voila, it's even visible within Luci:

Image

And serial:

Code: Select all

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                  114240      5096    109144   4% /
ubi0:rootfs             114240      5096    109144   4% /
tmpfs                    62708      1096     61612   2% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1              7816236    976572   6839664  12% /tmp/usb

# mount
rootfs on / type rootfs (rw)
ubi0:rootfs on / type ubifs (rw,noatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda1 on /tmp/usb type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)