2011-11-22 11:11:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /sabayon/bin/kernels.inc
|
|
|
|
|
|
|
|
if [ "${#}" -lt 1 ]; then
|
|
|
|
echo "${0} <package> <package> ..." >&2 /dev/null
|
2011-11-22 11:13:03 +01:00
|
|
|
echo "example: ${0} net-wireless/broadcom-sta" >&2 /dev/null
|
2011-11-22 11:11:26 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# build for latest kernel
|
2011-11-30 00:36:38 +01:00
|
|
|
KERNEL_DIR="/usr/src/linux-${running_kernel}" emerge "${@}" || exit 1
|
2011-11-22 11:11:26 +01:00
|
|
|
echo -5 | etc-update
|
2011-11-30 00:36:38 +01:00
|
|
|
eit commit || exit 1
|
2011-11-22 11:11:26 +01:00
|
|
|
|
|
|
|
for kernel in $kernels; do
|
|
|
|
if [ "${kernel}" = "${running_kernel}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
rm -rf /usr/portage/packages/*
|
|
|
|
KERNEL_DIR="/usr/src/linux-${kernel}" emerge -B "${@}" || { echo "ouch unable to build" && exit 1; }
|
|
|
|
built_pkgs=$(find /usr/portage/packages -name "*.tbz2" | xargs echo)
|
|
|
|
[[ -z "${built_pkgs}" ]] && echo "ouch no kernel pkgs" && exit 2
|
|
|
|
eit inject ${built_pkgs} || { echo "ouch unable to inject" && exit 3; }
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Now you should remove old packages..."
|