comparison gk.sh @ 160:c35d56590441

add the two helper scripts for gentoo that are requied on all hosts
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 23 Dec 2019 11:41:35 +0100
parents
children e5f67219ad24
comparison
equal deleted inserted replaced
159:d0cdc3f47182 160:c35d56590441
1 #!/bin/sh
2
3 if [ `whoami` != "root" ]; then
4 echo "must be root"
5 exit 1
6 fi
7
8 # for xconfig
9 export DISPLAY=localhost:0.0
10
11 # make sure gk.sh always uses the same ccache cache
12 export CCACHE_DIR=/var/tmp/ccache
13
14 # use CCACHE when compiling the kernel
15 COMPILER=/usr/lib/ccache/bin/gcc
16
17 # source make.conf for MAKEOPTS
18 GK_OPTS=""
19
20 if [ -f /etc/make.conf ]; then
21 . /etc/make.conf
22 elif [ -f /etc/portage/make.conf ]; then
23 . /etc/portage/make.conf
24 else
25 echo "cannot find make.conf"
26 exit 1
27 fi
28
29 if [ "$MAKEOPTS" != "" ]; then
30 GK_OPTS="--makeopts=$MAKEOPTS "
31 fi
32
33 if [ -d /etc/kernels ]; then
34 kernel=`ls -rt /etc/kernels | tail -n 1`
35 if [ $kernel != "" ]; then
36 GK_OPTS="$GK_OPTS --kernel-config=/etc/kernels/$kernel"
37 fi
38 fi
39
40 genkernel $* \
41 --install \
42 --no-color \
43 --kernel-cc=$COMPILER \
44 --utils-cc=$COMPILER \
45 $GK_OPTS \
46 all
47
48 # TODO check --bootloader
49 # update the bootloader
50 #grub-mkconfig -o /boot/grub/grub.cfg