What's new

[HOW-TO] install Debian Squeeze

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

A dumb question maybe: is it possible the virtualized environment (Debian in this case) could see the host mount? Let me explain better: if I install and the start transmission on Debian setup, may I download my file on the /mnt/sda1/Downloads folder outside the debian environment (i.e. Debian Environment is placed on /mnt/sda1/Debian)?

Thanks in advance for your reply
 
A dumb question maybe: is it possible the virtualized environment (Debian in this case) could see the host mount? Let me explain better: if I install and the start transmission on Debian setup, may I download my file on the /mnt/sda1/Downloads folder outside the debian environment (i.e. Debian Environment is placed on /mnt/sda1/Debian)?

Thanks in advance for your reply

Sure, just change the extdir path in /opt/etc/init.d/S99debian
Code:
EXT_DIR=/tmp/mnt/sda1/xxxxx
And inside debian, change transmission download path to /mnt/xxxxx
 
A dumb question maybe: is it possible the virtualized environment (Debian in this case) could see the host mount? Let me explain better: if I install and the start transmission on Debian setup, may I download my file on the /mnt/sda1/Downloads folder outside the debian environment (i.e. Debian Environment is placed on /mnt/sda1/Debian)?

Thanks in advance for your reply

I have an entry in my startup script:

Code:
MYROUTER=$(nvram get computer_name)

EXT_DIR="/tmp/mnt/$MYROUTER"
CHROOT_DIR="/tmp/mnt/$MYROUTER/debian"


logger -t "($(basename $0))" $$ Debian external mapping: $EXT_DIR ....
mount -o bind $EXT_DIR $CHROOT_DIR/mnt

Regards,
 
Thanks for your reply but inside the debian environment (chroot /mnt/.../debian /bin/bash), I'm not able to point to my host environment mount (for example /mnt/.../Downloads), instead the /mnt/ and /tmp/ folders are empty: what am I doing wrong?
 
Dear Xerxist:
Can you share me how to get owncloud work on your builded debian wheezy?step by step tutorial is best,Thank you.
My router is ac68u.
A new version I've been building for the AC68/AC56 (ARM)

What's been done :

- Full Base of "Wheezy" (instead of minimal)
- Repository added
- resolve.conf using 8.8.8.8
- mc included
- Cleaned installed deb's after debootstrap second stage
- "Colors" so ls is showing differences for folder executables etc.. and MC in color and mouse support + key mappings.

https://www.dropbox.com/s/f8es9x1x6zuekgm/debian-wheezy-fullbase-arm.tgz
 
Last edited:
I'm on holiday at the moment but will be back in 3 days. It's not so hard to install and I have some quick notes i made to install it. Will post it later on.

Sent from my GT-I9505 using Tapatalk
 
Alright as promised.
This is a quick write up and should get you going.
Be sure not to have anything running on port 443 if you are going to just copy and paste.

(note this doesn't automatically start after a reboot a need some time to figure out how to do this with the stock firmware and the optware you can install via installing download manager)

Go into the Debian environment with chroot.

Install the following packages

Code:
apt-get install bzip2
apt-get install wget
apt-get install php5-cgi
apt-get install sqlite
apt-get install lighttpd
apt-get install php5-sqlite
apt-get install php5-gd
apt-get install openssl

Adjust the memory usage of php adjust the following lines

Code:
nano /etc/php5/cgi/php.ini

Code:
upload_max_filesize = 4000M
post_max_size = 4000M
memory_limit = 32M



Get OwnCloud (I've used 5 here as is a little bit less of a memory hog but 6 works too)

Code:
cd /var/www
rm index.lighttpd.html
wget http://download.owncloud.org/community/owncloud-5.0.14a.tar.bz2
bzip2 -cd owncloud-5.0.14a.tar.bz2 | tar -xv
chown -R www-data:www-data /var/www/owncloud

Generate the ssl certificates

Code:
cd /etc/lighttpd
mkdir certs
cd certs
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
chmod 400 lighttpd.pem


Adjust lighttpd for Owncloud and php to work

Code:
cd /etc/lighttpd/
nano lighttpd.conf


Code:
server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
        "mod_fastcgi",
)

server.document-root        = "/var/www/owncloud"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 6897


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
fastcgi.server = (
  ".php" =>
    ( "localhost" =>
      ( "socket" => "/tmp/php-fcgi.sock",
        "bin-path" => "/usr/bin/php5-cgi",
        "max-procs" => 1,
        "bin-environment" =>
          ( "PHP_FCGI_CHILDREN" => "2",
            "PHP_FCGI_MAX_REQUESTS" => "1000"
          )
        )
     )
 )

$HTTP["url"] =~ "^/data/" {
  url.access-deny = ("")
}

$HTTP["url"] =~ "^/($|/)" {
  dir-listing.activate = "disable"
}

$SERVER["socket"] == ":443" {
  ssl.engine = "enable" 
  ssl.pemfile = "/etc/lighttpd/certs/lighttpd.pem" 
}

Restart lighttpd

Code:
service lighttpd stop
service lighttpd start

For Email from OwnCloud

Add the following lines

Code:
nano /var/www/owncloud/config/config.php

Code:
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'yoursmtpserver',
  'mail_smtpport' => 587,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => true,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => 'email@email.com',
  'mail_smtppassword' => 'yourpassword',
  'mail_smtptimeout' => 10,

Now open up your browser and goto https://yourroutersip

If you want to access OwnCloud also from the internet

Run the following command when you exit the Debian evironment.
Code:
iptables -I INPUT -p tcp --dport 443 -j ACCEPT

When you restarted the router and you want to start it again.

Chroot into the debian environment and type.

Code:
service lighttpd start
 
Hi all,

just started my endeavor with a AC68U and got really existed when I found this thread.

I am planning on running a tinyproxy in debian chroot.
The basic setup/chroot is ready, but I have a problem understanding on how
to employ the S99-start/stop script.

...do I need optware installed in order to get it to work?
Are there any other options? AFAIU, entware is not an option for the AC68U, isn't it?
 
There is no entware for the RT-AC68U or AC56. You can get optware installed.

The way todo this is by installing download master from the webinterface and you can remove it after. This gives you optware from the shell. It also gives you these scripting options like you want to do but i haven't got that far yet.

Sent from my GT-I9505 using Tapatalk
 
Thank you Xerxist, for the fast response.

...so I gather there is no other way, besides introducing a self-made script in /jffs/scripts maybe.
I would love to keep out anything unnecessary in order to keep space and memory for the useful things.
 
Dear Xerxist,I need you help me again.
How can I get lighttpd service automatic start when router restarted?I tried S99debian script(just edited path to debian only),it is not working .
When you restarted the router and you want to start it again.

Chroot into the debian environment and type.

Code:
service lighttpd start
 
Thank you Xerxist, for the fast response.

...so I gather there is no other way, besides introducing a self-made script in /jffs/scripts maybe.
I would love to keep out anything unnecessary in order to keep space and memory for the useful things.

You won't have that much extra overhead as you will remove download master right after. Let me check in the morning how this is done again as I've played with thid before. Should be a matter of adding a script.

Btw I'm doing this on stock firmware.


Sent from my GT-I9505 using Tapatalk
 
Last edited:
It took me some time because the scripting gets killed after chroot is ran but found out how its done.
No need for optware etc...

I also went to Merlins firmware as the scripts work from the jffs.
Not sure if it works on stock as I don't have that much time to revert back to stock and try again.

Keep in mind that I have Debian and chroot on sda1

To make services start from the Debian environment

Go to the shell

Code:
cd /jffs/scripts
vi services-start

Add the following lines

Code:
#!/bin/sh
mount -o bind /dev/ /mnt/sda1/debian/dev/
mount -o bind /proc/ /mnt/sda1/debian/proc/
mount -o bind /sys/ /mnt/sda1/debian/sys/
/mnt/sda1/utils/chroot /mnt/sda1/debian service lighttpd start

Save the file and run

Code:
chmod +x services-start

Reboot the router and in this case lighttpd is started automatically after each reboot.
 
It took me some time because the scripting gets killed after chroot is ran but found out how its done.
No need for optware etc...

I also went to Merlins firmware as the scripts work from the jffs.
Not sure if it works on stock as I don't have that much time to revert back to stock and try again.

[..]

:cool:

Let me say thank you for your support and efforts.

regards,
ford
 
@ryzhov_al
When I try to stop chrooted services I get
admin@RT-AC66U:/tmp/home/root# /opt/etc/init.d/S99debian stop
Stopping chroot'ed Debian services...
Stopping minidlna:.
umount: can't umount /tmp/mnt/sda1/debian/dev: Device or resource busy
Done.
Second time
admin@RT-AC66U:/tmp/home/root# /opt/etc/init.d/S99debian stop
Stopping chroot'ed Debian services...
Stopping minidlna: failed!
Done.
Third time
admin@RT-AC66U:/tmp/home/root# /opt/etc/init.d/S99debian stop
Chroot'ed services seems to be already stopped, exiting...
admin@RT-AC66U:/tmp/home/root#
How to add a short delay to your script until /debian/dev is unmounted?
Thanks
 
No problem. :)
Nice to see its working.

Probably have to put it in one big tutorial as now its scattered across the posts.

Sent from my GT-I9505 using Tapatalk

hi xerxist,
i tried to build a wheezy chroot with this command sudo debootstrap --arch armel --foreign --verbose wheezy chroot/wheezy ftp://ftp.debian.org/debian and i got a root file system in wheezy folder after, now im struggling on how to proceed on the second stage. i tried to mount the newly created folder as per ryzhov_al but alway got command not found error, looks like i miss the second stage procedure

finally got it, i have to run the second stage on the router :D
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top