How to Install Debian Wheezy - Arm

This version is for Arm routers: RT-AC56U, RT-AC68U, RT-AC87U, RT-AC3200...
Mipsel version here
I setup a chrooted Debian Wheezy where you can compile and install any package you want, of course if routers memory permit it, ex. transmission, minidlna, lighttpd, rutorrent, owncloud...

Choose only one version to install from point 1a or 1b, Optware or Entware

1a - Install NEW GENERATION OPTWARE from here, to simplify things, debian will be installed in optware-ng.arm folder, in this case is /mnt/usb_disk/optware-ng.arm

or

1b - Install NEW GENERATION ENTWARE from here, to simplify things, debian will be installed in entware-ng.arm folder, in this case is /mnt/usb_disk/entware.arm

2 - Download and extract prepared archive

cd /opt
wget -c -O debian-wheezy7.9-clean-arm.tgz http://goo.gl/7zvrqF
tar -xvzf ./debian-wheezy7.9-clean-arm.tgz

3 - Create startup script for installed services (thanks @ryzhov_al), this is usefull for minidlna, transmission or any other package...

ipkg install nano
nano /opt/etc/init.d/S99debian

Paste all this lines

#!/bin/sh
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
# Folder with Debian Wheezy
CHROOT_DIR=/tmp/mnt/sda1/entware.arm/debian
# Some folder outside of sandbox, 
# will be mounted to /mnt folder in Debian
# Uncommented next line if you need to mount a folder inside debian
# EXT_DIR=/tmp/mnt/sda1/Media
CHROOT_SERVICES_LIST=/opt/etc/chroot-services.list
if [ ! -e "$CHROOT_SERVICES_LIST" ]; then
	echo "Please, define Debian services to start in 
$CHROOT_SERVICES_LIST first!"
	echo "One service per line. Hint: this is a script names from 
Debian's /etc/init.d/"
	exit 1
fi
MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)"
start() {
	if [ $MountedDirCount -gt 0 ]; then
		echo "Chroot'ed services seems to be already started, 
exiting..."
		exit 1
	fi
	echo "Starting chroot'ed Debian services..."
	for dir in dev proc sys; do
		mount -o bind /$dir $CHROOT_DIR/$dir
	done
	[ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
	for item in $(cat $CHROOT_SERVICES_LIST); do
		chroot $CHROOT_DIR /etc/init.d/$item start
	done
	}
stop() {
	if [ $MountedDirCount -eq 0 ]; then
		echo "Chroot'ed services seems to be already stopped, 
exiting..."
		exit 1
	fi
	echo "Stopping chroot'ed Debian services..."
	for item in $(cat $CHROOT_SERVICES_LIST); do
		chroot $CHROOT_DIR /etc/init.d/$item stop
		sleep 2
	done
	mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
	}
restart() {
	if [ $MountedDirCount -eq 0 ]; then
		echo "Chroot'ed services seems to be already stopped"
		start
		else
		echo "Stopping chroot'ed Debian services..."
	for item in $(cat $CHROOT_SERVICES_LIST); do
		chroot $CHROOT_DIR /etc/init.d/$item stop
		sleep 2
	done
	mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
		echo "Restarting chroot'ed Debian services..."
	for dir in dev proc sys; do
		mount -o bind /$dir $CHROOT_DIR/$dir
	done
	[ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
	for item in $(cat $CHROOT_SERVICES_LIST); do
		chroot $CHROOT_DIR /etc/init.d/$item start
	done
	fi
	}	
enter() {
	[ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
	mount -o bind /dev/ /opt/debian/dev/
	mount -o bind /dev/pts /opt/debian/dev/pts
	mount -o bind /proc/ /opt/debian/proc/
	mount -o bind /sys/ /opt/debian/sys/
	chroot /opt/debian /bin/bash
	}
status() {
	if [ $MountedDirCount -gt 0 ]; then
		echo "Chroot'ed services running..."
	else
		echo "Chroot'ed services not running!"
	fi
	}
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		restart
		;;
	enter)
		enter
		;;	
	status) status
		;;
	*)
		echo "Usage: (start|stop|restart|enter|status)"
		exit 1
		;;
esac
echo Done.
exit 0

Save with CTRL-O, press ENTER and exit nano with CTRL-X

Make script executable

chmod 755 /opt/etc/init.d/S99debian

In this script is a path EXT_DIR to your external media folder which will be mounted in debian as /mnt, default is /mnt/sda1/Media (must be a single folder not the whole partition), don't forget to uncomment if is used.

If your disk has a label change sda1 from CHROOT_DIR with your disk label, modify the script to match your settings with a text editor, use this command:

nano /opt/etc/init.d/S99debian

After editing EXT_DIR and CHROOT_DIR, save settings with CTRL-O, press ENTER and exit nano with CTRL-X

4 - Create symlink to start-stop services or enter debian easier
touch /opt/etc/chroot-services.list
ln -s /opt/etc/init.d/S99debian /opt/bin/debian

Every time you want to start installed services in debian without typing long command "/opt/etc/init.d/S99debian start/stop", type only

debian start
debian stop
debian restart
debian enter
debian status

But don't forget to add services name from /opt/debian/etc/init.d/ to /opt/etc/chroot-services.list

5 - Copy hosts file to debian (usefull for some debian packages)
cp /etc/hosts /opt/debian/etc/

6 - Enter chrooted debian, you will see in terminal username will change to root@RT-AC... from admin@RT-AC... or other name if changed previously in router menu (all terminals commands with purple border are inside debian)

debian enter

7 - Run update to see if some recent packages are available

apt-get update && apt-get upgrade -y

8 - Set your country time zone

dpkg-reconfigure tzdata

9 - Install some packages, ex. wget

apt-get install wget

Now you have a full Debian distro and may install any package from here but first we need a swap file
10 - To exit chrooted debian just type exit

exit

11 - Create SWAP FILE, it's a must (In Optware-NG is created automatically)

cd /opt
dd if=/dev/zero of=swap bs=1024 count=524288
mkswap swap
chmod 0600 swap
swapon swap

To enable swap file when router booting, create /jffs/scripts/post-mount script with

nano /jffs/scripts/post-mount

Paste this lines in terminal

 #!/bin/sh

swapon /opt/swap

Save with CTRL-O / Enter / and exit with CTRL-X
To unmount swap create /jffs/scripts/services-stop script with
nano /jffs/scripts/services-stop

Paste this lines in terminal

 #!/bin/sh

swapoff /opt/swap

Save with CTRL-O / Enter / and exit with CTRL-X
Make scripts executable
chmod a+rx /jffs/scripts/*
Enjoy...

HOW TO UNINSTALL DEBIAN

It's very important to unmount external folder before removing debian, if not - all content from that directory will be deleted: movies, music files, photos...

1 - Stop debian and unmount external folder
debian stop
2 - Remove entire debian directory
rm -r /opt/debian
3 - Remove startup script
rm /opt/etc/init.d/S99debian
rm /opt/bin/debian
4 - Reboot router
reboot

HOW TO BACKUP-RESTORE DEBIAN

After installing a lot of packages, it's better to make a backup, if something goes wrong just restore it without reconfigure all off your work.

   It's very important to unmount external folder before backing up debian, if not - all content from that directory will be included in archive and may become huge...

Stop debian and unmount external folder
debian stop
BackUp debian
cd /opt
tar -cvzf ./chosen_debian_name.tgz ./debian/
Restore debian when needed
cd /opt
tar -xvzf ./chosen_debian_name.tgz
  • Fabio

    Hi,
    A quick question: I cannot reach Apache from the wan (it runs in the chrooted Debian, of course). It listens on port 443 without issues if I try it from within my lan, but from internet, nothing (a port check says that the port is closed). Of course I have port forwarded the tcp 443 to 192.168.1.1 (my lan router IP). If I forward the 443 port to another pc in my lan (with apache listening on port 443) it works flawlessly.
    Any ideas?

    Thanks!

    • TeHashX
      • Fabio

        Hi, thanks for your quick reply.
        Yes, I always accessed it through https, and it didn't work. It works only from the lan.

        • TeHashX

          Type in terminal
          iptables -I INPUT -p tcp --destination-port 443 -j ACCEPT
          And try to access from wan

          • TeHashX

            I installed on my router and works just fine
            Create firewall-start script to open 4343 port
            cat >> /jffs/scripts/firewall-start << 'EOF'
            #!/bin/sh
            iptables -I INPUT -p tcp --destination-port 443 -j ACCEPT
            EOF
            chmod 777 /jffs/scripts/firewall-start
            sh /jffs/scripts/firewall-start

            Here is a very good guide for creating ssl certificates https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-debian-8

          • Fabio

            Thanks TheHashX,

            The strange thing is that I had already done it and it didn't work. Then I inserted the input rule also from inside Debian and it finally opened the port.

            Cheers!

            P.S.
            Upgraded to Jessie and it works really good. Mosquitto, Lighttpd and Mysql server with opkg, Apache2 with wsgi module, openJDK8 for the ha-bridge to work in Debian. Everything goes pretty well, I'm impressed by this little router!
            Planning to use it for TVheadend as well since the package is available for Entware, but would Merlin recognize the usb DVB-T stick?

          • TeHashX

            I'm not sure if usb drivers are included in firmware but you can compile using this guide https://www.hqt.ro/how-to-compile-modules-for-asuswrt-routers/

  • Kris

    Hi,

    I'm in step 11 - creating swap.
    When I enter : dd if=/dev/zero of=swap bs=1024 count=524288
    I get :
    dd: can't open 'swap': Text file busy

    Can You help ?

    • TeHashX

      Swap file is automatically created by installer script on both entware or optware, verify with "free" command

  • Csaba Benesch

    If I want to start debian, then -sh: debian: not found

  • David Taylor

    Why might one choose Optware-NG over Entware or vice versa? If it is purely a matter of preference, is usage of one or the other more similar to package management in RedHat, Mint, or Raspbian?

  • Benny

    I've installed Debian Wheezy chroot and can't even get it to 'apt-get install wget' after I enter the Debian chroot. When I try installing wget, I receive the following error:

    Setting up libgpg-error0:armel (1.10-3.1) ...
    Aborted
    dpkg: error processing libgpg-error0:armel (--configure):
    subprocess installed post-installation script returned error exit status 134
    dpkg: dependency problems prevent configuration of libgcrypt11:armel:
    libgcrypt11:armel depends on libgpg-error0 (>= 1.10); however:
    Package libgpg-error0:armel is not configured yet.

    I've tried 'apt-get -f install wget', 'apt-get clean' , 'dpkg --configure -a', etc. without any luck. This is true when I install any pacakge, such as transmission, and not just wget.

    • Which router, firmware?

      • Benny

        latest DD-WRT Kong build for RT-AC68U

        • My tutorials are based on Merlin firmware.
          Dd-wrt has another kernel version. Also, did you changed something in sources.list?
          Post here:
          cat /etc/apt/sources.list
          lsb_release -a
          uname -a

          • Benny

            thanks for the help. Although I had gotten it to work on my old Asus in the past, admittedly I am now actually trying to get this to work on a Netgear R7500 which runs a version of OpenWRT. I have successfully installed Entware and can chroot to Debian Wheezy, largely based on the instructions here and in this myopenrouter thread (http://www.myopenrouter.com/forum/entware-software-packages-r7500)

            # cat /etc/apt/sources.list
            deb http://ftp.debian.org/debian/ wheezy main contrib
            deb http://security.debian.org/ wheezy/updates main contrib

            # lsb_release -a
            bash: lsb_release: command not found

            # uname -a
            Linux Nighthawk 3.4.103 #1 SMP Wed Jun 24 08:36:31 EDT 2015 armv7l GNU/Linux

          • Yes, the kernel is newer 3.4.103, on asuswrt Merlin is 2.6.32
            You could try to setup a chroot from scratch:

            On a linux pc run

            apt-get install debootstrap
            cd /var/tmp
            wget -c -O prepare-arm.sh http://goo.gl/z23oTN
            chmod +x ./prepare-arm.sh
            ./prepare-arm.sh

            Copy debian-arm.tgz to your router opt directory (entware) and untar with:

            tar xvf ./debian-arm.tgz

            Enter debian and run second stage

            chroot /opt/debian /bin/bash
            /debootstrap/debootstrap --second-stage
            exit

            Create tar arxhive for future use
            tar -cvzf ./debian-chroot-full.tgz ./debian/
            Now you should have a fresh chroot working with your kernel

          • Benny

            Thanks very much for the suggestion. When I enter debian and run the second stage on the router, I get the following:

            I have no name!@Nighthawk:/# /debootstrap/debootstrap --second-stage
            I: Keyring file not available at /usr/share/keyrings/debian-archive-keyring.gpg; switching to https mirror https://mirrors.kernel.org/debian
            W: Failure trying to run: /sbin/ldconfig
            W: See //debootstrap/debootstrap.log for details
            I have no name!@Nighthawk:/# cat /debootstrap/debootstrap.log
            Aborted

          • I'm not sure but before running second-stage, check /etc/resolv.conf should be
            nameserver 8.8.8.8

          • Benny

            thanks. resolv.conf was pointing to the local host, so I changed that. But I'm still getting the same

            W: Failure trying to run: /sbin/ldconfig

          • Benny

            Is there a guide available somewhere that details the steps of creating a chroot Debian environment from scratch? Something that can help me resolve this issue. Thanks

          • You have to search on internet, there are a lot of guides, I don't know one special but you can try search first only: "chroot Keyring file not available"

  • fred1

    Great tutorial
    If you are totally bored with nothing else to do, i am trying to get syncthing to auto start (installed in debian chroot), but can't quite figure it out. If you have any suggestions that would be great
    snb post http://www.snbforums.com/threads/syncthing-ac68u.27030/
    synthing docs http://docs.syncthing.net/users/autostart.html#linux

  • Updated to Debian Wheezy v7.9
    Fixed locales error

  • Toufiq Ibna Mustafiz

    can i install plex server for arm by following this process, any luck ?

    • No, Minimum Requirements are 512mb memory :(

  • Jeremiah Blanchard

    I was able to get this working by editing sources.list and changing "ftp.ro.debian.org" to "ftp.debian.org/".

  • anthr4x

    The tutorials for debian arm have some errors when installing.. I got around debian-wheezy but unfortunately I wasn't that lucky with minidlna upnp media server. minidlna didn't run what so ever. I did re install everything again but like i said before, no luck with that.

    debian wheezy error when calling apt-get upgrade, I got a rounded by changing http://ftp.ro.debian.org/ to http://ftp.ru.debian.org/
    W: Failed to fetch http://ftp.ro.debian.org/debia... 404 Not Found
    W: Failed to fetch http://ftp.ro.debian.org/debia... 404 Not Found
    W: Failed to fetch http://ftp.ro.debian.org/debia... 404 Not Found

    When trying to install wget you also will get another error
    Depends: libgcrypt11 (>= 1.4.5) but it is not going to be installed
    Depends: libgnutls26 (>= 2.12.17-0) but it is not going to be installed
    Depends: libgpg-error0 (>= 1.10) but it is not installable
    Depends: libidn11 (>= 1.13) but it is not installable
    E: Unable to correct problems, you have held broken packages.

    Anyways is there a way you can make a tutorial for mnidlna upnp server only in entware.arm but not running debian? my router is AC87R FYI

    • Probably you isp is blocking http://ftp.ro.debian.org/
      What's wrong with minidlna from debian entware?
      To install from entware, type "opkg install minidlna"

      • anthr4x

        Minidlna is not installing wget for example. i dont think is my isp because some other ppl have claim the same problem

  • Derek

    Get:8 http://ftp.debian.org wheezy-updates/non-free Translation-en [14 B]

    Err http://ftp.ro.debian.org stable/main armel Packages

    404 Not Found

    Err http://ftp.ro.debian.org stable/contrib armel Packages

    404 Not Found

    Err http://ftp.ro.debian.org stable/non-free armel Packages

    404 Not Found

    Ign http://ftp.ro.debian.org stable/contrib Translation-en_US

    Ign http://ftp.ro.debian.org stable/contrib Translation-en

    Ign http://ftp.ro.debian.org stable/main Translation-en_US

    Ign http://ftp.ro.debian.org stable/main Translation-en

    Ign http://ftp.ro.debian.org stable/non-free Translation-en_US

    Ign http://ftp.ro.debian.org stable/non-free Translation-en

    Fetched 229 kB in 17s (13.1 kB/s)

    W: Failed to fetch http://ftp.ro.debian.org/debian/dists/stable/main/binary-armel/Packages 404 Not Found

    W: Failed to fetch http://ftp.ro.debian.org/debian/dists/stable/contrib/binary-armel/Packages 404 Not Found

    W: Failed to fetch http://ftp.ro.debian.org/debian/dists/stable/non-free/binary-armel/Packages 404 Not Found

    E: Some index files failed to download. They have been ignored, or old ones used instead.

    Threr're some error during apt-get update.

    I already installed entware-arm in my asus RC-56u.
    Please check this error.

  • Василий Нуштакин

    backup debian:
    #debian stop
    Stopping chroot'ed Debian services...
    umount: can't forcibly umount /tmp/mnt/sda1/entware.arm/debian/dev/pts: No such file or directory
    it's a critical mistake?

    • No, reboot router and try again

  • Василий Нуштакин

    Help me please:
    root@ASUSHOME:/# apt-get install wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    The following packages have unmet dependencies:
    wget : Depends: libgcrypt11 (>= 1.4.5) but it is not going to be installed
    Depends: libgnutls26 (>= 2.12.17-0) but it is not going to be installed
    Depends: libgpg-error0 (>= 1.10) but it is not installable
    Depends: libidn11 (>= 1.13) but it is not installable
    E: Unable to correct problems, you have held broken packages.

  • Denny

    I often enter within the Debian chroot and wanted to have a proper way to mount the chroot environment.
    I have modified a little bit the "enter" feature to mount the chroot environment only when something is not correctly mounted.

    enter() {
    if [ $(mount | grep $CHROOT_DIR | grep -i devtmpfs | awk '{print $3}' | wc -l) -eq 0 ]; then

    echo "devtmpfs seems to be not mounted, trying devpts"

    if [ $(mount | grep -i $CHROOT_DIR | grep -i devpts | awk '{print $3}' | wc -l) -eq 0 ]; then
    echo "devpts seems to be not mounted, mounting devpts..."
    mount -o bind /dev/pts /opt/debian/dev/pts
    else
    echo "devpts seems to be already mounted, mounting devpts"
    mount -o bind /dev /opt/debian/dev
    fi
    else
    echo "devtmpfs seems to be mounted, trying devpts"

    if [ $(mount | grep -i $CHROOT_DIR | grep -i devpts | awk '{print $3}' | wc -l) -eq 0 ]; then
    echo "devpts seems to be not mounted, mounting devpts..."
    mount -o bind /dev /opt/debian/dev
    else
    echo "devpts seems to be already mounted, nothing to do"
    fi
    fi
    if [ $(mount | grep -i $CHROOT_DIR | grep -i proc | awk '{print $3}' | wc -l) -eq 0 ]; then

    echo "proc seems to be not mounted, mounting chroot proc"
    mount -o bind /proc/ /opt/debian/proc/
    else
    echo "proc seems to be mounted, nothing to do"
    fi
    if [ $(mount | grep -i $CHROOT_DIR | grep -i sysfs | awk '{print $3}' | wc -l) -eq 0 ]; then

    echo "sys seems to be not mounted, mounting chroot sys"
    mount -o bind /sys/ /opt/debian/sys/
    else
    echo "sys seems to be mounted, nothing to do"
    fi
    #mount -o bind /dev/ /opt/debian/dev/
    #mount -o bind /dev/pts /opt/debian/dev/pts
    #mount -o bind /proc/ /opt/debian/proc/
    #mount -o bind /sys/ /opt/debian/sys/
    chroot /opt/debian /bin/bash
    }

    Hope it will be useful for some of you as well:

  • JC

    Another quick question: How can I have the 'debian enter' command execute when the router boots up? I was trying to look for whichever script calls the 'debian start' command in .../entware.arm/etc/init.d/ so that I could manually add 'debian enter' to the script, but I could not find anything. I need the mount commands in the 'enter' part if your script to run at staartup. Thanks for your help and guidance!

    • Why do you want to enter debian when router booting?
      You need to execute "debian start" to start some services from chrooted debian, which is = with: "/opt/etc/init.d/S99debian start"

      • JCG

        I have added a user account within debian which I have given SSH access, to use irssi and bitlbee etc. But the user is not able to log into the shell until I have manually executed 'debian enter' as the root user.

        • try to add "debian enter" before your script is executed

          • Denny

            This would probably not work however tweek the start command and add something like this:

            chroot /opt/debian full_path_command_script_to_be_launched

            Don't forget to correctly mount the system before launching your script

  • JCG

    I'm somewhat confused at step 4: 'But don't forget to add services name from /opt/debian/etc/init.d/ to /opt/etc/chroot-services.list'

    I wasn't sure exactly what to do here, so first I just skipped this step and continued with the instructions, but Debian wouldn't start, giving me the error: "Please, define Debian services to start in chroot-services.list". So, I tried adding all of the script filenames from /opt/debian/etc/init.d/ to this chroot-services.list file. This allowed Debian to start. But I wasn't able to exit Debian by typing 'exit' (I got an error message), so I typed 'debian stop'. I got a few error messages saying access denied when stopping some services, and then the whole router hung and became unresponsive.
    I was not able to access the router via the web interface, SSH or WLAN, even after power cycling the router several times. In the end I removed the USB stick which I had installed Entware and Debian onto, and then the router finally booted up and was operational again.
    Do you know what went wrong here, and how to avoid this happening? I don't want to re-install everything until I know what I did wrong.
    Many thanks!

    • Add only the services you want to start when router booting, in every tutorial is a service to add. When installing debian only, don't add nothing.

      • JCG

        Well, I just wanted to installed Debian only for now, so I didn't add anything, but Debian would not start. It gave the following error message: "Please, define Debian services to start in chroot-services.list".

        • JCG

          Here's what happens if I don't add anything to chroot-services.list:

          admin@RT-AC68P:/tmp/mnt/EXTREME/entware.arm# debian enter
          Please, define Debian services to start in
          /opt/etc/chroot-services.list first!
          One service per line. Hint: this is a script names from
          Debian's /etc/init.d/
          adm@RT-AC68P:/tmp/mnt/16GB/entware.arm#

          • JCG

            OK, so I was just experimenting, and noticed that the chroot-services.list file did not exist, so I did the following:

            admin@RT-AC68P:/tmp/mnt/EXTREME/entware.arm# touch /opt/etc/chroot-services.list
            Now Debian runs with no error message!

  • Gary Chu

    step 11 ln -s /opt/etc/init.d/S99debian not ln -s /opt/etc/init.d/S99debian /opt/bin/deb ^^

    • What do you mean?
      ln -s /opt/etc/init.d/S99debian /opt/bin/deb is correct

  • Baxmypka

    I apologize for my stupid question ... But that means do not forget to add services name from /opt/debian/etc/init.d/ to /opt/etc/chrooted-services.list. That is, how? )
    ** Please, define Debian services to start in /opt/etc/chroot-services.list first! One service per line. Hint: this is a script names from Debian's /etc/init.d/ **

    I just do not know)

    Thx

    • Take a look at any debian tutorial on this site and you will see startup scripts, for example: transmission installed on debian need a startup script from outside debian, this way you don't need to enter debian every time to start/stop a service.
      Services name must be added to /opt/etc/chroot-services.list

      • homer2320776

        I think that is a typo right above step 5.

        But don't forget to add services name from /opt/debian/etc/init.d/ to /opt/etc/chrooted-services.list

        It should be chroot-services.list

        • Yes, it's chroot-services.list.
          Thanks

  • CTelecom

    After long time I have just finished my Cyber-wrt Beta version for the RT-AC56U.
    If you want to get this distro and a full LAMP ready including

    - An asterisk IPBX 1.8 with an easy custom Interface and with G729 codec support ( compiled by myself ).
    - Hotel Billing dynamic IPBX interface easy to use with many functions
    - The cherry on the cake A Captive portal ready on port 4 of the router for wifi access controle with log history
    ( the captive portal is 100% reliable and original, it use IPTABLES and SQUID to work )
    Just follow this free guide (no ssh needed) :
    http://cyberhotel.comdif.com/up/asus_install.php

    here is a video of the old version on RT-N16
    ############-https://www.youtube.com/watch?v=cF5taN6Um9o-############
    Thank's for feed back

    • I saw the video, very impressive :)
      Which packages are build in that dd-wrt firmware, can work on asuswrt firmware as well?

      • CTelecom

        It can surely work on Asus firmware but I have no idea how to create a custom VLAN and a DHCP on port 4
        with Asus Firmware, this is needed for the Hotspot system and is very easy to do and save on the conf file with dd-wrt.

        • You have build some package or just a custom script? Post it here

          • CTelecom

            Nothing special I have just follow your good howto, use aptitude and only build asterisk and the hardest thing to build the G729 translation codec
            with the good cflags, it's not allowed to post this licensed codec even if not available from Digium for ARM.
            The very interesting challenge is, as you suggest to make it working on original firmware

          • CTelecom

            Also I have posted on Youtube Howto for basic first setup.

            https://www.youtube.com/watch?v=FVQiTsqKdYQ

  • George

    Thanks for your work!

    Unfortunately, I am not able to get this working on my RT-AC68U. I am struggling with step 5. After running debian I receive following error msg:
    /opt/bin/debian: line 7: chroot: not found

    This are my first 9 lines from /opt/etc/init.d/S99debian:
    #!/bin/sh

    PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
    # Folder with Debian Wheezy
    CHROOT_DIR=/tmp/mnt/sda2/asusware.arm/debian
    # CHRROOT_DIR=/mnt/sda2/asusware.arm/debian
    # Some folder outside of sandbox, will be mounted to /mnt folder in Debian
    # Leave commented if not needed
    EXT_DIR=/mnt/sda2/Data

    The following might help to narrow down the issue:

    admin@RT-AC68U:/tmp/mnt/sda2/asusware.arm# uname -a
    Linux RT-AC68U 2.6.36.4brcmarm #1 SMP PREEMPT Mon Jan 12 08:34:54 CST 2015 armv7l GNU/Linux
    admin@RT-AC68U:/tmp/mnt/sda2/asusware.arm# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/root 30080 30080 0 100% /
    devtmpfs 127736 0 127736 0% /dev
    tmpfs 127840 4692 123148 4% /tmp
    /dev/mtdblock4 64256 2060 62196 3% /jffs
    /dev/sda2 1922343760 399240 1824295064 0% /tmp/mnt/sda2
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    devtmpfs 127736 0 127736 0% /tmp/mnt/sda2/asusware.arm/debian/dev
    admin@RT-AC68U:/tmp/mnt/sda2/asusware.arm# free
    total used free shared buffers
    Mem: 255684 59308 196376 0 1488
    Swap: 0 0 0
    Total: 255684 59308 196376
    admin@RT-AC68U:/tmp/mnt/sda2/asusware.arm# mount
    rootfs on / type rootfs (rw)
    /dev/root on / type squashfs (ro,relatime)
    devtmpfs on /dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    proc on /proc type proc (rw,relatime)
    tmpfs on /tmp type tmpfs (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    devpts on /dev/pts type devpts (rw,relatime,mode=600)
    /dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
    usbfs on /proc/bus/usb type usbfs (rw,relatime)
    /dev/sda2 on /tmp/mnt/sda2 type ext4 (rw,nodev,relatime,barrier=1,stripe=8191,data=ordered)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)
    devtmpfs on /tmp/mnt/sda2/asusware.arm/debian/dev type devtmpfs (rw,relatime,size=127736k,nr_inodes=31934,mode=755)
    devpts on /tmp/mnt/sda2/asusware.arm/debian/dev/pts type devpts (rw,relatime,mode=600)
    proc on /tmp/mnt/sda2/asusware.arm/debian/proc type proc (rw,relatime)
    sysfs on /tmp/mnt/sda2/asusware.arm/debian/sys type sysfs (rw,relatime)

    Any advice would be highly appreciated.
    Thanks a lot in advance.
    Cheers,
    George

    • Why is sda2? should be sda1 if you have a single disk
      Reboot router and see again if is mounted as sda1
      CHROOT_DIR it's ok but must be sure is sda2 or sda1
      EXT_DIR=/mnt/sda2/Data
      should be
      EXT_DIR=/tmp/mnt/sda2/Data

      • George

        Thanks for your reply.
        sda1 is the swap partition.

        Just to verifiy: I am trying to install Debian on the stock Asus firmware.
        Does Debian require the Merlin firmware first and this is why my approach fails?

        • All tutorials are based on Merlin firmware

          • George

            Then it's no surprise. Thanks for clarification.
            Do I have to start from scratch or is it possible to perform the Merlin firmware installation and continue the Debian installation with step 5 since it is installed on the hard drive?

          • Should work from step 5, post errors if not.

          • George

            Yes, I can confirm it works nicely.
            Thanks a lot for your support and your straight forward how-to-guides!

  • CTelecom

    My feed back now after working since some days on this distro and comparing to optware
    - Unlike optware when you gie a path from php or other the tree start on the debian dir
    - Unlike optware router shell and debian shell are 100% separated you can't send a debian command from router shell and vice versa
    except ( it's strange but usefull ) iptables command working from Debian on router filters table
    - There is many tools missing or not available on this Debian: ifconfig, arp, ping,.. best way for me was to install busybox and make links
    Except these small details (but that gave me a headache ) this distro is working very fine on my Asus rt-ac56u with dd-wrt :-)

  • Marcus Lindén

    Got to stage 5.
    Going into debian results in this:

    admin@RT-AC68U-1FD0:/tmp/opt# debian
    /opt/bin/debian: line 3: can't fork

    No errors before this. What to do?
    RT-AC68U @ Merlin 376.49_5

    • Post here output from:
      mount
      df
      free
      cat /opt/etc/init.d/S99debian

      • Marcus Lindén

        admin@RT-AC68U-1FD0:/tmp/home/root# mount
        rootfs on / type rootfs (rw)
        /dev/root on / type squashfs (ro,relatime)
        devtmpfs on /dev type devtmpfs (rw,relatime,size=127772k,nr_inodes=31943,mode=755)
        proc on /proc type proc (rw,relatime)
        tmpfs on /tmp type tmpfs (rw,relatime)
        sysfs on /sys type sysfs (rw,relatime)
        devpts on /dev/pts type devpts (rw,relatime,mode=600)
        /dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
        usbfs on /proc/bus/usb type usbfs (rw,relatime)
        /dev/sda1 on /tmp/mnt/sda1 type tfat (rw,nodev,relatime,uid=0,gid=0,umask=0000,allow_utime=0022,codepage=437,iocharset=utf8,shortname=winnt,min_prealloc_size=64k,max_prealloc_size=2011104,readahead=1M,nocache,fail_safe,falloc_skip_zeroing,hidden=show,errors=continue)

        admin@RT-AC68U-1FD0:/tmp/home/root# df
        Filesystem 1K-blocks Used Available Use% Mounted on
        /dev/root 19584 19584 0 100% /
        devtmpfs 127772 0 127772 0% /dev
        tmpfs 127880 4464 123416 3% /tmp
        /dev/mtdblock4 97024 2432 94592 3% /jffs
        /dev/sda1 2011104 293972 1717132 15% /tmp/mnt/sda1

        admin@RT-AC68U-1FD0:/tmp/home/root# free
        total used free shared buffers
        Mem: 255760 47600 208160 0 416
        -/+ buffers: 47184 208576
        Swap: 0 0 0

        admin@RT-AC68U-1FD0:/tmp/home/root# cat /opt/etc/init.d/S99debian
        #!/bin/sh

        PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
        # Folder with Debian Wheezy
        CHROOT_DIR=/tmp/mnt/sda1/asusware.arm/debian
        # Some folder outside of sandbox, will be mounted to /mnt folder in Debian
        # Leave commented if not needed
        EXT_DIR=/tmp/mnt/sda1/Media

        CHROOT_SERVICES_LIST=/opt/etc/chroot-services.list
        if [ ! -e "$CHROOT_SERVICES_LIST" ]; then
        echo "Please, define Debian services to start in $CHROOT_SERVICES_LIST first!"
        echo "One service per line. Hint: this is a script names from Debian's /etc/init.d/"
        exit 1
        fi
        MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)"
        start() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services seems to be already started, exiting..."
        exit 1
        fi
        echo "Starting chroot'ed Debian services..."
        for dir in dev proc sys; do
        mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item start
        done
        }

        stop() {
        if [ $MountedDirCount -eq 0 ]; then
        echo "Chroot'ed services seems to be already stopped, exiting..."
        exit 1
        fi
        echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
        chroot $CHROOT_DIR /etc/init.d/$item stop
        sleep 2
        done
        mount | grep $CHROOT_DIR | awk "{print $3}" | xargs umount -l
        }

        status() {
        if [ $MountedDirCount -gt 0 ]; then
        echo "Chroot'ed services is running"
        else
        echo "Chroot'ed services is stopped"
        fi
        }

        case "$1" in
        start)
        start
        ;;
        stop)
        stop
        ;;
        restart)
        stop
        sleep 5
        start
        ;;
        status) status
        ;;
        *)
        echo "Usage: $0 (start|stop|restart|status)"
        exit 1
        ;;
        esac

        echo Done.

        • Marcus Lindén

          Tried to do it all over, but:
          admin@RT-AC68U-1FD0:/tmp/opt# wget -c -O /opt/etc/init.d/S99debian http://goo.gl
          /T8SX26
          Connecting to goo.gl (216.58.209.142:80)
          Connecting to hqt.ro (91.216.151.23:80)
          wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable
          admin@RT-AC68U-1FD0:/tmp/opt# wget -c -O /opt/etc/init.d/S99debian http://goo.gl
          /T8SX26
          Connecting to goo.gl (216.58.209.142:80)
          Connecting to hqt.ro (91.216.151.23:80)
          wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable

          • When you get Requested Range Not Satisfiable means the file is already there.

          • Marcus Lindén

            Ok, have formatted and will try again.

          • Marcus Lindén

            Sigh.

            admin@RT-AC68U-1FD0:/tmp/opt# app_base_packages.sh sda1
            /usr/sbin/app_base_packages.sh: line 5: can't fork

          • Reboot router

        • Your usb disk is formatted as fat which is windows standard.
          Now you have two choices:
          - Format entire disk to ext3, ext4
          - Create one additional partition for linux and leave second one as fat.

  • CTelecom

    Hello
    Installed on rt-ac56u with dd-wrt on /opt all is working fine after changing debian starup script with good links

    But Services in iinit.d are not starting ( webmin, apache2, .. )
    I try to put them also on chroot-services.list, not working

    If I enter in shell with debian and start them manualy it work

    what is the way to start all auto ?

    • Rename from webmin to S80webmin-debian and put the same name in chrooted-services.list

      • CTelecom

        I do it with
        S90asterisk-debian
        S80webmin-debian
        S80apache2-debian
        S70mysql-debian
        S57rsync-debian
        based on a run-level I have on my RTN16 optware
        But nothing more, also I make script on jffs/scrips/post-mount
        #!/bin/sh
        swapon /opt/swap
        sleep 30
        /opt/etc/init.d/S99debian start

        and nothing more

        • So, it's working?

          • CTelecom

            No not working :-(

            if I connect with putty and enter:
            root@DD-WRT:~# debian
            root@DD-WRT:/# /etc/init.d/S80webmin-debian start

            Webmin start fine !

          • Must be some permission error, I see you router username is root, normally should work with root to but try to change to admin.
            Try first to stop services and start again
            /opt/etc/init.d/S99debian stop
            /opt/etc/init.d/S99debian start

          • Also, what did you modified in S99debian script?

          • CTelecom

            Right, when I do /opt/etc/init.d/S99debian stop I can see the service list stop on the shell
            but it also umount my sda5 partition with Debian mounted on /opt.

            root@DD-WRT:~# /opt/etc/init.d/S99debian stop
            Stopping chroot'ed Debian services...
            Stopping Asterisk PBX: asterisk.
            Stopping Webmin server in /usr/share/webmin
            /etc/init.d/S80apache2-debian: 51: .: Can't open /etc/apache2-debian/envvars
            [ ok ] Stopping MySQL database server: mysqld.
            [ ok ] Stopping rsync daemon: rsync.
            umount: can't forcibly umount /opt/dev: No such file or directory
            umount: can't forcibly umount /opt/dev/pts: No such file or directory
            umount: can't forcibly umount /opt/proc: No such file or directory
            umount: can't forcibly umount /opt/sys: No such file or directory
            Done

            On S99debian I just change CHROOT_DIR=/opt and comment #EXT_DIR=

          • What's the error in terminal when starting? Look in router syslog.

          • CTelecom

            Right have found a solution, I use dd-wrt with auto mount USB on /opt and all my debien filesystem is on /opt
            I have removed all about mount and umount on the script and all is working fine
            Just last problem is apache2, as init script use script name as reference to find the envar so changing for s80apache2-debian is a problem

          • I'm not sure renaming is really necessary, try leaving apache2 in chrooted-services.list and init.d then stop-start debian.
            I renamed all my scripts to keep them away from optware and entware scripts :)

          • CTelecom

            You'r a man, it work, my goal is to make ready to use tar file to replace my old project on RTN-16 http://sourceforge.net/projects/hotelpbx/

  • Al

    Thanks for the guide, though some part are misterious. F.e. I have no clue how these shall be perfomed:

    In this script is a path EXT_DIR to your external media folder which will be mounted in debian as /mnt, mine is /mnt/sda1/Media (must be a single folder not the whole partition).

    If your disk has a label change sda1 from CHROOT_DIR with your disk label, modify the script to match your settings with vi or nano editor, use this command:

    nano /opt/etc/init.d/S99debian
    After editing EXT_DIR and CHROOT_DIR, save settings with CTRL-O, press ENTER and exit nano with CTRL-X

    ?????????

    • You have to chose some folder to be available inside debian, this folder will be in /debian/mnt/
      For example, if you install minidlna media server, that folder will be available for media server to be streamed over the network.
      Another example, in that folder you can download files with transmission, pyload...
      If you don't know which folder to put as EXT_DIR, sent me outputs from:

      uname -a
      df
      free
      mount

      • Al

        Thanks for help. Everything seems too complicated for me. I want to uninstall debian, but cannot do it though I definetly have installed it. Please advise if I will reflash the firmware, will everything be wiped out? I want to wipe out and get rid of any remnant debian files so thatbthe system would be clean completely. Please help.

        • Debian is installed on usb drive so a firmware reflash won't delete debian.

          HOW TO UNINSTALL DEBIAN

          It's very important to unmount external folder before removing debian, if not - all content from that directory will be deleted: movies, music files, photos...

          1 - Stop debian and unmount external folder

          /opt/etc/init.d/S99debian stop

          2 - Remove entire debian directory

          rm -r /opt/debian

          3 - Remove startup script

          rm /opt/etc/init.d/S99debian
          rm /opt/bin/debian

          3a - Remove post mount script if not used for another services

          rm /jffs/scripts/post-mount

          4 - Reboot router

          reboot

          • Al

            Thanks. When I try doing this, system says no such folder exist. I installed debian in a wrong folder and I dont know which.

            If delete all the files on external hdd via samba access, there would be no debian files anymore? I see system files via samba, but I dont see opt folder. Maybe somthing will be left on router itslef even if I reformat my hdd?

          • /opt is a symlink to entware or optware folder so you will not find opt folder on root of your usb disk.
            If you format the disk, all files will be gone, including debian :)
            Only post-mount script will remain on jffs partition, delete with:
            rm /jffs/scripts/post-mount

            reboot
            Now you are clean, install optware or entware from scratch

          • Al

            Thanks for help.

            System said no such file, when i tried to remove post mount script. Meaning i was not mounted anything.

            Thanks. Will never touch cli environment anymore:)

          • Already removed or never created.
            It's not so difficult if you use google or another search engine a little bit :)

  • Alexey Tsapko

    How to edit a script file? Replace old symbols with new?

    • No, add new text after last line, like this:
      fi
      swapon /opt/swap

      #!/bin/sh is needed only once at beginning of the script

      • Alexey Tsapko

        oh god, i delete old with new... i am stupid idiot. And every time I make a record in the script I have dobovsyat new lines?

  • Updated to Debian v7.8

  • Incognito Psytrancer

    Thank you for HOW TO UNINSTALL DEBIAN manual!!!

  • anthr4x

    Hi, I have a problem with my new router RT-AC87R after several attempts I decided to remove debian. Ok here is the why and you may give me an advice, I first started by installing debian wheezy - ARM and then follow the installation of Minidlna UPnP Media Server through debian wheezy - ARM. Everything was install without any errors. My TV a Samsung UN55HU8550 wired directly to the router and after 20min playing a movie debian will reboot. On my TV popup a msg stating "debian 1.1.4" was disconnected from my TV. I immediately checked the router and it didn't reboot. There was no media server running (debian was restarting) and yes it came back up after several minutes. I also checked syslog, their was no indication or error of minidnla.

    One more thing i notice that after installing debian, AiCloud wont load or start the sync with dropbox and wont let me mount folder "Pictures".. I ended removing debian and run the Asus Merling firmware default apps.

    Here is some info about my router.
    Linux NeXus-AC87 2.6.36.4brcmarm #1 SMP PREEMPT Fri Jan 9 00:57:53 EST 2015 armv7l GNU/Linux

    nexus@NeXus-AC87:/tmp/home/root# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/root 35840 35840 0 100% /
    devtmpfs 127768 0 127768 0% /dev
    tmpfs 127876 9348 118528 7% /tmp
    /dev/mtdblock4 64256 2080 62176 3% /jffs
    /dev/sda2 2883218720 282182748 2454576888 10% /tmp/mnt/WD3TB
    /dev/sdb2 14870912 211812 13903696 2% /tmp/mnt/FD16GB

    nexus@NeXus-AC87:/tmp/home/root# mount
    rootfs on / type rootfs (rw)
    /dev/root on / type squashfs (ro,relatime)
    devtmpfs on /dev type devtmpfs (rw,relatime,size=127768k,nr_inodes=31942,mode=755 )
    proc on /proc type proc (rw,relatime)
    tmpfs on /tmp type tmpfs (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    devpts on /dev/pts type devpts (rw,relatime,mode=600)
    /dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
    usbfs on /proc/bus/usb type usbfs (rw,relatime)
    /dev/sda2 on /tmp/mnt/WD3TB type ext3 (rw,nodev,relatime,errors=continue,user_xattr,barr ier=0,data=ordered)
    /dev/sdb2 on /tmp/mnt/FD16GB type ext4 (rw,nodev,relatime,barrier=1,data=ordered)

    nexus@NeXus-AC87:/tmp/home/root# free
    total used free shared buffers
    Mem: 255752 117060 138692 0 1488
    -/+ buffers: 115572 140180
    Swap: 524284 0 524284

    • How often is this happened, once?
      Maybe tv lost connection with router for some reason, you should check if minidlna is running by opening 192.168.1.1:8200 in browser.
      Try with a single usb disk.
      If you have issues with aicloud, add a 60 seconds delay to post-mount script:

      #!/bin/sh
      sleep 60
      /opt/etc/init.d/S99debian start

      • anthr4x

        Twice got rebooted.. and no it wasn't the TV thats when i got tired and remove debian. If their is a fix i will reintall it

        • I found something you could try, decrease notify interval in /etc/minidlna.conf to 300 or lower
          notify_interval=300

  • steef84

    Hi got an error. Does anyone know what to do to fix?
    See below. Thanks in advance

    root@RT-AC66u:/# apt-get update
    Err http://security.debian.org stable/updates Release.gpg
    Temporary failure resolving 'security.debian.org'
    Err http://ftp.fsn.hu wheezy Release.gpg
    Temporary failure resolving 'ftp.fsn.hu'
    Reading package lists... Done
    W: Failed to fetch http://ftp.fsn.hu/debian/dists/wheezy/Release.gpg Temporary failure resolving 'ftp.fsn.hu'
    W: Failed to fetch http://security.debian.org/dists/stable/updates/Release.gpg Temporary failure resolving 'security.debian.org'

    W: Some index files failed to download. They have been ignored, or old ones used instead.

    • steef84

      I just saw I posted in wrong thread. This is wheezy for arm thread, my AC66U is ofcourse mipsel. I got the mipsel image downloaded to the router so thats not the problem

      • steef84

        Ok, found my error. In my case i had to add my internal gateway ip in /etc/resolve. Not nameserver 8.8.8.8

  • TataLor

    The 'debian' script is missing the unmounting part. Running it multiple times gives a lot of multiple mount points to the same folders.

    Add :

    umount /opt/debian/dev/pts
    umount /opt/debian/dev/
    umount /opt/debian/proc/
    umount /opt/debian/sys/

    # other umounts for the mounts before chroot

    after the 'chroot...' line

    • I found another way, redownload S99debian script and try again

      • TataLor

        Yes, but the problem is still there. In S99... we have both mount and umount in start/stop. But, in 'debian', we have only mount. So, if I run S99..., I will have a pair of mounts. When I want to run a chrooted console, I execute 'debian', which executes another mount -> duplicated entries. On exit, it will not unmount the second pair. Either there is a problem in my system (i don't know what is the normal behaviour of mount -bind when called multiple times with the same parameters), or the umount has to be added in 'debian', or the mount entries have to be removed from 'debian', specifying that it is to be used after running S99... start.

        • Yes, mounts are duplicated but shouldn't be a problem, all mounts will gone if you exit debian and stop with S99debian script.
          If you want, create /opt/bin/deboff script

          #!/bin/sh
          umount /opt/debian/dev/
          umount /opt/debian/proc/
          umount /opt/debian/sys/

          After exiting debian just run "deboff"

          • TataLor

            thanks!

  • Someone is interested in Transmission v2.84 through Debian Wheezy Arm?

    • Skello

      Hi,

      I am interested in rtorrent + rutorrent through Debian Wheezy Arm. Also how can I install minidlna-1.1.4 in this clean Debian Wheezy. Your older guide for minidlna on Debian on ARM involves downloading a prepared Debian installation. If I use apt-get install minidlna on this clean install I get minidlna (1.0.24+dfsg-1) from the Debian repo.

      • Is this what are you looking for? :) https://www.hqt.ro/minidlna-upnp-media-server-through-debian-wheezy-arm/

        Maybe I will make a rutorrent debian tutorial some day, until then, use this guide http://www.adminsehow.com/2013/11/installing-rtorrentrutorrent-on-debian-7-wheezy/

        • Skello

          A note for posterity :)

          If you attempt to compile XMLRPC-C, libtorrent and rtorrent from source as per the tutorial linked above on Wheezy ARM, make sure you add the xmlrpc-c path when you configure rtorrent, like this: ./configure --with-xmlrpc-c=/usr/local/bin/xmlrpc-c-config

          Nevertheless, the configuration will likely fail with "Could not compile XMLRPC-C test"

          Looking at the configure log you will see that it actually fails with this error: undefined reference to__sync_fetch_and_and_8'

          This is because 1) the gcc compiler is too old and 2) ARM does not natively support those atomic operations. Newer gcc compiler versions have emulation for them on ARM as per this discussion here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56296

          After searching around for a solution, like this hack here http://vincesoft.blogspot.fr/2012/04/how-to-solve-undefined-reference-to.html, I found that the easiest method is described here: https://github.com/rakshasa/rtorrent/issues/156

          You need to configure libtorrent (not rtorrent) with --disable-instrumentation. If you already installed libtorrent go in the source dir, hopefully you didn't delete it, and run make uninstall. Remove the dir, unpack the source tarball again, and do ./configure --disable-instrumentation then make and make install. Then rtorrent configuration will no longer fail, given you provide --with-xmlrpc-c=/usr/local/bin/xmlrpc-c-config

          I have created libtorrent and rtorrent debs if anyone wants them, but you can make them yourself if you follow these steps and instead of make install you use checkinstall -- needs to be installed first and all dependencies.

      • Skello

        I first installed minidlna with all dependecies through apt-get install, then I followed the instructions from your previous guide -- https://www.hqt.ro/minidlna-through-debian-optware-arm/ -- under "To update from a previous version follow this steps."

        I've also run:
        wget -c -O /opt/etc/chroot-services.list http://goo.gl/gFdbdr
        chmod a+rx /opt/etc/chroot-services.list

        chroot-services.list contains an entry S98minidlna. Where do I get this minidlna start script from?

        chroot: can't execute '/etc/init.d/S98minidlna': No such file or directory

        • You mixed things, install from scratch

          exit debian
          /opt/etc/init.d/S99debian stop
          mv debian debian-old
          Now install debian and minidlna

          • Skello

            Thanks. I'll try that.

Get Email Notification When a Server or Port is Unreachable
SoftEther VPN Running on AsusWRT Routers
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Minidlna UPnP Media Server through Debian Jessie Arm
How to Mount Samba Shares inside Chrooted Debian
Spreed WebRTC server and web client
Asterisk VoIP Server running on AsusWRT Routers
Get Email Notification When a Server or Port is Unreachable
SoftEther VPN Running on AsusWRT Routers
NZBGet through Entware
Minidlna UPnP Media Server through Debian Jessie Arm

SUBSCRIBE

To be notified by email when a new tutorial is posted :)

Thanks for Subscribing! I'll keeping you up-to-date with latest tutorials!

Something went wrong, try again...