Moderator: ago

Code: Select all
USE="tmpfs resumemerge" emerge portage-bashrc-ng
non serve. le definizioni di /etc/portage si applicano paro paro anche agli ebuild prelevati dall'overlay.The_Paciugo wrote: Per l'overlay non c'è un altro package.use, o una cosa analoga?
Code: Select all
# eselect bashrc-ng disable resumemerge
Se vuoi gli aggiornamenti forse è più comodo usare l'overlay che lo sincronizzi tranquillamente tramite layman.The_Paciugo wrote:Ora per quel che riguarda gli aggiornamenti, devo controllare a mano o c'è qualcosa in portage o nel tool che controlla un'eventuale versione aggiornata?
L'unico inghippo è che unionfs ancora non è stato portato per il kernel 2.6.18 (che uso...). Ho una specie di codice con il supporto per unionfs... ma aspetto la possibilità di testarlo un attimo.Luca89 wrote:bella l'idea di comio, se portage-bashrc-ng supporterà questa cosa forse abbandonerò /var/tmp montata staticamente in ram.
Code: Select all
# tmpfs module for portage-bashrc-ng
# Distributed under the terms of the GNU General Public License v2
# $Header: /cvsroot/portage-bashrc/portage-bashrc-ng/bashrc-ng/tmpfs.module,v 1.8 2006/07/24 16:54:21 exairetos Exp $
# heavily based on portage-bashrc by Giovanni Ferri <giovanni@fonderiadigitale.it>
# first version by Ferdinando Formica <exairetos@tele2.it> 2006-06-02
# support for UnionFS by Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com> 2006-10-05
# last revision 2006-06-23
# Notice:
# Without Unionfs support, tmpfs is directly mounted on the $PORTAGE_BUILDDIR directory.
# With Unionfs support, tmpfs is mounted on $UFS_TMPFSDIR directory and "Disk" direcotory
# is mounted on $UFS_DISKDIR directory. Then union of $UFS_TMPFSDIR and $UFS_DISKDIR
# is mounted on $PORTAGE_BUILDDIR.
#########################
# Configuration section #
#########################
# set path for package.mem
MEMFILE=${ROOT}/etc/portage/package.mem
UFS_TMPFSDIR=${UNIONFS_BASETMPFSDIR}/${PF}
UFS_DISKDIR=${UNIONFS_BASEDISKDIR}/${PF}
UFS_ENABLE=${UNIONFS_ENABLE}
#####################
# General utilities #
#####################
# returns 0 if it's mounted, 1 otherwise
check_if_mounted() {
# grep it in mtab and set $mounted accordingly
mounteddir="$(mount | \
grep "none on ${PORTAGE_BUILDDIR} " 2>/dev/null | \
grep tmpfs 2>/dev/null | tail -n 1)"
[[ -z "$mounteddir" ]] && return 1
return 0
}
check_unionfs() {
unionfs_is_present="$(cat /proc/filesystems | grep unionfs)"
[[ -z "${unionfs_is_present}" ]] && return 0
return 1
}
configure_unionfs_support() {
check_unionfs
if [ $? -eq 0 ]
then
UFS_ENABLE="off"
else
if [ "${UNIONFS_ENABLE}" == "on" ]
then
UFS_ENABLE="on"
else
UFS_ENABLE="off"
fi
fi
}
####################
# Mounting section #
####################
# mount the tmpfs dir
mountfs() {
# get the dimension of the tmpfs filesystem
evaluate_mem_size
[[ "$PORTAGE_MEMSIZE" == "0" ]] && return
# let the user know what we're doing
ebegin "Mounting ${PORTAGE_BUILDDIR} of [ $PORTAGE_MEMSIZE ]"
if [ -e ${PORTAGE_BUILDDIR} -a ! -d ${PORTAGE_BUILDDIR} ]
then
ewarn "Removing the existing ${PORTAGE_BUILDDIR} as it's not a dir."
rm -f ${PORTAGE_BUILDDIR}
eend $?
fi
eend $?
if [ "${UNIONFS_ENABLE}" == "on" ]
then
check_unionfs
if [ $? -eq 1 ]
then
einfo "Unionfs support is enabled. Great!"
else
ewarn "Unionfs support is not enabled. Check that you have installed correctly the sys-fs/unionfs module."
ewarn "Continue anyway... without Unionfs support"
fi
configure_unionfs_support
fi
if [ "${UFS_ENABLE}" == "on" ]
then
# With Unionfs Support...
# ensuring all is correct
# Portage dir...
mkdir -p ${PORTAGE_BUILDDIR}
chown portage:portage ${PORTAGE_BUILDDIR}
chmod g+w,o-rwx ${PORTAGE_BUILDDIR}
# Tmpfs directory..
mkdir -p ${UFS_TMPFSDIR}
chown portage:portage ${UFS_TMPFSDIR}
chmod g+w,o-rwx ${UFS_TMPFSDIR}
# Disk directory...
mkdir -p ${UFS_DISKDIR}
chown portage:portage ${UFS_DISKDIR}
chmod g+w,o-rwx ${UFS_DISKDIR}
# mounting the tmpfs dir
/bin/mount -o size=${PORTAGE_MEMSIZE},mode=770,gid=portage -t tmpfs none ${UFS_TMPFSDIR}
mount -t unionfs -o dirs=${UFS_TMPFSDIR}:${UFS_DISKDIR} none ${PORTAGE_BUILDDIR}
else
# Without Unionfs Support...
# ensuring all is correct
mkdir -p ${PORTAGE_BUILDDIR}
chown portage:portage ${PORTAGE_BUILDDIR}
chmod g+w,o-rwx ${PORTAGE_BUILDDIR}
# mounting the tmpfs dir
debuginfo "Command line: /bin/mount -o size=${PORTAGE_MEMSIZE},mode=770,gid=portage -t tmpfs none ${PORTAGE_BUILDDIR}"
/bin/mount -o size=${PORTAGE_MEMSIZE},mode=770,gid=portage -t tmpfs none ${PORTAGE_BUILDDIR}
fi
# warn the user about ccache
isfeature ccache
if [ $itsafeature -eq 1 ]
then
ewarn "Please remember that ccache data dir is outside the newly mounted"
ewarn "portage temporary directory, to preserve the spool between merges."
fi
}
# set in PORTAGE_MEMSIZE the dimension of the tmpfs filesystem
evaluate_mem_size() {
# if $PORTAGE_MEMSIZE was defined, we have already sourced that
[[ -n "$PORTAGE_MEMSIZE" ]] && debuginfo "\$PORTAGE_MEMSIZE='$PORTAGE_MEMSIZE' defined globally"
# overwrite that if there is a per-package value
parseconffile "$MEMFILE"
if [ -n "$configval" ]
then
PORTAGE_MEMSIZE=$configval
debuginfo "\$PORTAGE_MEMSIZE='$PORTAGE_MEMSIZE' defined in $MEMFILE"
fi
# overwrite that if the user forced another value
if [ -n "$OVERRIDE_MEMSIZE" ]
then
debuginfo "Overriding \$PORTAGE_MEMSIZE with \$OVERRIDE_MEMSIZE=$OVERRIDE_MEMSIZE"
PORTAGE_MEMSIZE=$OVERRIDE_MEMSIZE
fi
# if there was no value, disable mounting
[[ -z "$PORTAGE_MEMSIZE" ]] && PORTAGE_MEMSIZE=0
}
# save a backup copy of the dir
savebackup () {
cd ${PORTAGE_BUILDDIR}/
tar zcf /tmp/BKUP_${PN}.tar.gz *
cd - &>/dev/null
}
# restore saved backup
restorebackup () {
cd ${PORTAGE_BUILDDIR}
tar zxf /tmp/BKUP_${PN}.tar.gz
rm /tmp/BKUP_${PN}.tar.gz
cd - &>/dev/null
}
######################
# Unmounting section #
######################
# unmount the tmpfs dir
unmountfs()
{
# cycle to get rid of multiple mounts (can it still happen?)
# or problematic unmountings
for ((c=0; c<10; c++))
do
check_if_mounted
if [ $? -eq 1 ]
then
rmdir ${PORTAGE_BUILDDIR}
return
fi
# let the user know what we're doing
configure_unionfs_support
ewarn "Found temporary portage compile dir (${PORTAGE_BUILDDIR}), umounting."
if [ "${UFS_ENABLE}" == "on" ]
then
# unmounting the unionfs directory
/bin/umount ${PORTAGE_BUILDDIR}
# unmounting the tmpfs directory
/bin/umount ${UFS_TMPFSDIR}
# clean ${UFS_DISKDIR}
case ${UFS_DISKDIR} in
/var/tmp/* | /tmp/* )
rm -rf --preserve-root ${UFS_DISKDIR}
;;
* )
ewarn "Directory ${UFS_DISKDIR} is not in /var/tmp or /tmp..."
;;
esac
else
# unmounting the tmpfs dir
/bin/umount ${PORTAGE_BUILDDIR}
fi
sleep 0.5
eend $?
done
ebegin "Cannot umount tmpfs, erasing contents."
# rm -rf ${PORTAGE_BUILDDIR}/*
ewarn "At this point I should remove '${PORTAGE_BUILDDIR}' but I won't :)"
eend $?
}
##############
# activation #
##############
on_setup () {
local tmpfsbasedir
check_if_mounted
if [ $? -eq 0 ]
then
configure_unionfs_support
if [ "${UFS_ENABLE}" == "on" ]
then
tmpfsbasedir=${UFS_TMPFSDIR}
else
tmpfsbasedir=${PORTAGE_BUILDDIR}
fi
dirdim=$(/bin/mount | grep "${tmpfsbasedir}" | sed 's|^.*size=||; s|\,.*$||')
if [ -z "$dirdim" ]
then
ewarn "Error evaluating mounted dimension: leaving ${tmpfsbasedir} as is"
return
fi
# evaluating required partition size
evaluate_mem_size
if [ "$dirdim" != "$PORTAGE_MEMSIZE" ]
then
# we're remounting
debuginfo "Command line: /bin/mount -o remount,size=${PORTAGE_MEMSIZE} ${tmpfsbasedir}"
/bin/mount -o remount,size=${PORTAGE_MEMSIZE} ${tmpfsbasedir}
else
# we're resuming a merge
debuginfo "Leaving '${PORTAGE_BUILDDIR}' mounted"
fi
else
# mounting
savebackup
mountfs
restorebackup
fi
}
on_install () {
mkdir -p $WORKDIR
chown portage:portage $WORKDIR
chmod 770 $WORKDIR
}
on_postinst () {
check_if_mounted
# if it's mounted, then unmount
if [ $? -eq 0 ]
then
isfeature mantain
if [ $itsafeature -eq 1 ]
then
# don't unmount if there's "mantain" in $FEATURES
einfo "Keeping mounted '${PORTAGE_BUILDDIR}' as requested in \$FEATURES"
return
else
# unmount
unmountfs
fi
fi
}
Code: Select all
tmpfs=on
UNIONFS_ENABLE=on
UNIONFS_BASEDISKDIR=/var/tmp/portage/unionfs/disk
UNIONFS_BASETMPFSDIR=/var/tmp/portage/unionfs/tmpfs


Code: Select all
FEATURES="sandbox ccache userpriv usersandbox strict userfetch userpriv collision-protect sfperms"Code: Select all
resumemerge=on
localepurge=on
perpackage=on
tmpfs=on
PORTAGE_MEMSIZE=500MCode: Select all
sys-devel/gcc 0
www-client/mozilla 0
app-emulation/wine 0
x11-libs/qt 0
sys-libs/glibc 0
app-text/tetex 0
app-office/openoffice-bin 0
www-client/mozilla-firefox 0
x11-libs/wxGTK 0
Ho fatto il merge con il topic di bashrc-ng.syntaxerrormmm wrote:Come da titolo del post, utilizzo portage-bashrc-ng-0.13.1_beta e portage-2.1.2_rc2-r1.

Ok, ne farò richiesta, aggiungendo che sarebbe il caso che la directory fosse pulita se e solo se il qmerge sia completato con successo..:chrome:. wrote:si potrebbe richiedere che venga aggiunta la funzione che svuota la directory, ma dovrebbe essere fatta con due accorgimenti:
- NON si deve svuotare niente se si vuole poter fare il resume della compilazione
- la rimozione deve essere fatta con un nice molto alto, altrimenti uccide la macchina
Code: Select all
* Found temporary portage compile dir (/var/tmp/portage/sys-fs/fuse-python-0.1-r1), umounting.
umount: /var/tmp/portage/sys-fs/fuse-python-0.1-r1: device occupato
umount: /var/tmp/portage/sys-fs/fuse-python-0.1-r1: device occupato
Code: Select all
[I] app-portage/portage-bashrc-ng (0.13-r1 07/02/2007)Code: Select all
Hal9000 ~ # equery f app-portage/portage-bashrc-ng
[ Searching for packages matching app-portage/portage-bashrc-ng... ]
* Contents of app-portage/portage-bashrc-ng-0.13-r1:
/etc
/etc/portage
/etc/portage/bashrc-ng
/usr
/usr/share
/usr/share/doc
/usr/share/doc/portage-bashrc-ng-0.13-r1
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules
/usr/share/eselect
/usr/share/eselect/modules
/usr/share/portage-bashrc-ng
Hal9000 ~ # ls /usr/share/eselect/modules/
bashcomp.eselect esd.eselect kernel.eselect opengl.eselect timidity.eselect
binutils.eselect java-nsplugin.eselect mailer.eselect profile.eselect
env.eselect java-vm.eselect oodict.eselect rc.eselect
Code: Select all
Hal9000 ~ # qlist portage-bashrc-ng
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/tmpfs.gz
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/resumemerge.gz
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/per-package.gz
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/localepurge.gz
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/distclean.gz
/usr/share/doc/portage-bashrc-ng-0.13-r1/modules/autopatch.gz
/usr/share/eselect/modules/bashrc-ng.eselect
/usr/share/portage-bashrc-ng/tmpfs.module
/usr/share/portage-bashrc-ng/resumemerge.module
/usr/share/portage-bashrc-ng/perpackage.module
/usr/share/portage-bashrc-ng/localepurge.module
/usr/share/portage-bashrc-ng/distclean.module
/usr/share/portage-bashrc-ng/distccval.module
/usr/share/portage-bashrc-ng/autopatch.module
/etc/portage/bashrc-ng/bashrc-ng.conf.example
/etc/portage/bashrc
Anche a me da lo stesso problema da quando ho aggiornato a portage-2.1.2-r9 (questa mattina), ho notato che disabilitando tmpfs mi rimangono le varie directory in /var/tmp/portage ...comio wrote:Ho un piccolo problema: il modulo tmpfs non mi smonta le directory. Per esempio (ma è una cosa che succede con tutti i pacchetti):
sto usando la versione 13beta.Code: Select all
* Found temporary portage compile dir (/var/tmp/portage/sys-fs/fuse-python-0.1-r1), umounting. umount: /var/tmp/portage/sys-fs/fuse-python-0.1-r1: device occupato umount: /var/tmp/portage/sys-fs/fuse-python-0.1-r1: device occupato
Qualche idea?
ciao
luigi
Code: Select all
grep -vE '(^[[:space:]]*($|(#|!|;|//)))'
ci sto lavorando proprio in questo momento.Kernel78 wrote:Anche a me da lo stesso problema da quando ho aggiornato a portage-2.1.2-r9 (questa mattina), ho notato che disabilitando tmpfs mi rimangono le varie directory in /var/tmp/portage ...
work fine!!equilibrium wrote:
/EDIT:
ho risolto il problema e ho fatto pure il bump version della nuova release sul GeCHI Overlay.
# layman -s gechi
# emerge -av portage-bashrc-ng
in caso riscontriate problemi o altro, vi pregherei di fare un bugreport sul tracker del progetto anzichè scrivere qui sul sito, grazie
buon emerge a tutti.
p.s.: il sito del GeCHI Overlay


L'overlay non è più in layman?!equilibrium wrote:
ho risolto il problema e ho fatto pure il bump version della nuova release sul GeCHI Overlay.
# layman -s gechi
# emerge -av portage-bashrc-ng
Code: Select all
caffeine ~ # layman --list | grep gechi
caffeine ~ #