Chi l'avrebbe mai detto che avremmo visto Bill Gates suonare assieme a Slash?

Quando sarò un chitarrista famoso mi farò fotografare con un pinguino di 1 metro e 70... :)
aufs
al posto di unionfs
.
Device Drivers --->
Block Devices --->
<M> Loopback device support
File systems --->
Miscellaneous Filesystems --->
<M> SquashFS
loop
squashfs
/etc/modules.autoload.d/kernel-2.6
. emerge -av sys-fs/squashfs-tools
sys-fs/aufs
si può trovare nel layer sunrise. Tuttavia la compilazione potrebbe fallire a seconda del kernel che viene usato; se avete tale tipo di problema potete provare a prelevare la versione più recente (ad esempio da http://dev.gentooexperimental.org/~tommy/) e compilarla a mano con i soliti comandi make
e make install
. Verrà così compilato e installato il modulo aufs
.modprobe squashfs
modprobe aufs
modprobe loop
aufs
al file /etc/modules.autoload.d/kernel-2.6
./etc/make.conf
le variabili d'ambiente necessarie:
PORTDIR = "/usr/portage"
DISTDIR = "/var/distfiles"
PORTDIR
in effetti punta alla posizione di default, che è la stessa posizione nella quale verrà montata l'immagine compressa. Ovviamente può essere sostituita con il path che si desidera, a patto di modificare anche i successivi script.DISTDIR
in quanto ci permette di spostare la directory dei pacchetti scaricati al di fuori dell'albero di portage, in modo da non includerla nell'immagine compressa. Anche qui possiamo farla puntare al path che più ci piace.mkdir /var/portage
mksquashfs /usr/portage /var/portage/portage-current.sqfs -check_data
ln -sf /var/portage/portage-current.sqfs /var/portage/portage.sqfs
rm -rf /usr/portage/*
/etc/conf.d/squash_portage
contenente il seguente codice:# /etc/conf.d/squash_portage
# SQFS_DIRNAME points to the directory that will contain the sqfs
# images, recommended value is /var/tmp
SQFS_DIRNAME="/var/portage"
# Leave PORTAGE_RW empty for use with tmpfs, a ram-based filesystem,
# This is recommended unless you are short of RAM
PORTAGE_RW=""
emerge --sync
./etc/init.d/squash_portage
come da me modificato:
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# /etc/init.d/squash_portage allows efficient compression of
# Gentoo portage arborescence
#
# It requires support for the loop device and squashfs enabled in the kernel,
# module autoloading is also *highly* recommended.
# sys-fs/squashfs and sys-fs/unionfs are necessary for read-write support.
#
# Author: Mathias Laurin
# 2006-11-28, v.0.1.5(4)
source /etc/make.globals
SQFS_CUR="$SQFS_DIRNAME/portage.sqfs"
SQFS_NEW="$SQFS_DIRNAME/portage-current.sqfs"
SQFS_OLD="$SQFS_DIRNAME/portage-old.sqfs"
DEF_RW="/dev/shm/.portage-rw"
depend() {
need localmount
}
start() {
ebegin "Mounting read-only squashfs image"
mount -rt squashfs -o loop,nodev,noexec $SQFS_CUR $PORTDIR
retval=$?
eend $retval
[ $retval -ne 0 ] && return $retval
ebegin "Mounting read-write with unionfs"
if [ ! $PORTAGE_RW ]
then
einfo " mounted in tmpfs (RAM)"
PORTAGE_RW="${DEF_RW}"
fi
[ -d $PORTAGE_RW ] || mkdir -p $PORTAGE_RW
chmod 0750 $PORTAGE_RW
chown portage:portage $PORTAGE_RW
mount -t aufs -o nodev,noexec,dirs=$PORTAGE_RW=rw:$PORTDIR=ro aufs $PORTDIR
eend $?
}
stop() {
ebegin "Unmounting the tree"
umount -t aufs $PORTDIR
umount -t squashfs $PORTDIR
rm -rf $PORTAGE_RW
eend 0
}
#!/bin/bash
source /etc/make.globals
SQFS_DIRNAME="/var/portage"
SQFS_CUR="$SQFS_DIRNAME/portage.sqfs"
SQFS_NEW="$SQFS_DIRNAME/portage-current.sqfs"
SQFS_OLD="$SQFS_DIRNAME/portage-old.sqfs"
DEF_RW="/dev/shm/.portage-rw"
echo "Updating portage tree"
[ ! $PORTAGE_RW ] && PORTAGE_RW="${DEF_RW}"
if [ ! -z `ls -A $PORTAGE_RW | head -n1` ]
then
echo " Syncing the tree"
emerge --sync
mv -f $SQFS_NEW $SQFS_OLD
mksquashfs $PORTDIR $SQFS_NEW -no-duplicates 2>/dev/null
ln -sf $SQFS_NEW $SQFS_CUR
else
echo " Nothing to do"
fi
rc-update add squash_portage boot
echo "My Internet IP is: "`wget -qO- http://checkip.dyndns.org/ | sed 's|.* \([[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\).*|\1|'`
from=xxx@gmail.com
to=xxx@gmail.com
tmp=/tmp/ipmail
rm $tmp
touch $tmp && chmod 600 $tmp
text=`wget -qO- http://checkip.dyndns.org/ | sed 's|.* \([[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\).*|\1|'`
echo "Current IP: $text"
echo "Subject: My IP" >> $tmp
echo -e ${text} >> $tmp
/usr/sbin/sendmail -f $from $to < $tmp
rdate -s ntp0.cornell.edu
clocksync.sh
) e schedularlo in crontab.
today=$(date)
log=/var/log/gmailbackup.log
echo $today >> $log
to=xxx@gmail.com
from=xxx@gmail.com
rm -rf /tmp/gmailbackup
mkdir /tmp/gmailbackup
/opt/rar/bin/rar a -ol -m5 -ap -r -v7000k /home/xxx >> $log
cd /tmp/gmailbackup
files=$(ls *.rar)
for x in $files
do
sendEmail -f $from -t $to -u "gentoo-backup-$today" -m "Backup executed on $today" -a $x >> $log
done