receiving incremental file list
deleting .unionfs/sys-libs/timezone-data/timezone-data-2009t.ebuild_HIDDEN~
deleting .unionfs/sys-libs/timezone-data/
deleting .unionfs/sys-libs/
deleting .unionfs/sys-kernel/tuxonice-sources/tuxonice-sources-2.6.28-r11.ebuild_HIDDEN~
deleting .unionfs/sys-kernel/tuxonice-sources/tuxonice-sources-2.6.28-r10.ebuild_HIDDEN~
deleting .unionfs/sys-kernel/tuxonice-sources/
deleting .unionfs/sys-kernel/
deleting .unionfs/sys-fs/iprutils/iprutils-2.2.9.ebuild_HIDDEN~
deleting .unionfs/sys-fs/iprutils/iprutils-2.2.8.ebuild_HIDDEN~
deleting .unionfs/sys-fs/iprutils/iprutils-2.2.3.ebuild_HIDDEN~
....
deleting .unionfs/app-doc/
deleting .unionfs/.unionfs/sys-libs_HIDDEN~/
deleting .unionfs/.unionfs/sys-libs/timezone-data_HIDDEN~/
deleting .unionfs/.unionfs/sys-libs/timezone-data/timezone-data-2009t.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-libs/timezone-data/
deleting .unionfs/.unionfs/sys-libs/
deleting .unionfs/.unionfs/sys-kernel_HIDDEN~/
deleting .unionfs/.unionfs/sys-kernel/tuxonice-sources_HIDDEN~/
deleting .unionfs/.unionfs/sys-kernel/tuxonice-sources/tuxonice-sources-2.6.28-r11.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-kernel/tuxonice-sources/tuxonice-sources-2.6.28-r10.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-kernel/tuxonice-sources/
deleting .unionfs/.unionfs/sys-kernel/
deleting .unionfs/.unionfs/sys-fs_HIDDEN~/
deleting .unionfs/.unionfs/sys-fs/iprutils_HIDDEN~/
deleting .unionfs/.unionfs/sys-fs/iprutils/iprutils-2.2.9.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-fs/iprutils/iprutils-2.2.8.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-fs/iprutils/iprutils-2.2.3.ebuild_HIDDEN~_HIDDEN~
deleting .unionfs/.unionfs/sys-fs/iprutils/
deleting .unionfs/.unionfs/sys-fs/
....
How do you do that? Using mount --bind? If this mount --bind happens before the (re)start of /etc/init.d/squash_*, the mounting in that script will of course have no effect in the chroot. I am callingjs08 wrote:The only problem I have in my environment (AMD64 with 32bit-chroot using the same /usr/portage)
Code: Select all
mount --make-shared /Only checking? It does not mount/umount something or perhaps restart some initscripts (perhaps openrc thinks, squash_* should be restarted, for some reason)? Did you try mount --make-shared / as I suggested? (You would need to do this and the mount --bind before starting squash_*)js08 wrote:I know when it happens (due to a cronjob checking /usr/portage periodically)

Code: Select all
* ERROR: aufs filesystem support is not available.
* DO NOT USE EXIT IN INIT.D SCRIPTS
* This IS a bug, please fix your broken init.dI suggest you try the scripts from the page of one of my previous posts; they do not use illegal things like exit on bad places (if it does not work with baselayout-1, please report here). On the same page you will also find a working aufs2 live ebuild. Do not use aufs with current kernels.john.newman wrote:hello, I am trying to do this as per the directions and the code on the wiki (http://en.gentoo-wiki.com/wiki/Squashed_Portage_Tree).

Yes. Alternatively you can try to set ORDER="unionfs-fuse aufs" in /etc/conf.d/squash_foo in which case unionfs-fuse is attempted first. The advantage is that this does not need a kernel patch, only unionfs-fuse must be installed and the fuse module (which is in mainstream kernel) must be loaded. However, although the required space is roughly the same, it may be slower than aufs2. Moreover, there is the problem with the .funionfs directory mentioned some posts ago (you can also find the workaround there which is also described in the documentation: Search for PORTAGE_RSYNC_EXTRA_OPTS), and maybe some other problems with chroot described also in previous posts.john.newman wrote:I actually did get portage to squash and mount, but I got an error regarding aufs. So I need to patch the kernel for aufs2 and load the module. Correct?
It is just a question of time until these become stable. I am using them since months without problems. Only in the recent version some standard things can be done cleanly in a documented manner with autoconf.And the masked packages, like autoconf etc, those are OK right?![]()

Code: Select all
# download mv's squash-dir package, extract, and copy bz2 to distfiles to avoid 2x download
wget "http://www.mathematik.uni-wuerzburg.de/~vaeth/gentoo/squash_dir-10.2.tar.bz2"
tar -xjvf squash_dir-10.2.tar.bz2
cp squash_dir-10.2.tar.bz2 /usr/portage/distfiles/
# create a local portage overlay, you may have already done this
mkdir -p /usr/local/portage
echo 'PORTDIR_OVERLAY="/usr/local/portage"' >> /etc/make.conf
# copy the new ebuild to our local overlay
cp -a squash_dir-10.2/sys-fs /usr/local/portage/
# prepare the build
ebuild /usr/local/portage/sys-fs/squash_dir/squash_dir-10.2.ebuild manifest
# unmask some packages ..
mkdir -p /etc/portage/package.keywords/
echo "=sys-fs/squash_dir-10.2" >> /etc/portage/package.keywords/squash_dir
echo "=sys-devel/autoconf-2.65" >> /etc/portage/package.keywords/autoconf
echo "=sys-fs/unionfs-fuse-0.23" >> /etc/portage/package.keywords/unionfs-fuse
echo "=sys-devel/autoconf-wrapper-8" >> /etc/portage/package.keywords/autoconf-wrapper-8
# build squash_dir
emerge squash_dir
# relocate distfiles to /var/portage
mkdir -p /var/portage
mv /usr/portage/distfiles/ /var/portage/distfiles
echo "DISTDIR=\"/var/portage/distfiles\"" >> /etc/make.conf
# fix emerge --sync and the ro .unionfs file -- possibly not needed if using aufs2?
echo "PORTAGE_RSYNC_OPTIONS=\" --exclude=/.unionfs\"" >> /etc/make.conf
# I had to emerge git, you may already have
USE="-dso curl" emerge git
# git the aufs2 standalone patch for 2.6.31
git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git aufs2-standalone.git
cd aufs2-standalone.git/
git checkout origin/aufs2-31 # 31 = 2.6.31, XX = 2.6.XX
# make a copy of unpatched gentoo kernel for backup
cd /usr/src
cp -a linux-2.6.31-gentoo-r6 linux-2.6.31-gentoo-r6-aufs
cd linux-2.6.31-gentoo-r6-aufs
# apply needed aufs2 patches
patch -p1 < ~/aufs2-standalone.git/aufs2-base.patch
patch -p1 < ~/aufs2-standalone.git/aufs2-standalone.patch
# and append "-aufs" to local version
sed -i 's/CONFIG_LOCALVERSION=\".*\"/CONFIG_LOCALVERSION=\"-aufs\"/' .config
# build and install kernel with minimal patches for aufs module
make
make modules_install
make install
# load new kernel (and pwn anyone who blindly pasted script)
rebootCode: Select all
# build and install the new aufs2 module
cd ~/aufs2-standalone.git/
make
# is there a better way to get the ko file in the right spot? I don't really know if this is the right techinque.. ?
mkdir -p /lib/modules/2.6.31-gentoo-r6-aufs/kernel/fs/aufs/
cp aufs.ko /lib/modules/2.6.31-gentoo-r6-aufs/kernel/fs/aufs/
# refresh modules
depmod -a
# load aufs module - hope this works.. if so it should be successful (you may already have loop loaded)
modprobe aufs
modprobe loop
# auto load those 2 next time
echo -e "loop\naufs" >> /etc/modules.autoload.d/kernel-2.6
# setup squash_portage script
cd /etc/init.d
ln -s squash_dir /etc/init.d/squash_portage
cd -
#basic config that was in the readme .. adjust as desired.
echo -e "DIRECTORY=\"/usr/portage\"\\nDIR_CHANGE=\"\${DIRECTORY}.changes\"\\nDIR_SQUASH=\"\${DIRECTORY}.readonly\"\\nTHRESHOLD=40000" > /etc/conf.d/squash_portage
# start squashing portage, script auto creates new squash file system :-)
/etc/init.d/squash_portage start
# see if it worked right
mount
# try this
emerge --sync
# it works, add to default run level
rc-update add squash_portage defaultCode: Select all
layman -fCode: Select all
layman -a mvCode: Select all
mvCode: Select all
eix-sync
Code: Select all
/etc/init.d/squash_portage stop
* Caching service dependencies... [ ok ]
* Squashing /usr/portage to /usr/portage.sqfs...
* (this may take a while) [ ok ]
* Unmounting /usr/portage...
umount: /usr/portage.readonly: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
* umount -d -- /usr/portage.readonly failed [exit with 1]
umount: /usr/portage.sqfs: not mounted
* umount -d -- /usr/portage.sqfs failed [exit with 1] [ !! ]
* ERROR: squash_portage failed to stop
Code: Select all
/etc/init.d/squash_portage stop
* Unmounting /usr/portage...
umount: /usr/portage: not mounted
* umount -- /usr/portage failed [exit with 1] [ !! ]
* ERROR: squash_portage failed to stop
Code: Select all
/etc/init.d/squash_portage start
* WARNING: squash_portage has already been started
This is strange; I cannot produce this here: Recent versions of squash_dir (certainly since 10.3, probably also earlier ones) should even after such an error try to umount the other directories, too. Of course, this means anyway that the "stop" will fail, but everything should be umounted (if it can be umounted).js08 wrote:2) all following stop calls have this output....
Code: Select all
/etc/init.d/squash_portage stop * Unmounting /usr/portage... umount: /usr/portage: not mounted * umount -- /usr/portage failed [exit with 1] [ !! ] * ERROR: squash_portage failed to stop
This is clear and due to a slight misconception of openrc (and I suppose, the same for baselayout-1). The problem is: What should squash_dir do in such a case? Returning error status 0 and claiming that everything is ok is probably not appropriate (squash_dir received an error for umounting which can have all sorts of unexpected consequences). On the other hand, if the error status is nonzero, openrc will automatically assume that squash_dir was not stopped - there is no possibility from within the script to say "Something strange happened, but I stop anyway".3) start, restart produce this outputCode: Select all
/etc/init.d/squash_portage start * WARNING: squash_portage has already been started
However, once more: It is strange that squash_portage only wants to umount /usr/portage and after the failure does not try to umount the other directories - I cannot see from the code (in current versions) why this could happen, and I also cannot produce this behaviour./etc/init.d/squash_portage zap
I suppose that there is not much the script can do about this. (Maybe inserting a sleep before line 592 helps?). However, the strange thing is that if you call squash_portage stop afterwards it should attempt again to umount /usr/portage.readonly: If this is succesful you see probably no message for this, but if you retry again it cannot be successful: Either at the second or the third call you should see a message that /usr/portage.readonly cannot be umounted (either for some reason in the second call or in the third call because it is already umounted).js08 wrote:II get always this "umount: /usr/portage.readonly: device is busy." message and when I execute "umount /usr/portage.readonly" immediately after "squash_portage stop" it works and /usr/portage.readonly is no longer mounted.
Please report this upstream to unionfs-fuse. For manual testing and reporting: This is what "squash_portage start" should actually execute in your case:that the sys-fs/unionfs-fuse-0.25_alpha9999 doesn't run stable in my environment.
Code: Select all
mount squashfs -o loop,ro -- /usr/portage.sqfs /usr/portage.readonly
unionfs -o cow -o allow_other -o use_ino -o nonempty -o hide_meta_dir /usr/portage.changes=RW:/usr/portage.readonly=RO /usr/portageok the unionfs-fuse issue: (happens with mv's overlay version and the new 0.24 version, so I switched back to 0.23)aakef wrote:Upstream is just reading hereand would like to see a detailed problem discription.
The workaround for this strange umount behaviour helps!!! First I tried 10 seconds, then I reduced the sleep to 1 second and it works.I suppose that there is not much the script can do about this. (Maybe inserting a sleep before line 592 helps?).
I cannot reproduce it, but the code which should be executed on "squash_portage stop" is essentiallyaakef wrote:There "busy" problem on umount?
Code: Select all
flock -w 20 -- /etc/mtab.lock umount -i -- /usr/portage
flock -w 20 -- /etc/mtab.lock umount -d -i -- /usr/portage.readonly || flock -w 20 -- /etc/mtab.lock umount -d -i -- /usr/portage.sqfs