Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Enabling Telnet on the Linksys X3000  (Read 5686 times)

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Enabling Telnet on the Linksys X3000
« on: February 24, 2013, 03:19:45 PM »

The Linksys X3000 has a Broadcom 6361 chipset and it ships without telnet. Thanks to asbokid, I have discovered that it is not in the firmware so I am going to have to add it.

Now, thanks to the 'Firmware Mod Kit' I have extracted the firmware. But I need some help on adding telnet to it, then re-building the firmware in order to flash it to the router. This is being done under Ubuntu Linux.
 
If anybody could be of any assistance it would be great.
Logged

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: Enabling Telnet on the Linksys X3000
« Reply #1 on: February 24, 2013, 03:25:07 PM »

So before proceeding any further, you need the corresponding mksquashfs that matches the unsquashfs used to unpack the root file system...
cheers, a
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: Enabling Telnet on the Linksys X3000
« Reply #2 on: February 24, 2013, 03:27:42 PM »

Right. I believe the mksquashfs that I need is 4.2. I have got this, but how exactly do I use it?
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: Enabling Telnet on the Linksys X3000
« Reply #3 on: February 24, 2013, 04:39:16 PM »

Right, I have managed to make an 'fmk.sqsh' file. What do I do with this?
Logged

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: Enabling Telnet on the Linksys X3000
« Reply #4 on: February 24, 2013, 04:49:21 PM »

The two file systems, before unpack and after being repacked, should be identical.    If they're not, repeat with tweaks until they are.  Compare by file size and with a hashing function, md5sum or similar.
cheers, a
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: Enabling Telnet on the Linksys X3000
« Reply #5 on: February 24, 2013, 05:07:31 PM »

Thank you asbokid. How do I turn the squashfs file into a .bin file?
Logged

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: Enabling Telnet on the Linksys X3000
« Reply #6 on: February 24, 2013, 05:13:00 PM »

There is a tool bcmImageBuilder that will make a firmware image from the original kernel image and the (re-)compressed root file system image.

It adds a Broadcom header, with the relevant offsets and sizes to the two component images.
Cheers, a
Logged

GigabitEthernet

  • Kitizen
  • ****
  • Posts: 2243
Re: Enabling Telnet on the Linksys X3000
« Reply #7 on: February 24, 2013, 05:28:14 PM »

Right, I think I am going to give up now as I really have no idea what to do. Therefore, if anybody wishes to help me with this, could they perhaps help me via VNC? Then I could see what to do.
Logged

asbokid

  • Kitizen
  • ****
  • Posts: 1286
    • Hacking the 2Wire
Re: Enabling Telnet on the Linksys X3000
« Reply #8 on: February 25, 2013, 01:54:48 PM »

The firmware mod kit (fmk) [1] from Craig Heffner and Jeremy Collake, wrongly identifies the scheme used to compress the root file system in that Linksys image.   It is in fact an lzma compression, and not gzipped, as the fmk reports.

The fmk also does not correctly invoke the squashfs tools.  Version 4.2 requires different command line options to earlier versions of the tools.

Maybe worth filing a bug report to Craig and Jeremy.

The file system does recompress okay, using the corresponding mksquashfs. However, the resultant image file size is different, so more tweaking needed!   No obvious tweaks either!   And there are a lot of options to tweak:

Code: [Select]
$ ../../src/others/squashfs-4.2/mksquashfs --help

SYNTAX: ../../src/others/squashfs-4.2/mksquashfs source1 source2 ...  dest [options] [-e list of exclude
dirs/files]

Filesystem build options:
-comp <comp> select <comp> compression
Compressors available:
gzip (default)
lzma
xz
-b <block_size> set data block to <block_size>.  Default 131072 bytes
-no-exports don't make the filesystem exportable via NFS
-no-sparse don't detect sparse files
-no-xattrs don't store extended attributes
-xattrs store extended attributes (default)
-noI do not compress inode table
-noD do not compress data blocks
-noF do not compress fragment blocks
-noX do not compress extended attributes
-no-fragments do not use fragments
-always-use-fragments use fragment blocks for files larger than block size
-no-duplicates do not perform duplicate checking
-all-root make all files owned by root
-force-uid uid set all file uids to uid
-force-gid gid set all file gids to gid
-nopad do not pad filesystem to a multiple of 4K
-keep-as-directory if one source directory is specified, create a root
directory containing that directory, rather than the
contents of the directory

Filesystem filter options:
-p <pseudo-definition> Add pseudo file definition
-pf <pseudo-file> Add list of pseudo file definitions
-sort <sort_file> sort files according to priorities in <sort_file>.  One
file or dir with priority per line.  Priority -32768 to
32767, default priority 0
-ef <exclude_file> list of exclude dirs/files.  One per line
-wildcards Allow extended shell wildcards (globbing) to be used in
exclude dirs/files
-regex Allow POSIX regular expressions to be used in exclude
dirs/files

Filesystem append options:
-noappend do not append to existing filesystem
-root-becomes <name> when appending source files/directories, make the
original root become a subdirectory in the new root
called <name>, rather than adding the new source items
to the original root

Mksquashfs runtime options:
-version print version, licence and copyright message
-recover <name> recover filesystem data using recovery file <name>
-no-recovery don't generate a recovery file
-info print files written to filesystem
-no-progress don't display the progress bar
-processors <number> Use <number> processors.  By default will use number of
processors available
-read-queue <size> Set input queue to <size> Mbytes.  Default 64 Mbytes
-write-queue <size> Set output queue to <size> Mbytes.  Default 512 Mbytes
-fragment-queue <size> Set fragment queue to <size> Mbytes.  Default 64 Mbytes

Miscellaneous options:
-root-owned alternative name for -all-root
-noInodeCompression alternative name for -noI
-noDataCompression alternative name for -noD
-noFragmentCompression alternative name for -noF
-noXattrCompression alternative name for -noX

Compressors available and compressor specific options:
gzip (no options) (default)
lzma
  -Xpreset <preset>
compression preset (0-9, default 6)
  -Xe
Try to improve compression ratio by using more CPU time.
  -Xlc <lc>
Number of literal context bits (0-4, default 3)
  -Xlp <lp>
Number of literal position bits (0-4, default 0)
  -Xpb <pb>
Number of position bits (0-4, default 2)
  -Xnice <nice>
Nice length of a match (5-273, default 64)
  -Xdict-size <dict-size>
Use <dict-size> as the LZMA dictionary size.  The dictionary size
can be specified as a percentage of the block size, or as an
absolute value.  The dictionary size must be less than or equal
to the block size and 4096 bytes or larger.  It must also be
storable in the lzma header as either 2^n or as 2^n+2^(n+1).
Example dict-sizes are 75%, 50%, 37.5%, 25%, or 32K, 16K, 8K
etc.
xz
  -Xpreset <preset>
compression preset (0-9, default 6)
  -Xe
Try to improve compression ratio by using more CPU time.
  -Xlc <lc>
Number of literal context bits (0-4, default 3)
  -Xlp <lp>
Number of literal position bits (0-4, default 0)
  -Xpb <pb>
Number of position bits (0-4, default 2)
  -Xnice <nice>
Nice length of a match (5-273, default 64)
  -Xdict-size <dict-size>
Use <dict-size> as the XZ dictionary size.  The dictionary size
can be specified as a percentage of the block size, or as an
absolute value.  The dictionary size must be less than or equal
to the block size and 8192 bytes or larger.  It must also be
storable in the lzma header as either 2^n or as 2^n+2^(n+1).
Example dict-sizes are 75%, 50%, 37.5%, 25%, or 32K, 16K, 8K
etc.
  -Xbcj filter1,filter2,...,filterN
Compress using filter1,filter2,...,filterN in turn
(in addition to no filter), and choose the best compression.
Available filters: x86, arm, armthumb, powerpc, sparc, ia64
$

cheers, a

[1] http://code.google.com/p/firmware-mod-kit/
« Last Edit: February 25, 2013, 06:29:27 PM by asbokid »
Logged
 

anything