Busybox upgrade issue

Hi I'm trying to update busybox to v1.26.0.
I just build an firmware r2672-9998bc5 but I get the following error when logging in on the router using ssh:
-ash: fgrep: not found

Also if I try to execute a command it's not working.

Anyone got any idea what went wrong or any idea to put me in the right direction?

Thank in advance.

Sounds like it has been compiled with different musl version. The
error message sounds like that.

You should compile everything at the same time after make clean Actually make clean is not enough if musl patches have changed. Do make dirclean or manually D delete toolchain from builddir

Thank you Hnyman I will give it another try.

@hnyman I just tried another time with a clean build environment and in the make menuconfig I selected the Advanced configuration options (for developers) -> Toolchain Options -> C Library implementation and checked if "musl" was selected and not glibc, that is not selected.

Any idea what else I can try?

Thanks in advance.

To compile the build for busybox 1.26.0 I had to change some patches but I saw in the release notes a lot of changes with ash, maybe changing the patches or the changes in 1.26.0 is causing the error.

Don't forget to add (if missing) the following in rules.mk

TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))
TARGET_INIT_PATH:=$(if $(TARGET_INIT_PATH),$(TARGET_INIT_PATH),/usr/sbin:/sbin:/usr/bin:/bin)

@dman776 Thank you for your reply I will test it in the weekend.

It took me some time to test, @dman776 I checked your suggestion it's already in place but thank you for that.

In the mean time there is a new version of Busybox 1.26.1 (stable) it took me some time to get through the configuration and make the necessary changes to build the package but I still get the same Ash messages after applying the firmware.

It seems that something changed from version 1.25 to 1.26.1

I will upload the changes to the github fork of LEDE that I have and maybe someone can point me in the right direction so we can update LEDE to Busybox 1.26.1 since it has a lot of fixes.

No need to reinvent the wheel:
You might check the discussion on the developer mailing list:
http://lists.infradead.org/pipermail/lede-dev/2017-January/date.html

And check the patches for 1.26.1 bump there:
http://lists.infradead.org/pipermail/lede-dev/2017-January/005120.html
http://lists.infradead.org/pipermail/lede-dev/2017-January/005121.html
http://lists.infradead.org/pipermail/lede-dev/2017-January/005122.html

They can probably be easiest downloaded from Patchwork:
http://patchwork.ozlabs.org/project/lede/list/

As you can see from the discussion, both the author of the patches and at least one more person has compiled and ran successfully 1.26.1, so it should work.

@hnyman thank you I will to look into that.

Did you do a "make distclean" first?

After each try to build I rebuild my build environment because I'm just using the source, and copy my files over the build enviroment. What does "make distclean" does?

[quote="bladeoner, post:12, topic:680"]
What does "make distclean" does?
[/quote]It clears everything. Including your .config file.

https://lede-project.org/docs/guide-developer/use-buildsystem

In short:

  • clean = delete the firmware build
  • dirclean = clean + delete also tools, toolchain & tmp
  • distclean = dirclean + delete also .config

When you are trying to do a major update for busybox (1.25-1.26), you really need to delete .config

1 Like

Thank you for clarifying the commands.

Regarding the developer mailerlist, with the Patchwork link is possible to download the patches, there are three.
But it seems like a patch that is patching files for before the actual build.
Is there a way to apply these patches before the actual build or a wiki I can follow?

????

Those are normal patches for modifying the source in LEDE repo. (some of those patches modify existing patches, which makes it look a bit strange)

  • You start with unmodified busybox package core in LEDE source.
  • You download all 3 patches to your buildroot root.
  • Then you apply them in order with "patch -p 1 -i PATCHNAME"

Nothing more complicated.

Thank you hnyman, that did the trick.
I didn't work with patching the source yet and as you said it seems a little strange patching the patches.

It worked, I finally could build it with the updated version of Busybox (version 1.26.1).

I have compiled 1.26.2 and installed successfully on a mamba device (WRT1900AC). I'm running into a memory issue on a Shelby device (WRT1900ACS) however.

The issue is with /etc/init.d/dnsmasq during its startup. The startup proceeds fine until the "list interface" section is processed, then the script fails and reports out of memory. The line that actually generates the error is

__tmp="$(jsonfilter   .....

in function __network_ifstatus() in /lib/functions/network.sh

There is no way the Shelby device should run out of memory (512M), I must have messed something up in the busybox config. I'm guessing the reason the Mamba device doesn't fail is that its network configuration is significantly simpler.

Any thoughts are welcome.

@InkblotAdmirer, what I want to suggest is start with a new build environment and use the following patches:

http://patchwork.ozlabs.org/patch/715400/
http://patchwork.ozlabs.org/patch/715401/

And then see if the issue still occurs.

So I had been quite careful in preparing the conversion, but there's always opportunity for error so I did spend the time to do as the prior post suggested and build the config from scratch, with the same results. Interestingly, the mamba devices boot fine but if I execute a manual /etc/init.d/dnsmasq restart I get the same out of memory error. Here's the section of code that generates the error:

filter_json(int opt, struct json_object *jsobj, char *expr, const char *sep,
            int limit)
{
	struct jp_state *state;
	const char *prefix = NULL;
	struct list_head matches;
	struct match_item *item, *tmp;
	struct json_object *res = NULL;

	state = jp_parse(expr);

	if (!state)
	{
		fprintf(stderr, "Out of memory\n");
		goto out;
	}

This is main.c in the jsonpath.git project. I'm not going to even attempt debugging what's going on in that call, it looks like auto-generated parsing code with which I have zero experience.

Anyway, it's possible there's something else in my build config that's affecting this but I'm going to leave it here for now.