2013-01-25 08:07:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-04-19 00:20:29 +00:00
|
|
|
set -e
|
|
|
|
|
2013-02-16 16:17:42 +00:00
|
|
|
echo "Mounting archlinux install system into mnt_archlinux_dvd..."
|
2015-01-13 06:44:35 +00:00
|
|
|
mount $CACHEDIR/airootfs.img mnt_archlinux_dvd
|
|
|
|
|
|
|
|
echo "Fix bug intruduced in arch-chroot causing arguments not to be passed"
|
|
|
|
sed "s/unshare --fork --pid//" -i mnt_archlinux_dvd/usr/bin/arch-chroot
|
2013-01-25 08:07:01 +00:00
|
|
|
|
|
|
|
echo "--> Starting cleanup actions"
|
|
|
|
# Remove unused packages and their dependencies (make dependencies)
|
2013-12-08 19:33:28 +00:00
|
|
|
cleanuppkgs=`./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman -Qdt | grep -v kernel | cut -d " " -f 1`
|
2013-04-26 07:44:06 +00:00
|
|
|
echo "--> Packages that can be cleaned up: $cleanuppkgs"
|
|
|
|
if [ -n "$cleanuppkgs" ] ; then
|
2013-04-28 20:50:18 +00:00
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc $cleanuppkgs
|
2013-04-26 07:44:06 +00:00
|
|
|
fi
|
|
|
|
|
2014-02-16 16:28:55 +00:00
|
|
|
# Remove video plugins
|
|
|
|
echo "--> Removing video plugins"
|
|
|
|
VIDEOPKGS=`./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman -Qs -q xf86-video`
|
|
|
|
echo $VIDEOPKGS | ./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc -
|
|
|
|
|
|
|
|
# Remove other font package
|
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Rsc xorg-fonts-100dpi xorg-fonts-75dpi
|
|
|
|
|
2013-01-25 08:07:01 +00:00
|
|
|
# Clean pacman cache
|
2013-04-28 20:50:18 +00:00
|
|
|
./mnt_archlinux_dvd/usr/bin/arch-chroot $INSTALLDIR pacman --noconfirm -Scc
|
2013-01-25 08:07:01 +00:00
|
|
|
|
2013-04-28 20:50:18 +00:00
|
|
|
umount mnt_archlinux_dvd
|
2013-01-25 08:07:01 +00:00
|
|
|
|
|
|
|
#rm -f $INSTALLDIR/var/lib/rpm/__db.00* $INSTALLDIR/var/lib/rpm/.rpm.lock
|
|
|
|
#yum -c $PWD/yum.conf $YUM_OPTS clean packages --installroot=$INSTALLDIR
|
|
|
|
|
|
|
|
# Make sure that rpm database has right format (for rpm version in template, not host)
|
|
|
|
#echo "--> Rebuilding rpm database..."
|
|
|
|
#chroot `pwd`/mnt /bin/rpm --rebuilddb 2> /dev/null
|