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