1
0
Fork 0

Added my daily used scripts

This commit is contained in:
Stefan Reimer 2012-08-11 21:19:25 -07:00
parent 3e2cec2554
commit f42f4b8722
3 changed files with 65 additions and 0 deletions

28
scripts/make_kernel.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
set -e
NEW=$(grep "Kernel Configuration" /usr/src/linux/.config | awk '{print $3}')
echo $NEW
cd /usr/src/linux-${NEW}
# make clean
# make oldconfig
make -j4 menuconfig
make -j4 all
make -j4 modules_install
make install
cp /usr/src/linux/.config /etc/kernels/kernel-config-${NEW}
# rm -f /boot/*.previous
if [ -f "/boot/initrd-${NEW}" ] ; then
mv "/boot/initrd-${NEW}" "/boot/initrd-${NEW}.previous"
fi
dracut -H --force --strip /boot/initrd-${NEW} ${NEW}
grub2-mkconfig -o /boot/grub2/grub.cfg
echo "After successful boot of new kernel run:"
echo " root # module-rebuild rebuild"
# eselect opengl set ati

21
scripts/update_box.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# set -x
emerge --update --deep --newuse --pretend world
echo "Press Ctrl-C to abort..."
read
# Trigger mount
# ls /mnt/portage/distfiles /mnt/portage/portage > /dev/null
emerge --update --deep --newuse --keep-going world
# echo "Fixing pax flags..."
# ${SCRIPT_DIR}/fix_grsec.sh
echo "Going to remove unneeded packages ..."
emerge --depclean
echo "Fixing dependencies..."
revdep-rebuild -i

16
scripts/update_portage.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# set -x
PORTAGE=/mnt/portage/portage
emerge -q --sync
layman -q -S
# Delete any package mask
[ -f ${PORTAGE}/profiles/hardened/linux/amd64/package.mask ] && rm -f ${PORTAGE}/profiles/hardened/linux/amd64/package.mask
# Reenable nvidia
perl -i -p -e 's/^(nvidia|video_cards_nvidia|vdpau|cuda|opencl)/# $1/;' ${PORTAGE}/profiles/hardened/linux/use.mask ${PORTAGE}/profiles/hardened/linux/amd64/use.mask
# echo "Cleaning up archives.."
eclean -q packages
eclean -q distfiles