LS-GL Custom Firmware Development

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 23:35, 31 August 2007 by Ramuk (Talk | contribs)

Jump to: navigation, search


LS-GL Custom Firmware Development
This wiki page is to document the work and progress in developing a custom firmware for the LS Pro (LS-GL) The goal of this page is to sort out the roadmap and accomplishments towards creating an OpenLink and FreeLink for the LS-GL. Though this page is mainly for developers, anyone is free to add their work.

 
WARNING!

The methods and information described below are intended for advanced users. Much of the information has not been verified by the development team. As a result, all users must exercise caution when performing any of the described methods. Failure to do so may result in a bricked Linkstation.


Please fix and update these sections. Also, please correct any grammar and spelling errors. Thanks -- jonli447

Using the Firmware Updater

It is aparent, like all of the Linkstations, that the firmware does not want to update the firmware if the LS-GL reports the same firmware version as the the one to be that's to be sent to the LS-GL (i.e. a modified firmware). The work around is to:

  • Add to lsupdater.ini
[SpecialFlags]
Debug = 1
  • Change in lsupdater.ini
VersionCheck = 1

to

VersionCheck = 0
  • Open linkstation_version.txt in any text editor (i.e. vi). Edit either the BOOT=, KERNEL=, INITRD=, or ROOTFS= (this is the main firmware and filesystem) to choose what to update by changing the version to a higher number.
    • i.e. by setting rootfs to a higher number, the filesystem will get updated, but uboot, kernel, and initrd won't get updated.
  • Steps originally drafted by Georg.

Note: We are not positive if only one segmet (i.e. rootfs) will get updated. This method must be fully tested to find this out.

jonli, should I move the following more technical part about Erics excellent work into a separate section? - Georg

Updater Specifications

  • As EricC documented on the LS-GL side clientUtil_server handles the update process and replies to various "ACP"-Commands, which are similar for the LS-GL and the Kurobox:
  • LSP Commands
8020 ACP_Discover
8080 ACP_FIRMUP2
80A0 ACP_?? Possible Password?
8A10 ACP_CMD
8B10 ACP_?? Sent after 8080 and contains the filename. TCP File transfer starts after reply
8B20 ACP_?? Sent after TCP file transfer
  • LSP Responses
C020 ACP_Discover_Reply
COAO Reply of 80A0
CA10 ACP_CMD_Reply
CB10 ACP_??_Reply 8B10
CB20 ACP_??_Reply 8B20
CB21 Sent after CB20. Same format with data changes Update complete?
  • KuroBox Commands
8020 ACP_Discover
8070 ACP_FIRMUP_END
8080 ACP_FIRMUP2
8090 ACP_Info_HDD
8A10 ACP_CMD
  • KuroBox Responses
C020 ACP_Discover_Reply
  • Looking at the command word
Bit 15 = 1
Bit 14 is 0 for command and 1 for reply
Bits 11 to 8 appear to be the command class
Bits 7 to 4 appear to be the command in the class.
Bits 3 to 0 appear to be a sequence number in the response.
  • The updater on the LS-GL receives ziped images and tries to unzip them by testing for the following passwords
    • 1NIf_2yUOlRDpYZUVNqboRpMBoZwT4PzoUvOPUp6l
    • aAhvlM1Yp7_2VSm6BhgkmTOrCN1JyE0C5Q6cB3oBB
    • YvSInIQopeipx66t_DCdfEvfP47qeVPhNhAuSYmA4
    • IeY8omJwGlGkIbJm2FH_MV4fLsXE8ieu0gNYwE6Ty


Custom Updater

See Opensource_Firmware_Updater and LS-GL Custom Updater Thread for more information.

Todo: Import information from the forum here.

Toolchains

Opened Firmwares

Telnet enabled firmware

Jtymod

Open Stock Firmware

FreeLink


Development Tools

GPL Kernel

<dpl> category=LSPro category=Kernel </dpl>


Other Development

User Accomplishments

Please post accomplishments that don't fit into the above categories here

  • jtymod got ssh up and running, enhanced the webinterfaces sp you can controll telnet + ssh + a mediaserver
  • chroot Arm Build Environment by armstation

Why: To not fill up LinkStation's system partition & To test toolchains and building programs without risk of breaking anything

1) Create a chroot somewhere outside of the LinkStation system partition.

mkdir /mnt/disk1/share/arm-tools

2) Transfer entire Linkstation system to build directory.

cd /
for d in `ls |grep -v dev |grep -v proc|grep -v mnt`
do
tar -cvf /mnt/disk1/share/arm-tools/$d.tar $d
done

3) Unpack the system directories.

cd /mnt/disk1/share/arm-tools
for f in *.tar
do
tar -xvf $f
done

4) Download jonli447's excellent arm-tools and copy them into /mnt/disk1/share/arm-tools/ then Gunzip & Untar the arm tools

tar -xvzf arm-tools-0_16-3.tgz

5) Mount special files in chroot environment (thanks Zoolook)

mount -t proc none /mnt/disk1/share/arm-tools/proc 
mount -o bind /dev /mnt/disk1/share/arm-tools/dev

6) Create /opt directory in chroot

mkdir /mnt/disk1/share/arm-tools/opt

7) Create symbolic link from chrooted /opt to system /opt

ln -s /mnt/disk1/share/arm-tools/opt /opt

8) chroot into development environment.

chroot /mnt/disk1/share/arm-tools /bin/sh

That's it, now everyting compiled and installed to /opt from chroot will be available from the main Linkstation system without adding any files to the system partition besides 1 symbolic link.

Related Forum Topics

Todo: Add information to above sections.
{"cc_re__cc_re__cc_by_sa_3_0": ["ef=\"/w/index.php?title=LS-GL_Custom_Firmware_Development&amp;oldid=13951\" title=\"Permanent link to this revision of the page\">Permanent link</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"t-info\"><a href=\"/w/index.php?title=LS-GL_Custom_Firmware_Development&amp;action=info\">Page information</a></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t\t</div><!-- end of the left (by default at least) column -->\n\t\t<div class=\"visualClear\"></div>\n\t\t\t\t\t<div id=\"footer\" role=\"contentinfo\">\n\t\t\t\t\t\t<div id=\"f-copyrightico\">\n\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img src=\"http://i.creativecommons.org/l/by-sa/3.0/88x31.png\" alt=\"Attribution-Share Alike 3.0 Unported\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"f-poweredbyico\">\n\t\t\t\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"/w/resources/assets/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<ul id=\"f-list\">\n\t\t\t\t\t\t\t\t\t<li id=\"copyright\">Content is available under <a class=\"external\" rel=\"nofollow\" href=\"http://creativecommons.org/lic", "co\">\n\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img src=\"http://i.creativecommons.org/l/by-sa/3.0/88x31.png\" alt=\"Attribution-Share Alike 3.0 Unported\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"f-poweredbyico\">\n\t\t\t\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"/w/resources/assets/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t<ul id=\"f-list\">\n\t\t\t\t\t\t\t\t\t<li id=\"copyright\">Content is available under <a class=\"external\" rel=\"nofollow\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Attribution-Share Alike 3.0 Unported</a> unless otherwise noted.</li>\n\t\t\t\t\t\t\t\t\t<li id=\"privacy\"><a href=\"/wiki/Http://www.nas-central.org/privacy-policy\" title=\"Http://www.nas-central.org/privacy-policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t\t<li id=\"about\"><a href=\"/wiki/NAS-Central_Buffalo_-_The_Linkstation_Wiki:About\" title=\"NAS-Central Buffalo - The Linkstation Wiki:About\">About NAS-Central Buffalo - The Linkstation Wiki</a></li>\n\t\t\t\t\t\t\t\t\t<li id=\"disclaimer\"><a href=\"http://www.nas-central.org/ind"], "copyright__copyright__copyright": ["", "irectory in chroot\n\nmkdir /mnt/disk1/share/arm-tools/opt\n\n7) Create symbolic link from chrooted /opt to system /opt\n\nln -s /mnt/disk1/share/arm-tools/opt /opt\n\n8) chroot into development environment.\n\nchroot /mnt/disk1/share/arm-tools /bin/sh\n\nThat's it, now everyting compiled and installed to /opt from chroot will be available from the main Linkstation system without adding any files to the system partition besides 1 symbolic link.\n\nRelated Forum Topics\n\nTodo: Add information to above sections.", "irectory in chroot\n\nmkdir /mnt/disk1/share/arm-tools/opt\n\n7) Create symbolic link from chrooted /opt to system /opt\n\nln -s /mnt/disk1/share/arm-tools/opt /opt\n\n8) chroot into development environment.\n\nchroot /mnt/disk1/share/arm-tools /bin/sh\n\nThat's it, now everyting compiled and installed to /opt from chroot will be available from the main Linkstation system without adding any files to the system partition besides 1 symbolic link.\n\nRelated Forum Topics\n\nTodo: Add information to above sections."]}