Howto Debian environment within SnakeOs.
Written by Robert Szabo.
Very simple way to have Debian (and its huge number of packages). Chroot is a "jailed environment" (embedded system within a linux) where you have debian libraries, packages and the whole deb environment within SnakeOS host.)
You only need to have an USB device attached. (No serial connection needed.)
Use ext2 or ext3 file system to extract files below. (On FAT it will be extracted, but wont work!)
#cd /usb/sda1 # wget http://snake-os.googlecode.com/files/debian_chroot.tgz# rm -R debian ** ! This will erase previous debian directory!**#tar -xvf debian.tgz #mount -o bind /proc /usb/sda1/debian/proc #mount -o bind /dev /usb/sda1/debian/dev #mount -o bind /usb/sda1 /usb/sda1/debian/mnt/sda1 - this is not mandatory #chroot /usb/sda1/debian/ Now you are in chrooted debian shell. To exit debian use "exit" command or reboot.
Steps eight to eleven can be automated with the debianctl package. Once installed go to Services->Debianctl and set the directory where Debian was extracted, the disks to mount and the services to start. From then on debianctl will automatically bring up Debian at system startup.
Current version: http://code.google.com/p/snake-os/downloads/detail?name=debianctl-0.3-1.opk
**Some useful - "must have" thing: **
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: robert1...@gmail.com
Original idea is from Naxeras, and JG from the forum thank for them. :)
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: jgu...@gmail.com
Great to see a properly made howto. I am too lazy to do it, so I am happy now I just need to link your doc when someone asks for a binary of a given software for SnakeOS.
Also I may add these "must" packages wget <--- for downloading from http and ftp (available thru apt-get) plowdown <--- downloading from hosting servicees like rapdishare and megaupload ( from http://code.google.com/p/plowshare/downloads/list beware it depends on many packages all available thru apt-get) screen <--- It allows you to run "virtual terminals" with the added benefit that closing the connection the process keep running, so no need to do 10 ssh sessions, or using nohup
Thanks again robert1968
JG
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: mplaw...@gmail.com
A couple of recommendations: (1) Better USB Mount in chroot Env To get access to your /dev/sd**'s, instead of mounting within the chrooted environment as suggested above (mkdir /mnt/sda1; mount /dev/sda1 /mnt/sda1), bind it from outside the chrooted environment:
Now, if you chroot into /usb/sda1/debian, your sda1 will be accessible from within /mnt/sda1. **
(2) SSH in chroot environment at boot Have the chrooted environment start-up on boot of the nas device with an sshd service running: ** Configure your chrooted /etc/ssh/sshd_config to use a port other than 22 (since the nas device is using 22) ** Create a file in your nas (which I will use to mean the "real," non-chroot environment) /etc/init.d directory called chroot-ssh-init.sh with the following contents: (assuming you put your chroot environment on sda1. Change as necessary)
** Make the file executable
** Drop out one of your services (note: this could be done prettier by modifying /usr/share/snakeos/rc.sysinit, what self-respecting computer geek uses telnet anyhow ;) ) to get this booted on startup:
** Save the configuration (SnakeOS Web GUI System -> Config -> Save Configuration ** Start it up and test it out
** Reboot the NAS device (don't pull the plug, use the GUI since it calls a reboot script that nicely shuts you down) and see that your system boots with the chrooted ssh! **
(3) Cronjobs in chroot Because the chroot env don't run init scripts, your crontab is useless. You probably could start it up in the chroot-ssh-init.sh script above. However, you could also use the crond running on your nas: **Adding lines to the /etc/cron.d/root file (assuming, again, your chroot environment is in /usb/sda1/debian):
** ** ** ** /usr/sbin/chroot /usb/sda2/debian /bin/su - someuser -c /usr/bin/flexget (Note: This assumes that you have created a user someuser in your chroot environment and you are logging in generally as root like a good computer geek... Obviously, if you are being sloppy and didn't create another user, you would not need the '/bin/su - someuser -c' portion in the line above. You probably also didn't change your sshd_config to not allow root login. Tsk tsk tsk.) ** Save your configuration! NAS Web GUI: System->Config->Save Config ** Restart your crond
**
(4) Flexget in chroot Yes, you may have noticed from the previous item that flexget works just fine. Just follow the Flexget installation instructions for Linux systems within your chroot environment. The debian port above only has python2.5, no worries - works fine.
Enjoy!
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: mplaw...@gmail.com
Sorry about the formatting of the previous post. Didn't go as I expected. I hope you get the gist.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: ols...@gmail.com
Hello,
Can use usb/sda6 instead of usb/sda1 ? I have the first partition busy with storage, and sometime before I left sda6 for this purpose.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: joakim.b...@gmail.com
Cant get SSH to work in chroot. My chroot-ssh-init.sh file looks like this:
export CHROOTDIR=/usb/sda1/debian mount -t devpts devpts $CHROOTDIR/dev/pts mount -t proc proc $CHROOTDIR/proc mount -o bind /usb/sda1 $CHROOTDIR/mnt/sda2 chroot $CHROOTDIR /etc/init.d/ssh start
The "ssh start" line wont be executed until I exit chroot.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: joakim.b...@gmail.com
crappy formating. Trying again:
export CHROOTDIR=/usb/sda1/debian
mount -t devpts devpts $CHROOTDIR/dev/pts
mount -t proc proc $CHROOTDIR/proc
mount -o bind /usb/sda1 $CHROOTDIR/mnt/sda2
chroot $CHROOTDIR
/etc/init.d/ssh start
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: joakim.b...@gmail.com
Seems the problem was with formating all along.
The last line is supose to be like this:
chroot $CHROOTDIR /etc/init.d/ssh start
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: rosanec...@gmail.com
I'm able to successfully installed GCC package, but can't install libc6-dev package. apt-get keeps saying:
Err http://security.debian.org stable/updates/main linux-libc-dev 2.6.26-1lenny4
Failed to fetch http://security.debian.org/pool/updates/main/l/linux-2.6/linux-libc-dev_2.6.26-21lenny4_arm.deb 404 Not Found [IP: 195.20.242.89 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Can anyone help me?
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: ols...@gmail.com
Hello
I want to thank all that are working in development software for this reborn device, also all others like me that share their experiences.
I cannot modify the rc.sysinit even as root file because it is read-only file system. how do you passed this barrier ?
thanks in advance
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: mike....@gmail.com
I couldn't get the whole telnet thing working correctly with the whole rename-the telnet daemon & replace thing due to the whole "webstatus()" call within the telnet script. So i ended up doing a slight kludge and just editing the original telnet script to add the required lines in the startup script for telnet
within start()
/usr/sbin/telnetd &
lets get ssh start in chroot working
export CHROOTDIR=/usb/sda1/debian
mount -t devpts devpts $CHROOTDIR/dev/pts
mount -t proc proc $CHROOTDIR/proc
mount -o bind /usb/sda1 $CHROOTDIR/mnt/sda2
chroot $CHROOTDIR /etc/init.d/ssh start
within stop()
lets get ssh stop in chroot working
export CHROOTDIR=/usb/sda1/debian
mount -t devpts devpts $CHROOTDIR/dev/pts
mount -t proc proc $CHROOTDIR/proc
mount -o bind /usb/sda1 $CHROOTDIR/mnt/sda2
chroot $CHROOTDIR /etc/init.d/ssh stop
pkill -f -9 "telnetd"
I know it may be a bit redundant and is continually calling mount excessively, but i have managed to get it to work with the stop/start/restart buttons, so I'm pretty happy with that.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: Jenssond...@gmail.com
Thanks for providing this, but HOW ON EARTH to install plowdown... No problem to download the package. I unpacked it through winrar and put the files on /sda1
Then what ?
Documentation is WONDERFUL then idiots like me ALSO got a chance.....
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: nileshme...@gmail.com
From memory I did somthing like below to get it installed. Hopefully I haven't missed any steps.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: duncanb...@gmail.com
Nice work all - I'm happily running a chrooted SSH on my box now thanks to all the comments above.
I found that because my disk was formatted in NTFS (yeah, I know, bad performance etc but I've got too much on the disk already to muck about reformatting), I had permissions problems if I just extracted debian.tgz to the filesystem.
My solution: I created a 1G loopback ext2 filesystem and extracted debian onto that, dropped the file onto my NTFS filesystem and used a loopback mount command to run.
Creating the loopback filesystem:
Then I created a debian mountpoint in the root of my NTFS, and replaced /etc/init.d/telnet on the NS-K330 with:
and saved the config.
Seems to work like a charm. Again, some of this is a bit crude, but hey...
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: rde...@gmail.com
Can I install transmission on the chroot? I think that it may be easy this way. So would I need to download the source and compile it? Or can I just install an .deb package of transmission?
I need this because the private tracker that I use, doesn't accept older versions than 1.93 and the default on Snake OS is 1.92
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: mthandre...@gmail.com
Can there be install surveillance software for IP Cam on the device? I need a program where you can config one or more ip cam, so the stream image / video will be saved.
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: yk4...@gmail.com
You can have an updated debian system if you already have a debian installation ( the old chrooted one, installed on your computer, VM etc . ) cd to the media where you want it and do :
apt-get install cdebootstrap
cdebootstrap -aarm lenny lenny ftp://ftp.us.debian.org/debian
then mount dev, proc ... etc. I've done it and it run very stable.
Btw for macs users, you can have netatalk and avahi installed within the debian chroot, and use your device as a afp server ( more stable and fast than samba on macs ) and as a unofficial time capsule( it should work, not tested ).
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: kinh.d...@gmail.com
Is it possible to run GeexBox? or some other upnp / dlna software with this?
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: ferris.w...@gmail.com
Hi,
I'd like to be able to compile and install stuff myself, much like the questions above. This is all very exciting, but I don't know much about how to proceed in this environment, so I'd like to ask some questions:
- I have successfully installed the chroot described above, I can use apt-get to get some apps, make them etc. I tried to compile a device driver (I suppose it means it will be compiled as a kernel module), but get this response:
Updating/Creating .config Preparing to compile for kernel version 2.6.16 File not found: /lib/modules/2.6.16-gazineu/build/.config at ./scripts/make_kconfig.pl line 32, <IN> line 4. make1?: ** No rule to make target
.myconfig', needed byconfig-compat.h'. Stop. **So I guess the .config file is required to compile a kernel module/device driver, right? How could I get it? I suppose this would not be the last obstacle in building a kernel module - would I need something else and how could I get it?
- In general, am I supposed to compile, install AND run the apps in the chroot, or could I just use it as a compilation environment and maybe install and run the apps on the "regular environment"?
- Related to the previous question: could I have a cross-compilation environment on a Linux PC, to compile apps to run on the SnakeOS host? How could this be achieved?
I'm sorry there's a lot of questions, probably some stupid ones too. Any answers or pointers to educational material around these issues would be greatly appreciated!
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: duncanb...@gmail.com
@kinh.dinh: upnp/dlna - Once you have the chrooted debian, you can install mediatomb. It's a bit heavy though, and you may find that the slim resources offered by the nas box get exhausted pretty quick. I had it running successfully briefly, streaming to my LG PVR just fine, but it clogged everything else up, so I turned it back off. I'm sure there's a lighter option out there somewhere...
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: wellum...@gmail.com
Hi!
Got the chroot working and ssh too. Now I'm trying to get this box working a squid-proxy, but I can't use iptables at all. I need to use it in my transparent proxy setup.
I could also install it to the nas side, but that doesn't work either :(
I have mounted lib/modules /usb/sda2/debian/lib/modules but still getting errors on chroot side.
Any help you can give me?
These are the errors on chroot-system
nas:~# iptables -L FATAL: Module ip_tables not found. iptables v1.4.2: can't initialize iptables table `filter': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. nas:~# depmod -a FATAL: Could not open /lib/modules/2.6.16-gazineu/modules.dep.temp for writing: Read-only file system nas:~# insmod ip_tables insmod: can't read 'ip_tables': No such file or directory nas:~#
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: pinguin...@gmail.com
Hi all .
Server wlx652.discoversweb.com to dead . New online after one month . Another one . Problems we have changed .
Please it uses http://wlx652.com or http://wlx652.byethost24.com/index.php?topic=80.0
To feel much this change . Thanks you by its understanding . To this we dedicated it space to all you . http://wlx652.com as new redirecting server .
Bests regards . pinguino7 :)
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: payte...@gmail.com
Hi All, Just bought a NS-K330. Switched to Snake-OS 1.2.0-20100621-from-original which worked without any problems. Then used these instructions to chroot to debian. I keep getting the same error each time I tar -xvf debian.tgz. The message tar: can't open 'debian/usr/share/man/man3/Term::ReadKey?.3pm.gz': Invalid argument
I have deleted the debian directory and re-downloaded debian.tgz twice now with no difference. Same exact error message.
Any ideas?
Best Regards
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: taoloo...@gmail.com
Hi
i update my nas 652 with last version of snake os from original .
All worked perfect before i change the http port from 80 to 110.
After this i reboot my NAS, and never refresh the page.
My NAS has a current ip 192.168.1.10 , responde as ping , but http page doesnt start, i can not acces via internet explorer. it can connect with putty but after connection i don't know what can i do. Please help me. Thanks a lot
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: masharp...@gmail.com
@taoloo897 This may seem basic but you are putting the new port number after the ip address into internet explorer? eg 192.168.1.10:110
Last edit: Anonymous 2017-12-11