What's new

Asus RT-AC86U and Debian Bullseye + Nextcloud

  • 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!

asus ac86u
Code:
admin@asus:/tmp/home/root# opkg update
Downloading http://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware

do you use merlin firmware?
you need install armhf - i think (not arm64)

debootstrap --arch=armhf bullseye /opt/debian/ http://ftp.debian.org/debian/

print command here
opkg list-installed

may be need install busybox
opkg install busybox
 
asus ac86u
Code:
admin@asus:/tmp/home/root# opkg update
Downloading http://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware

do you use merlin firmware?
you need install armhf - i think (not arm64)

debootstrap --arch=armhf bullseye /opt/debian/ http://ftp.debian.org/debian/

print command here
opkg list-installed

may be need install busybox
opkg install busybox

Yes, I'm running GNUton's Asus Merlin.
Installing BusyBox did the job!

Still trying to install arm64 one. But after extracting files for a while...
Code:
I: Extracting mount...
I: Extracting util-linux...
I: Extracting libxxhash0...
I: Extracting zlib1g...
W: Failure trying to run: chroot "/opt/debian" /bin/true
W: See /opt/debian/debootstrap/debootstrap.log for details

Ignored this error and moved on to the next few steps until:-
Code:
asus@ZenWiFi_XT8-6410:/tmp/home/root# debian enter
mount: /tmp/mnt/sda2/entware/debian/mnt: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
chroot: failed to run command ‘/bin/bash’: Exec format error
 
remove /opt/debian/ folder

Ummm, whole bunch of operation not permitted.

Code:
asus@ZenWiFi_XT8-6410:/tmp/mnt/sda2/entware# rm -r debian
rm: can't remove 'debian/dev/pts/0': Operation not permitted

[....]

rm: can't remove 'debian/proc/net': Operation not permitted
rm: descend into directory 'debian/proc/sys'? ^C
 
restart and try delete

or install new folder /opt/debian0

Managed to remove the old folder with debian stop .

You are right. Armhf is the one for my router. After all the stress Debian Bullseye has been installed sucessfully.
A minor error after entering debian tho.

Code:
asus@ZenWiFi_XT8-6410:/tmp/home/root# debian enter
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
root@ZenWiFi_XT8-6410:/#
I found many fixes online but not sure which one to be applied to the router environment. Any idea?
 
Hi again,

What is the correct way of mounting extra folder(s) that function(s) the same as "EXT_DIR=/tmp/mnt/sda1/Media/" in your S99debian script?

I'm asking so becoz I can use rclone to mount a webdav folder to this EXT_DIR location, but not to EXT_DIR's subfolder (Media/Subfolder). Thing mounted via rclone to its subfolder cant be seen inside chroot. It's weird I dont know why...

Thanks.
 
my script

Code:
#!/bin/sh

PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin

# Folder with Debian Jessie

CHROOT_DIR=/tmp/mnt/asus/entware/debian

# Some folder outside of sandbox,
# will be mounted to /mnt folder in Debian
# Uncommented "EXT_DIR=" line if you need to
# mount a folder inside debian (remove #)
# EXT_DIR=/tmp/mnt/sda1/Media/

EXT_DIR0=/tmp/mnt/4tb0
EXT_DIR1=/tmp/mnt/4tb1
EXT_DIR2=/tmp/mnt/4tb2

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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0
    [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1
    [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2
    
    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
    
    umount /opt/debian/dev/pts
    
    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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0       
            [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1   
            [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

        for item in $(cat $CHROOT_SERVICES_LIST); do
            chroot $CHROOT_DIR /etc/init.d/$item start
        done
    fi
}

enter() {

        [ -z "$EXT_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0       
        [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1   
        [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

    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
 
my script

Code:
#!/bin/sh

PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin

# Folder with Debian Jessie

CHROOT_DIR=/tmp/mnt/asus/entware/debian

# Some folder outside of sandbox,
# will be mounted to /mnt folder in Debian
# Uncommented "EXT_DIR=" line if you need to
# mount a folder inside debian (remove #)
# EXT_DIR=/tmp/mnt/sda1/Media/

EXT_DIR0=/tmp/mnt/4tb0
EXT_DIR1=/tmp/mnt/4tb1
EXT_DIR2=/tmp/mnt/4tb2

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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0
    [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1
    [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2
   
    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
   
    umount /opt/debian/dev/pts
   
    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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0      
            [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1  
            [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

        for item in $(cat $CHROOT_SERVICES_LIST); do
            chroot $CHROOT_DIR /etc/init.d/$item start
        done
    fi
}

enter() {

        [ -z "$EXT_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0      
        [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1  
        [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

    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
Nice script template. Works perfectly for me.
 
Your nextcloud tutorial is so great that I managed to install it flawlessly.

However, Nextcloud warns me for no memory cache being configured. Do you use such cache to enhance performance too? For me it now always takes dozen seconds to load every page of nextcloud webui.

I tried opkg install redis-cli redis-server redis-utils' (outside chroot), but I dont know how to get the redis cache server to run in background, and connect it to the php7.4. This tutorial here seems to be relevant but I cant locate the utils/redis_init_script. Or do you use APCu or memcache?

Sorry to disturb you again mate.
 
512gb ram very little for nextcloud
For redis need more memory too

redis
Code:
sudo apt -y install redis-server
redis-server -v
systemctl status redis
sudo systemctl start redis-server
sudo systemctl enable redis-server
sudo apt -y install php-redis
php --ri redis
sudo phpenmod redis
sudo vi /var/www/nextcloud/config/config.php
>>
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
     ),

sudo systemctl restart apache2 php7.4-fpm
 
Last edited:
512gb ram very little for nextcloud
For redis need more memory too

redis
Code:
sudo apt -y install redis-server
redis-server -v
systemctl status redis
sudo systemctl start redis-server
sudo systemctl enable redis-server
sudo apt -y install php-redis
php --ri redis
sudo phpenmod redis
sudo vi /var/www/nextcloud/config/config.php
>>
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
     ),

sudo systemctl restart apache2 php7.4-fpm

Yup, I think it's a very bad idea to load up another cache server imposing further workload on the poor little thing. I'll take your advice not doing it :)
 
Transmission in chroot

cat /tmp/mnt/asus/entware/etc/init.d/S99ubuntu
Code:
#!/bin/sh

PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin

# Folder with Debian Jessie

CHROOT_DIR=/tmp/mnt/asus/entware/ubuntu

# Some folder outside of sandbox,
# will be mounted to /mnt folder in Debian
# Uncommented "EXT_DIR=" line if you need to
# mount a folder inside debian (remove #)
# EXT_DIR=/tmp/mnt/sda1/Media/

EXT_DIR0=/tmp/mnt/4tb0
EXT_DIR1=/tmp/mnt/4tb1
EXT_DIR2=/tmp/mnt/4tb2

CHROOT_SERVICES_LIST=/opt/etc/chroot-services-ubuntu.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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0
    [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1
    [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2
  
    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
  
    umount /opt/ubuntu/dev/pts
  
    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_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0     
            [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1 
            [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

        for item in $(cat $CHROOT_SERVICES_LIST); do
            chroot $CHROOT_DIR /etc/init.d/$item start
        done
    fi
}

enter() {

        [ -z "$EXT_DIR0" ] || mount -o bind $EXT_DIR0 $CHROOT_DIR/mnt/4tb0     
        [ -z "$EXT_DIR1" ] || mount -o bind $EXT_DIR1 $CHROOT_DIR/mnt/4tb1 
        [ -z "$EXT_DIR2" ] || mount -o bind $EXT_DIR2 $CHROOT_DIR/mnt/4tb2

    mount -o bind /dev/ /opt/ubuntu/dev/
    mount -o bind /dev/pts /opt/ubuntu/dev/pts
    mount -o bind /proc/ /opt/ubuntu/proc/
    mount -o bind /sys/ /opt/ubuntu/sys/

    chroot /opt/ubuntu /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

cat /tmp/mnt/asus/entware/etc/chroot-services-ubuntu.list

Code:
transmission-daemon

ubuntu enter
apt install transmission-daemon

vi /etc/init.d/transmission-daemon
USER=root
 
Last edited:

Sign Up For SNBForums Daily Digest

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