e29f031bec
There have been a few changes over the past few months, here we make the following changes. * change from backtrack=99 to complete-graph as a more correct flag * make python version selection more in line with what gentoo supports * set up python before stuff gets pip installed * ensure we have the proper pip so we can install pip packages as root * ensure we have the proper use flags for the disk formatting changes * set DIB_RELEASE like other distros * fix openssh-server element for gentoo Change-Id: I17202de3016616ce34c8cbead7d0fb047a64e96b
50 lines
1.6 KiB
Bash
Executable file
50 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
if [[ ${DIB_DEBUG_TRACE:-0} -gt 0 ]]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
if mountpoint -q /dev/shm; then
|
|
echo "/dev/shm found in /proc/self/mountinfo"
|
|
elif [[ -k /dev/shm ]]; then
|
|
echo "/dev/shm exists and is stickied"
|
|
else
|
|
fix_shm
|
|
fi
|
|
|
|
# make world consistant
|
|
USE="-build" emerge -q --complete-graph=y --jobs=2 --update --newuse --deep --with-bdeps=y @world
|
|
# rebuild packages that might need it
|
|
USE="-build" emerge -q --jobs=2 --usepkg=n @preserved-rebuild
|
|
# remove unneeded packages
|
|
USE="-build" emerge --verbose=n --depclean
|
|
# rebuild packages that might have somehow depended on the unneeded packages
|
|
USE="-build" emerge -q --jobs=2 --usepkg=n @preserved-rebuild
|
|
|
|
# update config files
|
|
etc-update --automode -5
|
|
|
|
# clean up portage files
|
|
emerge --verbose=n --depclean
|
|
emaint all -f
|
|
eselect news read all
|
|
|
|
rm -Rf /root/.ccache/* /usr/src/* /var/cache/edb/dep/* /var/cache/genkernel/* /var/empty/* /var/run/* /var/state/* /var/tmp/*
|
|
rm -Rf /etc/*- /etc/*.old /etc/ssh/ssh_host_* /root/.*history /root/.lesshst /root/.ssh/known_hosts /root/.viminfo /usr/share/genkernel /usr/lib64/python*/site-packages/gentoolkit/test/eclean/testdistfiles.tar.gz
|
|
if [[ "${GENTOO_PORTAGE_CLEANUP}" != "False" ]]; then
|
|
rm -Rf /usr/portage/* /var/cache/portage/distfiles
|
|
fi
|
|
|
|
# shrink a bit
|
|
for i in $(find /var/log -type f); do echo > $i; done
|
|
find /usr/share/man/ -mindepth 1 -maxdepth 1 -path "/usr/share/man/man*" -prune -o -exec rm -rf {} \;
|
|
|
|
# make it so we don't have to reinstall grub
|
|
if [[ -a /usr/sbin/grub2-install ]]; then
|
|
mkdir -p /tmp/grub
|
|
touch /tmp/grub/install
|
|
fi
|
|
|
|
unfix_shm
|