NAS running Arch Linux ARM - ZyXEL NAS326
FOR THOSE INTERESTED
I am currently doing a big writeup on the processes I am going through. I've made a ton of progress on this! Once completed, I will put the writeup on GitHub and make it available here as a link!
AVAILABLE: https://github.com/alexhorner/ZyXEL-NAS326
--------------------------------------
Another big update!
So I managed to install GCC and a metric TON of libraries using slacker!
I downloaded the latest PHP source, and after a LOT of messing around getting the libraries together and diagnosing ./configure failures, I ran ./configure with --without-libiconv and it started working!! Now sitting on the make so will keep you updated. Excited to do make install as it will be awesome if we get a persistant installation!
AND IT INSTALLED (now to get apache to like it)
Heres what I did on the NAS:
./buildconf --force
mkdir /ffp/php7*
./configure --prefix=/ffp/php7 --without-iconv --enable-maintainer-zts --enable-debug --enable-cli*
make clean
make
make install
*I chose to make a specific php7 directory, however if you have not installed FFP PHP5 then you may want to ignore the mkdir and use the prefix /ffp instead of /ffp/php7
Note this is all running on the NAS itself.
---------------------------------------
Original post below line.
So! After a while of fiddling, I have found out about a potential way of getting new software on to this neat little box!
This will be a little long-winded I feel as I am going quite detailed as to the process so make it as easy as possible for people to get a feel for how this all works. DISCLAIMER: I'm rubbish when it comes to pure Linux. I've been spoilt rotten with Ubuntu and Aptitude. I will try to explain as best as I can how I THINK all of this works, but i'm probably very wrong. I really hope I can get a little help building something awesome here, as I'm rubbish with binary stuff myself!
Okay, so after doing a decent amount of reading on http://nas-central.org I have managed to work out two things:
- How to start getting third-party packages to appear in the apps menu
- How to get packages installed from a .txz file (.tar.xz)
For this, I will assume you can use vi and also have initialised a RAID volume already.
First off, we need to get access to tools which allow the easy installlation of .txz files. We need to allow the NAS326 to install a third-party "app" which adds more repositories to the "app center". This "app" is called MetaRepository, which essentially allows you to have multiple repositories behind the app center, giving you access to more packages. To get this, you need to SSH into the NAS, and run cd /i-data/sysvol/admin then mkdir zy-pkgs then cd zy-pkgs. Open the required file like so vi web_prefix and type or past the following into the file, save and exit http://downloads.zyxel.nas-central.org/Users/Mijzelf/zypkg-repo/.
At this point, we can head back over to the web UI. Open "app center", click browse, all apps and then hit refresh. All other packages should disappear and then MetaRepository should be the only one available, like so (please ignore the other packages, they won't appear, just look at the green circles):
https://i.redd.it/vwv216y0w5j21.png
Now install the MetaRepository package, and click the refresh button again. All the original ZyXEL packages will appear, but in addition to this there will be a load of new third party packages available, as shown above!
Now, for installing via .txz you need to install FFP from the app center list. Install it and then REBOOT YOUR NAS!!
After the reboot, you can log back in to the web UI. You'll notice MetaRepository has added an icon which allows you to manage the repositories displayed in the app center (If you follow 1.4 of http://zyxel.nas-central.org/wiki/3rd_party_zypkgs you can make your own repositories but the files need to be in a weird layout inside of a .tar.gz which has the extension changes to .zypkg). This looks like so:
https://i.redd.it/3zwj7un2x5j21.png
Additionally, you will see that there is now an FFP icon. Clicking on this shows us the secret to installing the .txz packages! Again, you're gonna need ssh. You can GET the packages from FTP or HTTP using wget which already should be on the NAS. If not, install RandomTools and Tweaks as I can't remember if they are what adds it or if it's native... Heres the FFP page, and the thing we need highlighted.
https://i.redd.it/ep0792v6y5j21.png
You'll notice it comes with a small package manager too, which works and installs stuff fine, however the update function is completely broken as it appears to use invalid wget syntax. Just CD to the directory it shows in the shell output and run the wget it also shows, just without the -Nnv arguments. Then run it again and it works fine (gives an error again, however if you now run slacker -a it'll work).
Heres the repo slacker displays when you do slacker -a. http://downloads.zyxel.nas-central.org/Users/Mijzelf/FFP-Stick/packages/0.7/arm/ You'll notice they're all .txz, so I wouldn't mind betting all slacker does is download the file and then calls funpkg.
HERES A LIST OF ALL AVAILABLE PACKAGES AS OF WRITING ON SLACKER: https://pastebin.com/mHPMfA7a
That repo is my main focus. You'll notice it has MySQL and PHP (albeit older versions than the official app center version allows you to install as a PHP MySQL and PHPMyAdmin package). I'd like to get this up to the latest possible PHP and MySQL so I can start running my own modern apps (like the latest OwnCloud). PHP7 preferred. You'll also see an older version of Python3 from 2012, so it would be awesome if we could also get that to the latest possible python.
I know I'm asking a lot from people here and I respect people may not have the interest or time, however even a guide on where I should start doing this myself is greatly appreciated. I may start hosting mirrors of some of the repos and also a better written guide, so if this all topples over there a working copy of all the repo content to keep it's existance going. Of course if people help me with this, you'll get credit for authoring packages or providing links etc. i'm pretty noob to this deeper binary stuff, but it seems not too bad, just getting packages in such a form that the NAS will accept and install them, and they work with this Armv7 architecture is hard for me to understand. For more architectural details for this NAS, see here: http://zyxel.nas-central.org/wiki/Category:NAS326
Here are the .txz FILES FOR PHP, MySQL and Python that Slacker downloaded https://www.dropbox.com/sh/o3tqykgrl6a2mtx/AABgrhQ_mbzFKiqgiO4uTNtXa?dl=0
-------------------------------
If this is the wrong subreddit, please kindly point me in the right direction, Thanks! Original post was in r/embedded but it was suggested I post it here
Hi there!
So, i'm now the proud owner of one of these: https://www.zyxel.com/products_services/2-Bay-Personal-Cloud-Storage-NAS326/
I picked this NAS in particular because it runs an embedded Linux Arch ARM distro, not stored on the hard drives but on-board with UBoot. The NAS runs BusyBox. If you look at this website: http://www.craigamos.rocks/building-the-zyxel-nas326/ you can see some additional details of how this thing ticks HOWEVER at the bottom of this website there is a NETWORKING WOES section which now appears to BE INCORRECT as I CAN indeed ping to 8.8.8.8 from the SSH session!
Additionally, the article shows that the NAS is running Apache2, which is pretty awesome, however this installation of Apache2 seems to be a bit locked down. THIS is my interest right now. As an installable "app" the NAS allows you to install PHP, MySQL and PHPMyAdmin. PHP is version 5.5.22, MySQL is version 5.1.73 and PHPMyAdmin is version 4.1.14.3.
What I'd love to achieve is change the Apache2 config to be able to define my own virtualhosts, like you would any other Apache2 server. I'd also love to get PHP7 and a newer version of MySQL installed.
Another "app" is OwnCloud. This is an extremely outdated version, so I used the web features to publish a shared folder to the web. It seems to start working, but of course PHP is way too old to suffice, giving the following error:
This version of ownCloud requires at least PHP 5.6.0 You are currently running PHP 5.5.22. Please update your PHP version.
Here's the apache config file: https://pastebin.com/GMj2aRmV
Here's the directory listing of /bin: https://pastebin.com/AaAN9wB2
Here's the full User Manual PDF: ftp://ftp.zyxel.com/NAS326/user_guide/NAS326_V5.21%20ed2.pdf
And here's the firmware: ftp://ftp.zyxel.com/NAS326/firmware/NAS326_V5.21(AAZF.3)C0.zip
The process of using the web publisher is as follows:
- Create a new share like so:
https://i.redd.it/ft3q5cx9cyi21.png
- Publish the share using Web Publisher:
https://i.redd.it/pbenu0nbcyi21.png
admin, music, photo and video are built-in default shares that cannot be deleted.
Here is the "apps" installation screen:
https://i.redd.it/n7fo9r3dcyi21.png
So I'm comfortable with Ubuntu Server so I know my way around the command line, and also Apache2 on the Ubuntu Server which gives me a2enmod a2dismod and a2ensite and a2dissite for module and config management, which the NAS does not have.
I'd love to get to the point where I have a package manager, as pacman does not exist in this Arch install, and I'd love to get full control over Apache2, PHP and MySQL with new versions.
Just for a little more context, I've included a full port scan:
https://i.redd.it/p1ljefnecyi21.png
- Port 80 is the ZyXEL user interface
- Port 5000 is what the Web Publisher uses, however going to plain port 5000 just gives a weird rewrite rule messup as if it's trying to get to the user interface. If you use the addresses as shown in the web publisher screen it will redirect you to
x.x.x.x:5000/MyWeb/THE-SHARE-YOU-WENT-TO. If you use an installed "app" like ownlcloud, it uses this address so the address would becomex.x.x.x:5000/pkg/owncloud - Port 5001 appears to be a HTTPS version of port 5000
- Port 5002 is 403 forbidden, and
/MyWeband/pkgis 404 - Port 5003 appears to be HTTPS version of port 5002
- Port 8082 is HTTP, and has 403 Forbidden,
/pkgis 403 Forbidden, /MyWeb doesn't exist
Is there any way I can make this a more capable little Linux platform with full control of the webservices as said above?
It'd also be lovely if I could run Python3 on here!
Thanks for any help. I'm willing to give out any additional info you may request to help me get started on this little box!
Edited 3 Mar 2019. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 17 · 100% up
- Kind
- Gallery · 7 files
- ID
- av2evg
20 comments
You could probably install your own software, or update the existing packages if they use pacman/AUR.
There is quite a chance it will make it harder/impossible to use the "normal" web interface to control though.
I'd start by trying to install some package that doesn't cause any harm or affects any system you're using. For example `htop` or `tmux`. (Try run it first to see if it's not installed, if it is, pick something else.)
If that survives a reboot, you can continue to poke around, if not things are going to be a lot harder.
OH: Now that I think of it, try and install `screenfetch`, run it and post the output here. Along with the output of `pacman -Q`
Unfortunately pacman is not in this installation. Is there any binary I can upload to the box (I can upload stuff onto the normal shares and I guess I can use MV) which will test the reboot survival, maybe even pacman itself?
EDIT: I just created test.txt using vi in /bin .... It didn't survive the reboot :(
Well, if it doesn't have pacman, I'd almost call it 'not Arch' :)
It's quite possible you could for example use the user home, or some other folder that's not on a temp file system, but it makes life harder.
Try a couple of other folders for persistence, in particular any folders on the $PATH.
Also: you won't be able to copy just any executable onto the device. You need the right architecture first of all, but more significantly, there likely won't be the same (version of the) required libraries on there.
It should like a fun challenge for me, but I don't know how comfortable you are with all of this. It might be worth trying to find a community that already has a "improved" firmware you can start from.
http://downloads.zyxel.nas-central.org/Users/Mijzelf/zypkg-repo/NAS326/zypkg/5.21/MetaRepository_20161021_arm_014.zpkg
This is the thing that allows you to link external repos to the app list
So this is one of the packages. Itappears to be in GZip format just with a fancy extension. Inside is a tar... so .tar.gz And inside that there are two more .tar.gz. Heres whats inside:
In control.tar.gz we have the following:
And inside data.tar.gz it looks like we may have a root directory structure? :
I've updated the post with as much info as I have gathered which may push this in the right direction :D
Hi I've a Nas326, and I'd like install a Plex app.
all link repository sites seem down, but I've found:
PlexMediaServer-0.9.16.6.1993-5089475-arm.bin and plexmediaserver-0.9.12-arm-15.txz.
Is there a way to install it on my Nas?
Thanks for any help
Hi there!
ALL of the links found on the GitHub should be backed up on Archive.org. Here's the FFP one https://web.archive.org/web/20190301091002/http://zyxel.nas-central.org/wiki/FFP_as_zypkg
I'm not sure how Plex works as an app, but if you can follow all of my instructions on GitHub you might be able to get your txz working. I think if you fiddle with Slacker you might be able to get it to install your txz but don't quote me on that one.
many links are broken ... downloads.zyxel.nas-central.org seem down, FFPStick is un dowloable, MetaRepository doesn't work (for me). I'll give up thanks