Change unionfs module loading

Checking /proc/filesystems for unionfs is
friendlier for kernels with unionfs builtin.
Also, a total lack of unionfs now causes
makechrootpkg to bail out.

Signed-off-by: Simo Leone <simo@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Simo Leone 2008-02-05 23:59:52 -06:00 committed by Dan McGee
parent e0f139ad0e
commit 0b0a7b3140
1 changed files with 7 additions and 1 deletions

View File

@ -104,7 +104,13 @@ cleanup ()
uniondir="$chrootdir/union"
echo "building union chroot"
modprobe -q unionfs
grep -Fq unionfs /proc/filesystems
if [ $? -ne 0 ]; then
modprobe -q unionfs
if [ $? -ne 0 ];
echo "ERROR: No unionfs available. Abandon ship!" && exit 1
fi
fi
mount -t unionfs none -o "dirs=$chrootdir/rw=rw:$chrootdir/root=ro" "$uniondir"
trap 'cleanup' 0 1 2 15