Problems installing Entware on Cisco e4200 [Solved]

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
ion456
DD-WRT Novice


Joined: 14 Aug 2020
Posts: 4

PostPosted: Fri Aug 14, 2020 3:43    Post subject: Problems installing Entware on Cisco e4200 [Solved] Reply with quote
For years I was running a really old (~2012) version of DD-WRT on my Cisco e4200 router. All was going well, but I recently upgraded it to a newer version (v3.0-r44112 mega 08/09/20) for up-to-date security patches. I followed the upgrade instructions here https://wiki.dd-wrt.com/wiki/index.php?title=Linksys_E4200 and it all worked fine.

When I tried to run tcpdump though, I discovered it's no longer included in the build due to space constraints (seems the build is capped to below 8MB for some reason, even though it's a router specific build and this model has 16MB).

I then tried to install Entware to get it back, but have ran into problem after problem.

I tried to follow the instructions here:

https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware

but couldn't get the USB drive to mount. After a lot of trial and error and forum searching, I eventually got it to work, but only with either FAT or NTFS filesystems. It seems ext2/3/4 support is also gone from the latest e4200 builds.

When I try to install Entware on either filesystem though, I run into problems. With the FAT32 drive, I get lots of errors saying the sym links couldn't be created (which makes sense, as FAT doesn't support them):

Quote:
...
Configuring entware-opt.
Collected errors:
* extract_archive: Cannot create symlink from ./opt/lib/ld.so.1 to 'ld-2.27.so': Operation not permitted.
* extract_archive: Cannot create symlink from ./opt/lib/libanl.so.1 to 'libanl-2.27.so': Operation not permitted.
* extract_archive: Cannot create symlink from ./opt/lib/libc.so.6 to 'libc-2.27.so': Operation not permitted.
...


Using NTFS, I don't even get that far, it crashes my router while trying to create the locale archive:

Quote:
...
Configuring libpcre.
Configuring grep.
Configuring locales.
Entware uses separate locale-archive file independent from main system
Creating locale archive /opt/usr/lib/locale/locale-archive
Adding en_EN.UTF-8


It hangs at this point, then my router reboots. It's strange, I don't know why it doesn't also crash at the same point using FAT. I did get a few warnings/errors when creating the locale archive on FAT, but it seems to recover:

Quote:
...
Configuring grep.
Configuring locales.
Entware uses separate locale-archive file independent from main system
Creating locale archive /opt/usr/lib/locale/locale-archive
Adding en_EN.UTF-8
//opt/lib/opkg/info/locales.postinst: line 8: /opt/bin/localedef.new: not found
Adding ru_RU.UTF-8
//opt/lib/opkg/info/locales.postinst: line 10: /opt/bin/localedef.new: not found
locale-archive file was not created, not enough memory? Downloading...
Connecting to bin.entware.net (172.67.212.134:80)
saving to '/opt/usr/lib/locale/locale-archive'
'/opt/usr/lib/locale/locale-archive' saved
You can download locale sources from http://bin.entware.net/other/i18n_glib227.tar.gz
You can add new locales to Entware using /opt/bin/localedef.new
Configuring entware-upgrade.


Anyone else had this problem or have any idea how to fix it?

Seems very strange that ext isn't supported but ntfs is. Is there any other filesystem I could use? I did try installing Entware onto a ramfs, but the installer bombs straight away as it thinks there's no free space.

Or is there any other way to get tcpdump back on to my router without Entware? I also briefly looked at ipkg, but that needs jffs, which is also gone in the new build.


Last edited by ion456 on Sun Aug 16, 2020 22:04; edited 1 time in total
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 8071
Location: Texas, USA

PostPosted: Fri Aug 14, 2020 10:54    Post subject: Reply with quote
Use two partitions on the USB drive. One for fat/ntfs to load the required kernel modules via startup, the other for Entware. That's the only solution idea I can think of. A lot of things were removed for K3.x images due to no images actually using the available flash space. I don't think any time has been spent on fixing this specifically for 16MB flash Broadcom devices.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
ion456
DD-WRT Novice


Joined: 14 Aug 2020
Posts: 4

PostPosted: Fri Aug 14, 2020 13:20    Post subject: Reply with quote
Thanks, I’ll give that a go and see how I get on.
ion456
DD-WRT Novice


Joined: 14 Aug 2020
Posts: 4

PostPosted: Sun Aug 16, 2020 22:02    Post subject: Reply with quote
I finally managed to load the ext kernel module and got tcpdump working.

I did run in to a few problems on the way though, so I'm going to document them here and the solutions in case anyone else has the same issues.

I tried to follow these steps to install the ext module:

https://wiki.dd-wrt.com/wiki/index.php/Mounting_USB_drive_without_located_onboard_fs_modules

But didn't know where to find the modules to install (the wiki link is broken, and likely device/kernel specific anyway).

To get the modules, I had to download and install the Firmware Modification Kit, and extract them from a similar Broadcom build on the same kernel (I chose this big build here: https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2020/08-09-2020-r44112/broadcom_K3X/dd-wrt.v24-44112_NEWD-2_K3.x_big.bin).

I used the instructions here to install the Firmware Modification Kit on an Ubuntu 20 VM I created:

https://wiki.dd-wrt.com/wiki/index.php/Development#Firmware_Modification_Kit

Note that the list of dependencies on that page isn't complete, follow the link at the end of the requirements section through to the FMK wiki and use that list, and also install python.

With that working, I found a kernel module for ext4, so I went with that for my USB stick (no idea if it also supports ext2/3, I didn't test). The kernel modules were in ./rootfs/lib/modules/4.4.232/

I copied to module on to my router using scp and tried to load it using 'insmod ext4.ko', but it didn't work. Looking at the output of 'dmesg', it needed some additional modules first. After a bit of trial and error, I found it needed jbd2.ko, mbcache.ko and crc16.ko. Once I copied and loaded these too, it then worked and I could mount my ext4 partition: 'mount -t ext4 /dev/sda2 /opt'

Nearly there, but I then ran into the same problem with installing Entware as on NTFS, it hung when generating the locales. I'd occasionally get an insufficient memory error before the router rebooted.

To get around this, I opened a second ssh session, and while Entware was installing, I removed the 'localedef.new' file, so it couldn't hang my router.

As soon as I saw these lines:

Code:
Installing locales (2.27-9) to root...
Downloading http://bin.entware.net/mipselsf-k3.4/locales_2.27-9_mipsel-3.4.ipk


I spammed a move command to get rid of the file before it could be executed:

Code:
mv /opt/bin/localedef.new /opt/bin/localedef.new.old


With that, Entware downloaded a locale instead and finished the install. I was then able to install tcpdump without any more issues.

Thanks for the pointer on loading the fs modules manually. Hopefully this may be of some use to anyone else who runs into similar problems.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum