Hey Guys,
Finally got this finished so thought I'd share it with the world so to speak.
Tried the debian installer on the forum here and was very impressed but really wanted to get a custom OS running from NAND (avoid the chance of hdd failure / allow the disks to be suspended at night etc) so...
After some research discovered the art of multistrapping - that is creating the rootfs of an operating system away from the target device.
Starting with marcus osdoba's excellent dockstar multistrap scripts (http://permalink.gmane.org/gmane.linux. ... edded/5984 and http://gitorious.org/dockstar/emdebian-multistrap) I went about modifying and extending them to multistrap an OS for the stora.
The result is a completely custom debian based os occupying ~60mb of the flash providing samba, nfs and ftp file sharing as well as file synchronization over a vpn and bittorrent.
It's bootable via usb for testing and the multistrap scripts create a ubi image and kernel image which can be flashed direct to the device.
Also included in the multistrapping process is some scripts that i wrote *hacked together which add support for the power and reset buttons along with the ethernet status and activity leds. Also seems that the sata activity lights are supported by the kernel I compiled for the system (win).
The scripts allow a base system to be created and additional packages (such as samba, nfs servers, ftp...) to be downloaded and installed and configured if neccessary before compiling a ubi image of the rootfs (NAND image) and a tar archive which can be loaded on to an ext2 formatted memory stick.
If anyone fancies giving it a try I've uploaded the multistrap scripts complete with step by step README for compiling the kernel / rootfs and testing / flashing the kernel and rootfs. I've also uploaded the latest deb packaged kernel that I'm running (2.6.38.2) which at ~2.5mb includes all the stora related drives ethernet, nand, temperature, rtc etc... along with ext2, ext3, cifs, nfs, nfs server, ppp (vpn) and maybe some more :-) - (there's a config file embedded in the deb).
The multistrap scripts and kernel + (original patches) can be found in the files section of this site under "Uploads" and are called "emDebian Multistrap Scripts", "Linux Kernel for Stora version 2_6_38-2" and "Kernel patches for stora extracted from orion-netgear_ms2110"
Hopefully these direct links should work:
emDebian Multistrap Scripts
Linux Kernel for Stora version 2_6_38-2
Kernel patches for stora extracted from orion-netgear_ms2110
If anyone does feel like trying it / loves it / gets stuck let me know.
I dont have all that much free time but will certainly try to help where I can.
Needless to say I can't take any responsibility for damage done to your stora and strongly recommend testing with usb before flashing.
It may also be worth noting that my kernel is compiled with the original stora nand layout ie 6Mb for the kernel - which means you could backup your original rootfs by mounting (as described in the readme) before flashing.
Thanks,
Phil
I apologize for the misinformation.
We are raising funds for ranX. He has helped alot of people on our forum, and he is without a jtag interface on his machine.
Everyone who he has helped, please remeber him.
Check the front page for goal information.
We are raising funds for ranX. He has helped alot of people on our forum, and he is without a jtag interface on his machine.
Everyone who he has helped, please remeber him.
Check the front page for goal information.
emDebian Multistrap - Custom Debian On NAND
|
i'm on buying stora soon, so i will try this multistrap installation:)
but i love it already;) i'm wondering - how long took You all this? - get emdebian working on sora's nand? |
|
|
Hey,
Thanks + let me know how you get on. It took maybe a day or so, i'm by far an expert on linux and most of the time was spent working out what the scripts I based the storas on did. Let me know how you get on if you decide to give it a go, Phil |
|
|
If possible please write manual how to install emDebian Multistrap at Stora for people who are not very strong in Linux, I would be very grateful.
|
|
Fell at the first hurdle - can't find the README at/in any of the links indicated. A step-by-step guide for this is really needed. Also, I'd like to know how to back up my current configuration as a NAND image first, so that I have a fall-back position if I can't get this to work. |
|
|
Hi Pgreenland
First thanks for your work putting script together. I tried your multistrap script and have had problems following your instructions in readme. note for others, on line git checkout origin/aufs2.1-37 the two digits correspond to kernel no it got me as i used this line without change git clone git://git.kernel.org/pub/scm/linux/kern ... 6.36.y.git 1/ applying your patches to the kernel failed i used this kernel git clone git://git.kernel.org/pub/scm/linux/kern ... 6.36.y.git did you use 2.6.38 Gave up on that temporarily a decided to use your compiled one but there was a error in your multistrap_stora_advnas.conf and the other conf it has line source=source=http://ftp.uk.debian.org/debian not source=http://ftp.uk.debian.org/debian fixed that .Then i had problems with multistrap apt-get not finding autofs in debian rep and not finding busybox-syslog in grip rep (but found load of others) i looked at the repository pool and i didn't find busybox-syslog . Thanks Tony |
|
|
Any step by step guide for this???
|
|
|
You have me thinking about trying this
....I just got to messing with the old stora this week. In the Event of my New FreeNAS server build, I promptly pushed the entire stora to the New box, Soooooo ... Its time to play with the Stora:) Root access, Te Evil Access Patrol spooned out, time to figure out how to get a hard backup of the NAND and go for it Any tuts for that?? LOLZ I have done some wrt54g custom builds, and play with Nix a bit
|
|
|
Hey Guys ! (and Gals?)
When I first came along this post it made me very excited as it was exactly the thing I have been looking for. A customized stora running a decent OS of one's own flavour from chip .... Phil made a great approach here ! Unfortunately his readme is missing explanation of several important points which then become a showspoiler. @phil: hopefully you read this and are willing to help by filling in the blanks on request .... As long this ain't so, I try to shed some further light on the project by adding my own experiences: If one gets stuck like "camouflage": --> the README is placed in the "emDebian Multistrap Scripts" archive. So simply unpack and read .... I took the same approach as Tony an started off with the "ready made" kernel. Having been warned I changed the repository-sources in the multistrap_stora_advnas.conf to my needs. Next step in the readme says to get oneself a debian machine for multistrapping. Therefore I (running Ubuntu as main OS) created a basic one as Virtual Machine on Virtualbox. What I found out so far is: there have to be more packages installed on that VM running the multistrap scripts, than named in the readme ! Here's the list of the ones I installed on the bare machine to get the script (nearly) working. Not all of them are needed, some are ony for me own convenience ... Simply copy and paste:
Another mandantory package is qemu-user-static. Be aware to compile this yourself from the newest sources. The debian package one gets via "apt-get install" has a bug which will prevent the multistrap scripts to complete correctly. This one is fixed with the newest sourcecode of qemu-user-static. Tus far I got last night. qemu-user-static still has to be built - maybe this becomes a story of it's own ... Some other questions still to answer: The main "config" file of the multistrap scripts has a section "fstab entry for rootfs" Do these have to be changed ? If it is so; which entrys must be made for an OS running from nand ? How and where can I change the global locale (in my case to "de") ? Simply replacing all "C" entries in the scripts results in heaps of errors. Best Regards ranX |
|
|
Hi Everyone,
Glad to see that my endevours may for a change be useful to others :-) Apologies for my time away I was hoping replies to this thread would be emailed to but apparently I've missed them (betting on a spam filter) Also I see now that it was a mistake hiding the guide in the archive - wanted to try to create one straightforward download - should have perhaps separated the guide and supporting files. @ranX you seem to have made an excellent start - I usually use Fedora on my main pc so created a small virtual box debain installation to do the kernel building and multistrapping for the stora. I haven't tried the scripts on ubuntu but i'm sure they'll work with a few tweaks. From memory I think I created a fresh install of debian while creating the guide to try and prevent any missed packages, will have to have another go installing ubuntu based on your suggestions when I have a mo as it would be interesting to see what I've missed. Your next question regarding the rootfs in the config file - the following lines were taken from my last build " # fstab entry for rootfs # the rootfs may reside on the internal flash (e.g. ubifs) or external storage like an USB stick (e.g. ext2) #FS_TAB_ROOTFS="/dev/sda2 / ext3 defaults,noatime,ro 0 1" FS_TAB_ROOTFS=" The FS_TAB_ROOTFS variable is used in "customize_rootfs.sh" to update the fstab file in the multistapped file system and looking at my last build output it would confirm that the variable wasn't set when I ran the build. I'll check on my nas to make doubly sure though (am away vising relatives for Christmas at the moment but will update you as soon as I get back). I think that the rootfs is specified on the kernel command line looking at the NOTES file i remember using: " To boot new kernel and rootfs from nand: nand read.e 0x800000 0x100000 0x400000; setenv bootargs '$(console) ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs init=/sbin/init-ro'; bootm 0x800000 " So the same file system could be on an internal / external disk or on flash without any changes to the fstab file. A normal desktop distribution will have a kernel and initial ramdisk (initrd) which will be loaded by the kernel and a script contained within will remount the rootfs as read-write - in this case i think its important to have the rootfs specified in the fstab file which will be compiled into the ramdisk image with the other scripts and required binaries. The stora lacks this initrd and as such the kernel mounts the rootfs directly as specified in its arguments from uboot and the os is booted directly executing the /sbin/init-ro script to complete its initialisation. Locale wise I didn't make any changes from the original dockstar scripts. From "http://manpages.ubuntu.com/manpages/natty/man1/multistrap.1.html" and "http://www.emdebian.org/emdebian/langupdate.html" it looks like the emdebian packages have been split into different locales, suppose it may be a case of selecting the correct repository for a german locale. Will look into it a little more for you when I've got my dev environment available. Now you've got me interested again I may use this as an excuse to make some changes to my stora as I havent updated the kernel or OS since my original post in April. I've added a few new scripts and applications to put the hard drives to sleep in an intelligent way at night and would like to add uShare to support sharing with my housemate's Xbox and PS3. Thought it might also be nice to add a script to backup any usb device or memory card plugged into the usb port on the front and would like to add some support for my UPS once i've got it networked. Let me know how you get on if you're still working on it and I'll check the details above asap. Thanks, Phil |
|
|
pgreenland, Glad to see you back here...
If you have a little free time, could please re-pass a bit your nand install guide, to create a more user friendly one... You could try to finish this one... http://www.openstora.com/wiki/index.php ... e_firmware Thanks for everything... |
|
|
Hey,
@vdias As i mentioned above I'm looking to start doing some development on my nas again soon. As part of it I will look at completing the alternative guide as it looks relatively straight forward compared to my entirely offline method. If the process described works correctly installing to the nand wont be an issue. I'll let you know once I've made some progress. Phil |
|
|
Hi Phil,
I think it's not too late, to wish you a happy new year at first ! To inform you about my progress in this work is pretty simple: there was none But start from the beginning: In my last post I reported there's to be a different (newer) version of qemu-user-static on the debian machine one uses for multistrapping. I found out compiling this ain't necessary - just install the newest from the testing branch This an many more is described in this guide on the dockstar-board @Phil - I suggest to take a look at it as it fully describes the multistrapping process with useful hints It also answered my question about the locale - in your scripts and configs only the "LANG" variable had to be found and changed to have it all running smooth. So in the end of my efforts I had an image of the kernel and an image of the root filesystem Happy about that I became a bit daring. The above named dockstar-post also deals about booting totally from USB. I thought this to be a nice idea: if anything of my work went wrong, I still have the untouched nand and always will be able to switch back to my (nearly ) original stora os.There's no wear on the nand and a USB stick if ever fails would be replacable. Last but not least I won't have to care too much about size of the filesystem. So I got myself one of these 4GB micro USB thingies, which doesn't stick out and so is nearly "inivisible" Put kernel and filesystem on it and changed U-Boot settings via fw_setenv like described in the above named post. At that moment my progress came to halt as I had no serial console cable an the new settings rendered the stora unbootable Anyway ! Knowing that there'd be the chance of "bricking" the stora I had ordered a Nokia-cable some days before. The shipping from China took unexpectedly long so I was able to solder my cable only yesterday. Now that I have console access I revived the stora an it boots the original way. Back to the USB topic again: As I won't use the USB port for other purposes and booting from it to me offers many advantages it would be nice to enable that on the stora (if possible ?) All files to be put on the USB-Stick are present. What I'm missing is the proper config for U-Boot. I can deal with grub but don't feel like digging too deep in U-Boot. So I'd be happy if you could help me out with the needed configuration commands. Best Regards ranX |
|
|
Hi ranX,
Glad to hear you've made some progress, no worries on the USB booting hopefully we'll be able to get you going. I used it in exactly the way you described to get my custom OS image and kernel up and running before flashing it to the NAND. I take it you've been able to access the UBoot console using your new cable? As I haven't started working on my NAS again yet I haven't got a UBoot console session handy however from my notes and backups when the stora is starting up you should see an output similar to the following on the serial console.
The key like being the "Hit any key to stop autoboot" which will get you into the UBoot console. From there you can change the Uboot environmental variables and boot the stora then if all is well write the updated variables to the uboot area of the nand to set the default configuration. To list the current environmental variable values you'll want to execute:
This is the backup I took of my stock stora's variables:
The important variable here for us is the bootcmd variable "bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm " which in the stock configuration reads a block of data from nand into memory (the kernel), sets an environmental variable "bootargs" using two predefined variables and then boots the machine. If you've still got the files from my original post handy the NOTES file contains a range of different boot commands I used / attempted to use during development. The one you'll end up using will depend on your OS configuration and possibly your hard disk / memory stick configuration. I take it you have a kernel image (uImage) stored in /boot? and possibly an initramfs image (uInitrd) also stored in /boot? on the memory stick along with the rest of the rootfs. Or if you're like me / the stock stora configuration you wont have the initramfs. The command I used to boot the kernel from and use the memory stick as the rootfs was:
Executing that from the uboot prompt will set the temporary bootargs variable, reset the stora usb controller detecting the memory stick, load the kernel image into memory and boot the kernel and therefore the os. The "root" parameter will need to be updated depending on how many disks you have in the stora eg i have two "sda and sdb" leading to my memory stick being detected as "sdc" but you could put a volume UUID in if you wanted to be on the safe side (providing it wont ever change). The rootdelay adds a 5 second pause to allow the kernel to detect the memory stick before mounting the rootfs. Alternatively if your using an initramfs image the following *should* do the same as well as loading the extra image:
When executed with the memory stick plugged in and the root parameter set correctly this will cause the stora to boot the OS immediately and the result should be visible on the serial console. If all is well the bootcmd variable can be updated with:
And the environmental variables can then be persisted with:
One additional thing you'll have to do if you havent already is update two more variables to allow a mainstream kernel to boot with:
Which is required can be reverted to boot the stora kernel with:
Hope this helps (let me know how you get on). Phil |
|
|
Hi Phil,
thank you for the fast response an great instruction ! That was even more than I could expect. If I won't get it running with such a detailed help, I never will .... Yes, console looks like shown at your screenshot.
was the line I reset to get stora back to boot the original netgear stuff. Tonight I'm planning to play a little further with the stora. Certainly I should drop some lines here to let you know about the effort. Best Regards ranX |
|
Return to Netgear Stora Custom Operating Systems
Who is online
Users browsing this forum: No registered users and 1 guest



....I just got to messing with the old stora this week. In the Event of my New FreeNAS server build, I promptly pushed the entire stora to the New box, Soooooo ... Its time to play with the Stora:) Root access, Te Evil Access Patrol spooned out, time to figure out how to get a hard backup of the NAND and go for it
) original stora os.