Hi,
I actually did get it working on feisty yesterday, and have been using
it
quite a bit since and haven't noticed any major problems. I also kept
a rough log as I was going along. I'll attach it, but I apologize
that
I won't have any time to edit it for a couple of days. Its pretty
rough now
and has one or two false starts, and I wouldn't be surprised if I've
forgotten
to log one or two things, but here it is:
Installing sage chroot on stub, April 22, 2008:
==============================================
from
http://www.sagemath.org/doc/html/inst/node10.html
cd /files
dd if=/dev/zero of=/sage_chroot.image bs=1024 count=10000000
mke2fs -j sage_chroot.image
sudo vim /etc/fstab
/sage_chroot.image /sage_chroot ext3 bind 0 0
sudo mount -a
didn't work ("mount: Not a directory"). instead do:
cd /files
mkdir sage_chroot
mount -t ext3 -o loop sage_chroot.image sage_chroot
adduser sageserver
Now from
https://wiki.ubuntu.com/DebootstrapChroot
Getting and installing debootstrap
wget
http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.7~feisty1_all.deb
dpkg --install debootstrap_1.0.7~feisty1_all.deb
Installing and configuring schroot
sudo apt-get install schroot
sudo mkdir /files/sage_chroot/sage1
sudo editor /etc/schroot/schroot.conf
[sage]
description=Sage Server
location=/files/sage_chroot/sage1
priority=3
users=sageserver
groups=sageserver
root-groups=root
Setting up your chroot with debootstrap
debootstrap --variant=buildd --arch i386 feisty /files/sage_chroot/
sage1
http://archive.ubuntu.com/ubuntu/
cp /etc/resolv.conf /files/sage_chroot/sage1/etc/resolv.conf
cp /etc/apt/sources.list /files/sage_chroot/sage1/etc/apt/
## did not do sed -i s/dapper/breezy/g ...
chroot /files/sage_chroot/sage1
apt-get update
apt-get install wget debconf devscripts gnupg nano #For package-
building
apt-get update #clean the gpg error message
## apt-get install locales dialog #If you don't talk en_US
## locale-gen en_GB.UTF-8 # or your preferred locale
tzselect; TZ='Continent/Country'; export TZ
export TZ=America/Toronto in .profile
exit
If you dont want the locale warnings in your chroot add export
LANG=C to your ~/.bashrc
Getting stuff(X/ssh-agent/ect,dbus,mounting removables,modprobe,err
stuff) working automagicaly
This stuff didn't seem to make sense to me, so I didn't do it.
Back to
http://www.sagemath.org/doc/html/inst/node10.html
> Our solution is to simply use /sage_chroot/home/server as the home directory, mounting it to /home/server. First we copy the home directory's contents the chroot filesystem:
> $ sudo cp -rpvf /home/server /sage_chroot/home/
> $ sudo rm -rf /home/server/*
>
> And again we edit the system fstab
> $ vim /etc/fstab
>
> and add the following lines:
> /tmp /sage_chroot/tmp none bind 0 0
> /dev /sage_chroot/dev none bind 0 0
> /sage_chroot/home/server /home/server none bind 0 0
> proc-chroot /sage_chroot/proc proc defaults 0 0
> devpts-chroot /sage_chroot/dev/pts devpts defaults 0 0
This didn't make much sense either. Its not clear why
/tmp and /dev have to be shared between chrooted and
non-chrooted environsments.
Instead, I did this to ensure the /home/sageserver was the same
in both non-chroot and chroot
chroot /files/sage_chroot/sage1
apt-get install adduser
adduser sageserver
exit
use emacs, pwconv to ensure that uid and gid for sageserver
is the same in both /etc and /files/sage_chroot/sage1/etc,
then:
on non-chroot:
rm -r /home/sageserver
mkdir /home/sageserver
mount --rbind /files/sage_chroot/sage1/home/sageserver /home/
sageserver
chroot /files/sage_chroot/sage1
apt-get install octave octave-forge octave2.9 octave2.9-forge
apt-get install gap-core ssh
su - sageserver
cd ~
wget
http://www.sagemath.org/dist/src/sage-2.10.4.tar
tar xf sage-2.10.4.tar
mv sage-2.10.4 sage
exit # sageserver
exit # chroot
Now drop back to build from the non-chroot env
su - sageserver
cd ~
cd sage
time make
make clean
But, I couldn't get sage to run properly, so in unchrooted /etc/fstab
I have
/tmp /files/sage_chroot/sage1/tmp none bind 0 0
/dev /files/sage_chroot/sage1/dev none bind 0 0
/files/sage_chroot/sage1/home/sageserver /home/sageserver none bind
0 0
proc-chroot /files/sage_chroot/sage1/proc proc defaults 0 0
devpts-chroot /files/sage_chroot/sage1/dev/pts devpts defaults 0 0
mount -a
then
su
su - sageserver
schroot -c sage
seems to work