Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Thu Apr 19, 2018 8:26 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jun 26, 2014 10:58 am 
Offline
Total Newbie

Joined: Thu Jun 26, 2014 10:17 am
Posts: 1
Hello !

I'm new on the forum (and i'm french too, so sorry for my bad english) and i have found a tutorial to chroot debian on Linkstation !

1st : You must have a Linux Installation on your PC (debian on virtual box is good)

On your PC, open a terminal and type :
Code:
sudo apt-get install debootstrap
mkdir sdebian
sudo debootstrap --foreign --arch armel wheezy sdebian
sudo tar -cvpzf sdebian.tar.gz sdebian


Put the archive on your Linkstation and connect it via SSH

Extract the archive anywhere (and adapt the script below) :
Code:
tar -xvpzf sdebian.tar.gz


2nd : Then, create a script called chroot.sh and type that :
Code:
CHROOT=[CHROOT REPERTORY, In my case "/mnt/disk1/sdebian/"]
mount -o bind /dev $CHROOT/dev
mount -o bind /proc $CHROOT/proc
mount -o bind /dev/pts $CHROOT/dev/pts
mount -o bind /sys $CHROOT/sys

cp /etc/resolv.conf $CHROOT/etc/resolv.conf

chroot $CHROOT /bin/bash


Then, make it executable :
Code:
chmod +x chmod.sh


And execute it as root !
Code:
sh chroot.sh


3rd : But it's not finish, we have to finalize the installation :
Code:
/debootstrap/debootstrap --second-stage

It's long if you have a slow Linkstation, like me.

Then, generate a sources.list :
http://debgen.simplylinux.ch/

And update your debian :
Code:
apt-get update
apt-get upgrade


Don't forget to add an user !
Code:
adduser [YOUR NAME HERE]


4rd: After the installation, install packages and configure some permissions :
Code:
chmod 777 /tmp
chmod +t /tmp


Code:
apt-get install openssh-server htop most uptimed screen irssi


To start your Debian at startup of your NAS, do that (Not in the CHROOT !) :
Code:
cd /etc/rc.d/
touch S99zchrootDebian.sh
chmod 755 S99zchrootDebian.sh
chmod +x S99zchrootDebian.sh
nano S99zchrootDebian.sh


And type that in the file :
Code:
#!/bin/sh
#
# Define where is the chroot on filesystem
CHROOT=[CHROOT REPERTORY, In my case "/mnt/disk1/sdebian/"]
# local necessary
mount -o bind /dev $CHROOT/dev
mount -o bind /proc $CHROOT/proc
mount -o bind /dev/pts $CHROOT/dev/pts
mount -o bind /sys $CHROOT/sys
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
cp /etc/hosts $CHROOT/etc/hosts
# Start Services, you want …
chroot $CHROOT /etc/init.d/rsyslog start
chroot $CHROOT /etc/init.d/mtab.sh start
#chroot $CHROOT /etc/init.d/cron start
#chroot $CHROOT /etc/init.d/ssh start
chroot $CHROOT /etc/init.d/uptimed start

And you have to think to edit the file for add services that you have added on your Debian.

Contragulations ! You have Debian on your NAS !

The source (in french, like me) : http://pellelatarte.fr/2011/06/nas-syno ... -et-mysql/

Normaly, it's for a Synology NAS, but i have a little adaptated it.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited