OpenWrt Forum Archive

Topic: Update on Linksys WRT1900AC support

The content of this topic has been archived between 16 Sep 2014 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

gsustek wrote:

@sera, in what buildroot did you integrate initramfs? latest LEDE, Openwrt or your 4.7 kernel buildroot?

For what do we need initramfs on our router? Please explain for what is initramfs useful?

It's part of the preparation for bumping to 4.7, but not specific to it at all. I'll publish another series once it's more ready for public consumption. It will be rebased on the openwrt github repository, this is the openwrt forum after all.

Now for the interesting question. What is an initramfs useful for?

For simpler setups you usually tell the kernel how to mount root by passing some arguments to the kernel. Openwrt rule is not to touch the bootloader, well, better for newbies and on some locked down platforms openwrt supports the bootloader probably hates you enough that you couldn't even if you wanted to.

For non trivial setups people use an initramfs to mount root. Your root might be encrypted or is on a raid that needs to be assembled first, even a separate /usr might require an initramfs this days. So the purpose is to mount root and resume the normal boot process thereafter.

To support booting our devices with the openwrt / lede rootfs there are 3 choices. Fix the kernel commandline in uboot, use an initramfs or do what I dislike add a dozen hacks to linux so it still boots with a bogus kernel commandline.

There are other benefits of a initramfs, but they aren't relevant for me integrating initramfs support.

how do i check which commit version was pulled when i do "git pull". Trying to find which revision it'll be using for the build. Thanks.

sera wrote:

@JW0914

There is still need to flesh out the Wireless section on the wiki and refer to it from the stable image section, see https://forum.openwrt.org/viewtopic.php?id=65740

Thanks! =]

I'm planning on spending a few hours on the Wiki on Sat to get everything suggested added to it.  Not sure if you've had a chance or not, but could you take a look at the Switch Layout to see if the background coloring I implemented was what you had in mind, and if not, a suggestion on how to further improve it.

(Last edited by JW0914 on 7 Jul 2016, 13:49)

@JW0914

Not what I had in mind but it doesn't confuse me anymore, so the switch section is fine I'd say.

@alirz
check dir scripts/

JW0914 wrote:

@alirz issue: 

git clone https://github.com/openwrt/openwrt.git

You're going to want to ensure you add the 990-nand_timeout.patch to <buildroot>/target/linux/mvebu/patches-4.4 (or patches-4.1 if you build with kernel 4.1).

You'll also want to ensure the marvell-cesa patch is added; however, the build threw an error that it doesn't apply, so I ended up manually modifying <buildroot>/package/kernel/linux/modules/crypto.mk replacing the crypto module crypto-mv-cesa with the following (very bottom of file):

$(eval $(call KernelPackage,crypto-xts))


$(eval $(call KernelPackage,crypto-mv-cesa))

define KernelPackage/crypto-marvell-cesa
  TITLE:=Marvell crypto engine
  DEPENDS:=+kmod-crypto-manager @TARGET_kirkwood||TARGET_orion||TARGET_mvebu
  KCONFIG:= \
    CONFIG_CRYPTO_DEV_MARVELL_CESA \
    CONFIG_CRYPTO_HW=y
  FILES:=$(LINUX_DIR)/drivers/crypto/marvell/marvell-cesa.ko
  AUTOLOAD:=$(call AutoLoad,09,marvell-cesa)
  $(call AddDepends/crypto)
endef

$(eval $(call KernelPackage,crypto-marvell-cesa))

Do i get the nand patch from here?
https://github.com/nitroshift/nand-time … eout.patch

im currently building for my MAMBA, against the latest commit, though I dont know whats the current trunk commit rev.
My menuconfig is from the old days of compiling against trunk (used to be 3.18 the last time i compiled an image)
Has that now gone up to kernel 4.1? if so, where do I get the appropriate version of the nand patch.  Thanks

does the new build enviroment not use the ".config" file to compile the image?
I had copied that file from my other build set that used SVN in the past.
i then did a "make defconfig". Do we still have to do "make menuconfig" ?

However the compiled seems to be very small in size (6.9 MB) and i think its likely to be missing all my custom packages as in the past my image would be about 14MB.
unfortunately im kind of lost with the new build process and not clear about a few things.

@alirz
Nothing new on that front, you could try bringing your build forward by this means.

anomeome wrote:

@alirz
Nothing new on that front, you could try bringing your build forward by this means.


Thanks I will look into that. Though i dont understand how the diffconfig script works.
Does it ask to read a previous ".config" file and then creates a new one based upon that? I dont want to be throwing these noob questions out there but i cant find any other place to get some info.

Worst case scenario, ill run make menuconfig on my old enviroment andthen note down all the custom packages i had (there are quite a few actually) and manually include those in the new setup.
Thanks again.

(Last edited by alirz on 7 Jul 2016, 15:52)

alirz wrote:
anomeome wrote:

@alirz
Nothing new on that front, you could try bringing your build forward by this means.


Thanks I will look into that. Though i dont understand how the diffconfig script works.
Does it ask to read a previous ".config" file and then creates a new one based upon that? I dont want to be throwing these noob questions out there but i cant find any other place to get some info.

Are you viewing your buildroot with show hidden files enabled?  If not, you should set show hidden files to default in the buildroot directory.  Double check you're in the new buildroot within the terminal, and if you are, then the .config file needs to be overwritten in the new buildroot with the .config from the old buildroot (it has to be named " .config ").  If you choose to load a config file from within menuconfig, the config you're loading must be in the buildroot. 

It's worth taking a look at the build howto wiki as well.


@all Someone a few months back chose to utilize dhcpd over odhcpd... whomever that was, could you post your configs, as the DNS & DHCP wiki says dhcpd should read from /etc/config/dhcp; however, I know dhcpd can utilize the dhcp.conf in the /etc/ root... is there any other OpenWrt documentation on dhcpd or can I use general documentation for linux distros in general?

(Last edited by JW0914 on 7 Jul 2016, 17:45)

JW0914 wrote:
alirz wrote:
anomeome wrote:

@alirz
Nothing new on that front, you could try bringing your build forward by this means.


Thanks I will look into that. Though i dont understand how the diffconfig script works.
Does it ask to read a previous ".config" file and then creates a new one based upon that? I dont want to be throwing these noob questions out there but i cant find any other place to get some info.

Are you viewing your buildroot with show hidden files enabled?  If not, you should set show hidden files to default in the buildroot directory.  Double check you're in the new buildroot within the terminal, and if you are, then the .config file needs to be overwritten in the new buildroot with the .config from the old buildroot (it has to be named " .config ").  If you choose to load a config file from within menuconfig, the config you're loading must be in the buildroot. 

It's worth taking a look at the build howto wiki as well.


Yes i am in the build directory and i can see my .config file. Just seemed that my make process didnt read it or something..Perhaps i made an error somewhere but no biggie i will figure this out.
Thanks for your help.

JW0914 wrote:

@all Someone a few months back chose to utilize dhcpd over odhcpd... whomever that was, could you post your configs, as the DNS & DHCP wiki says dhcpd should read from /etc/config/dhcp; however, I know dhcpd can utilize the dhcp.conf in the /etc/ root... is there any other OpenWrt documentation on dhcpd or can I use general documentation for linux distros in general?

Not sure this is what you're after but you might take a look at isc-dhcp-server-ipv4. 

root@routi:~# opkg info isc-dhcp-server-ipv4
Package: isc-dhcp-server-ipv4
Version: 4.3.3-1
Depends: libc
Status: unknown ok not-installed
Section: net
Architecture: arm_cortex-a9_vfpv3
Maintainer: Antony Antony <antony@phenome.org>
MD5Sum: 8c9145cfb53d44ff910354b3d0cc6dee
Size: 658908
Filename: isc-dhcp-server-ipv4_4.3.3-1_arm_cortex-a9_vfpv3.ipk
Source: feeds/packages/net/isc-dhcp
Description: implements the Dynamic Host Configuration Protocol (DHCP) and the Internet
 Bootstrap Protocol (BOOTP).
 This package is compiled with IPv4 support only.

NOTE: it only provides a DHCP service and not DNS.

I personally have not used it on my WRT routers but running the standard port of ISC dhcp on native Linux for years and works great.

kirkgbr wrote:
JW0914 wrote:

@all Someone a few months back chose to utilize dhcpd over odhcpd... whomever that was, could you post your configs, as the DNS & DHCP wiki says dhcpd should read from /etc/config/dhcp; however, I know dhcpd can utilize the dhcp.conf in the /etc/ root... is there any other OpenWrt documentation on dhcpd or can I use general documentation for linux distros in general?

Not sure this is what you're after but you might take a look at isc-dhcp-server-ipv4. 

root@routi:~# opkg info isc-dhcp-server-ipv4
Package: isc-dhcp-server-ipv4
Version: 4.3.3-1
Depends: libc
MD5Sum: 8c9145cfb53d44ff910354b3d0cc6dee
Size: 658908
Filename: isc-dhcp-server-ipv4_4.3.3-1_arm_cortex-a9_vfpv3.ipk
Source: feeds/packages/net/isc-dhcp

No dhcpd is it's own package... dhcpd_6.4.3-1_mvebu.ipk (same as in Trunk's or Chaos Calmer's)

[root@WRT1900] ~ # opkg info dhcpcd - 6.4.3-1
Package: dhcpcd
Version: 6.4.3-1
Depends: libc
Status: install user installed
Section: net
Architecture: mvebu
Maintainer: Roy Marples <roy@marples.name>
MD5Sum: 1d4196eed92a71b0ba08ebc31c425d9d
Size: 100726
Filename: dhcpcd_6.4.3-1_mvebu.ipk
Source: feeds/packages/net/dhcpcd
Description: DHCPv4, IPv6RS and DHCPv6 client with IPv4LL support
 dhcpcd is a one stop network management daemon which includes
 * RFC compliant DHCPv4 and DHCPv6 clients
 * DHCPv6 Prefix Delegation support
 * IPv4LL (aka ZeroConf) support
 * ARP address conflict resolution
 * Link carrier detection
 * Wireless SSID profiles
 * ARP ping profiles
Installed-Time: 1467813559

Another member had issues as well with odhcpd a few months back and chose to go with dhcpd instead.  I remember them mentioning there were some additional configurations that needed to be done via cli, however I can't recall what those were. 

  • I had no issue with odhcpd until around 2 - 3 months ago, when one day after a flash (and on every subsequent flash on kernels 4.4.6 - .14) it starting listing all statically assigned IP's under the Active DHCP list (even though they weren't active) and listing all as having a /32 netmask (netmask was /26 and it was served correctly to any device, static or non).  Only the Active DHCP list itself, specifically the temp files odhcpd writes to that are then read by LuCI, is the issue.

  • I narrowed the problem down to odhcpd, and have run out of troubleshooting ideas to figure out what the issue is, so I figured I'd simply switch to dhcpd.

I haven't been able to located any OpenWrt documentation about dhcpd, however it is possible I accidentally overlooked it in my searches on the Wiki site.

(Last edited by JW0914 on 8 Jul 2016, 02:32)

alirz wrote:

Yes i am in the build directory and i can see my .config file. Just seemed that my make process didnt read it or something..Perhaps i made an error somewhere but no biggie i will figure this out.
Thanks for your help.

Menuconfig would've had to have read from it, otherwise you would have had a menuconfig with a target system of AR7xxx/AR9xxx and a subtarget of Generic

(Last edited by JW0914 on 8 Jul 2016, 02:40)

@JW0914

You probably mean use dnsmasq-full for all dhcp and dns stuff and drop odhcpd. man dnsmasq for documentation.

Will do  Thanks! =]

Build is failing today. Seems to be a missing library

checking whether gcc -std=c99 option works... yes
checking if compiler supports -Wextra... yes
checking for refresh in -lncurses... no
checking for refresh in -lncurses6... no
checking for refresh in -lncurses... (cached) no
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
configure: error: missing libraries:  libncurses
make[3]: *** [/media/ali/2a31be03-830e-4b99-ac3f-10a60ac8d2d0/openwrt/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl-1.1.14_eabi/htop-2.0.1/.configured_yyyyyyyy] Error 1
make[3]: Leaving directory `/media/ali/2a31be03-830e-4b99-ac3f-10a60ac8d2d0/openwrt/openwrt/feeds/packages/admin/htop'
make[2]: *** [package/feeds/packages/htop/compile] Error 2
make[2]: Leaving directory `/media/ali/2a31be03-830e-4b99-ac3f-10a60ac8d2d0/openwrt/openwrt'
make[1]: *** [/media/ali/2a31be03-830e-4b99-ac3f-10a60ac8d2d0/openwrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl-1.1.14_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory `/media/ali/2a31be03-830e-4b99-ac3f-10a60ac8d2d0/openwrt/openwrt'
make: *** [world] Error 2

@alirz

Sudo apt-get install libncurses5-dev

So a few things weren't adding up about my odhcpd issue...

It appears the issue stems from this part of:

/etc/config/dhcp

config odhcpd 'odhcpd'
    option  maindhcp                '1'
    option  leasefile               '/tmp/hosts/odhcpd'
    option  leasetrigger            '/usr/sbin/odhcpd-update'

If that section is commented out, DHCP IPs are served and listed correctly, Static Leases are listed correctly, and the following issues cease to exist :

  • All assigned static leases are no longer listed under Active DHCP Leases

  • Active DHCP Leases no longer lists IPs with a /32 netmask


I'm not sure when the odhcpd section was incorporated into the dhcp config, (DNS & DHCP Config Wiki shows the lease file under DNSMasq's section), but I believe it's a default section

<buildroot>/build_dir/target-xxx/odhcpd-2015-11-19/src/config.c

<Beginning Line #129>

static const struct blobmsg_policy odhcpd_attrs[LEASE_ATTR_MAX] = {
    [ODHCPD_ATTR_MAINDHCP] = { .name = "maindhcp", .type = BLOBMSG_TYPE_BOOL },
    [ODHCPD_ATTR_LEASEFILE] = { .name = "leasefile", .type = BLOBMSG_TYPE_STRING },
    [ODHCPD_ATTR_LEASETRIGGER] = { .name = "leasetrigger", .type = BLOBMSG_TYPE_STRING },

I don't believe I had this issue with Kernel 3.18.x or 4.1.x, with it only appearing on kernel 4.4.x

(Last edited by JW0914 on 8 Jul 2016, 16:43)

@JW0914

Commenting out that section is supposed to disable odhcpd ...

Well, you just need to replace the bits you lost with dnsmasq now, if you need them in the first place.

sera wrote:

@JW0914

Commenting out that section is supposed to disable odhcpd ...

Well, you just need to replace the bits you lost with dnsmasq now, if you need them in the first place.

I didn't know if odhcpd utilized other options within scripts to run or not. 

Is this an issue I should create a bug report for (as I've only experienced this on kernel 4.4.x)?

JW0914 wrote:

Is this an issue I should create a bug report for (as I've only experienced this on kernel 4.4.x)?

You may, though I rather see it dropped unless someone can make a point for it and properly document it. As I said a a while back I can't see a reason why I'd want it, even if it worked.

Both openwrt and lede are at 4.4. now, thou I was on 4.1 back then.

sera wrote:
JW0914 wrote:

Is this an issue I should create a bug report for (as I've only experienced this on kernel 4.4.x)?

You may, though I rather see it dropped unless someone can make a point for it and properly document it. As I said a a while back I can't see a reason why I'd want it, even if it worked.

Both openwrt and lede are at 4.4. now, though I was on 4.1 back then.

That's right, I forgot you had said that before.

I'm assuming it'll be a while yet before DD is finalized or RCs begin, however is there a way to notate that, in it's current form, odhcpd causes issues with kernel 4.4.x? My only concern is odhcpd is selected by default in menuconfig (therefore is included in all precompiled Trunk images since 4.4.x is now default), however I need to build a bare bones image with no custom config files to verify if this occurs by default with kernel 4.4.x, and if not, begin testing if something else the image is built with is causing the issue.

  • While it is possible one of my custom configs I include in the build could be the issue, I can use the same custom files on a 4.1.x or 3.18.x kernel build with no issues, which would seem to indicate either the custom files aren't the issue, or there's something in one or more that causes wonkiness with odhcpd with kernel 4.4.x

(Last edited by JW0914 on 8 Jul 2016, 19:07)

northbound wrote:

@alirz

Sudo apt-get install libncurses5-dev

hmm I dont get why a package would have to be installed on my build machine for it to be able to compile that package as needed for the router firware..Thanks

anyways looks like i already have it installed:

ali@ali-virtual-machine:/openwrt/openwrt$ sudo apt-get install libncurses5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libncurses5-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 509 not upgraded.
ali@ali-virtual-machine:/openwrt/openwrt$

Sorry, posts 12376 to 12375 are missing from our archive.