1 |
commit: e9c0a0394d1516a03aba93ff673a0ff612c4d3c7 |
2 |
Author: Luca Barbato <lu_zero <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 18 07:56:55 2018 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 14 05:40:18 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e9c0a039 |
7 |
|
8 |
ppc: Generate Grub entries |
9 |
|
10 |
Tested-by: Matt Turner <mattst88 <AT> gentoo.org> |
11 |
|
12 |
targets/support/bootloader-setup.sh | 154 +++++++----------------------------- |
13 |
1 file changed, 30 insertions(+), 124 deletions(-) |
14 |
|
15 |
diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh |
16 |
index ecb1810b..b7e2d313 100755 |
17 |
--- a/targets/support/bootloader-setup.sh |
18 |
+++ b/targets/support/bootloader-setup.sh |
19 |
@@ -81,139 +81,45 @@ case ${clst_hostarch} in |
20 |
done |
21 |
;; |
22 |
ppc*|powerpc*) |
23 |
- # NO SOFTLEVEL SUPPORT YET |
24 |
- icfg=$1/boot/yaboot.conf |
25 |
- kmsg=$1/boot/boot.msg |
26 |
- |
27 |
- echo "device=cd:" >> ${icfg} |
28 |
- echo "root=/dev/ram" >> ${icfg} |
29 |
- echo "fgcolor=white" >> ${icfg} |
30 |
- echo "bgcolor=black" >> ${icfg} |
31 |
- echo "message=/boot/boot.msg" >> ${icfg} |
32 |
- |
33 |
- # Here is where I fix up the boot.msg file. |
34 |
- ${clst_sed} -e 's/ARCH/PowerPC/' \ |
35 |
- -e 's/HARDWARE/Apple and IBM hardware/' \ |
36 |
- -i $kmsg |
37 |
- |
38 |
- # Setup the IBM yaboot.conf |
39 |
- etc_icfg=$1/etc/yaboot.conf |
40 |
- mkdir -p $1/etc |
41 |
- IBM_YABOOT="FALSE" |
42 |
- echo "root=/dev/ram" >> ${etc_icfg} |
43 |
- echo "fgcolor=white" >> ${etc_icfg} |
44 |
- echo "bgcolor=black" >> ${etc_icfg} |
45 |
- echo "message=/boot/boot.msg" >> ${etc_icfg} |
46 |
- |
47 |
+ # GRUB2 Openfirmware |
48 |
+ kern_subdir=/boot |
49 |
+ iacfg=$1/boot/grub/grub.cfg |
50 |
+ mkdir -p $1/boot/grub |
51 |
+ echo 'set default=0' > ${iacfg} |
52 |
+ echo 'set gfxpayload=keep' >> ${iacfg} |
53 |
+ echo 'set timeout=10' >> ${iacfg} |
54 |
+ echo 'insmod all_video' >> ${iacfg} |
55 |
+ echo '' >> ${iacfg} |
56 |
for x in ${clst_boot_kernel} |
57 |
do |
58 |
eval "clst_kernel_console=\$clst_boot_kernel_${x}_console" |
59 |
eval "clst_kernel_machine_type=\$clst_boot_kernel_${x}_machine_type" |
60 |
eval custom_kopts=\$${x}_kernelopts |
61 |
|
62 |
- echo "APPENDING CUSTOM KERNEL ARGS: ${custom_kopts}" |
63 |
- if [ "${clst_kernel_machine_type}" == "ibm" ] |
64 |
+ echo "menuentry 'Boot LiveCD (kernel: ${x})' --class gnu-linux --class os {" >> ${iacfg} |
65 |
+ echo " linux ${kern_subdir}/${x} ${default_append_line}" >> ${iacfg} |
66 |
+ echo " initrd ${kern_subdir}/${x}.igz" >> ${iacfg} |
67 |
+ echo "}" >> ${iacfg} |
68 |
+ echo "" >> ${iacfg} |
69 |
+ echo "menuentry 'Boot LiveCD (kernel: ${x}) (cached)' --class gnu-linux --class os {" >> ${iacfg} |
70 |
+ echo " linux ${kern_subdir}/${x} ${default_append_line} docache" >> ${iacfg} |
71 |
+ echo " initrd ${kern_subdir}/${x}.igz" >> ${iacfg} |
72 |
+ echo "}" >> ${iacfg} |
73 |
+ if [ -n "${clst_kernel_console}" ] |
74 |
then |
75 |
- IBM_YABOOT="true" |
76 |
- if [ -n "${clst_kernel_console}" ] |
77 |
- then |
78 |
- echo >> ${etc_icfg} |
79 |
- echo "image=/boot/${x}" >> ${etc_icfg} |
80 |
- |
81 |
- if [ -e "$1/boot/${x}.igz" ] |
82 |
- then |
83 |
- echo "initrd=/boot/${x}.igz" >> ${etc_icfg} |
84 |
- fi |
85 |
- |
86 |
- echo "label=${x}" >> ${etc_icfg} |
87 |
- echo "read-write" >> ${icfg} |
88 |
- echo "append=\"${default_append_line}\"" >> ${etc_icfg} |
89 |
- |
90 |
- for y in ${clst_kernel_console} |
91 |
- do |
92 |
- echo ${y} |
93 |
- echo >> ${etc_icfg} |
94 |
- echo "image=/boot/${x}" >> ${etc_icfg} |
95 |
- |
96 |
- if [ -e "$1/boot/${x}.igz" ] |
97 |
- then |
98 |
- echo "initrd=/boot/${x}.igz" >> ${etc_icfg} |
99 |
- fi |
100 |
- |
101 |
- echo "label=${x}-${y} " >> ${etc_icfg} |
102 |
- echo "read-write" >> ${icfg} |
103 |
- echo "append=\"${default_append_line} console=${y}\"" >> ${etc_icfg} |
104 |
- done |
105 |
- else |
106 |
- echo >> ${etc_icfg} |
107 |
- echo "image=/boot/${x}" >> ${etc_icfg} |
108 |
- |
109 |
- if [ -e "$1/boot/${x}.igz" ] |
110 |
- then |
111 |
- echo "initrd=/boot/${x}.igz" >> ${etc_icfg} |
112 |
- fi |
113 |
- |
114 |
- echo "label=${x}" >> ${etc_icfg} |
115 |
- echo "read-write" >> ${etc_icfg} |
116 |
- echo "append=\"${default_append_line}\"" >> ${etc_icfg} |
117 |
- fi |
118 |
- else |
119 |
- # Here we wipe out the /ppc directory, if it exists. |
120 |
- rm -rf $1/ppc |
121 |
- if [ -n "${clst_kernel_console}" ] |
122 |
- then |
123 |
- echo >> ${icfg} |
124 |
- echo "image=/boot/${x}" >> ${icfg} |
125 |
- |
126 |
- if [ -e "$1/boot/${x}.igz" ] |
127 |
- then |
128 |
- echo "initrd=/boot/${x}.igz" >> ${icfg} |
129 |
- fi |
130 |
- |
131 |
- echo "label=${x}" >> ${icfg} |
132 |
- echo "read-write" >> ${icfg} |
133 |
- echo "append=\"${default_append_line}\"" >> ${icfg} |
134 |
- |
135 |
- for y in ${clst_kernel_console} |
136 |
- do |
137 |
- echo >> ${icfg} |
138 |
- echo "image=/boot/${x}" >> ${icfg} |
139 |
- |
140 |
- if [ -e "$1/boot/${x}.igz" ] |
141 |
- then |
142 |
- echo "initrd=/boot/${x}.igz" >> ${icfg} |
143 |
- fi |
144 |
- |
145 |
- echo "label=${x}-${y} " >> ${icfg} |
146 |
- echo "read-write" >> ${icfg} |
147 |
- echo "append=\"${default_append_line} console=${y}\"" >> ${icfg} |
148 |
- done |
149 |
- else |
150 |
- echo >> ${icfg} |
151 |
- echo "image=/boot/${x}" >> ${icfg} |
152 |
- |
153 |
- if [ -e "$1/boot/${x}.igz" ] |
154 |
- then |
155 |
- echo "initrd=/boot/${x}.igz" >> ${icfg} |
156 |
- fi |
157 |
- |
158 |
- echo "label=${x}" >> ${icfg} |
159 |
- echo "read-write" >> ${icfg} |
160 |
- echo "append=\"${default_append_line}\"" >> ${icfg} |
161 |
- fi |
162 |
+ echo "submenu 'Special console options (kernel: ${x})' --class gnu-linux --class os {" >> ${iacfg} |
163 |
+ for y in ${clst_kernel_console} |
164 |
+ do |
165 |
+ echo "menuentry 'Boot LiveCD (kernel: ${x} console=${y})' --class gnu-linux --class os {" >> ${iacfg} |
166 |
+ echo " linux ${kern_subdir}/${x} ${default_append_line} console=${y}" >> ${iacfg} |
167 |
+ echo " initrd ${kern_subdir}/${x}.igz" >> ${iacfg} |
168 |
+ echo "}" >> ${iacfg} |
169 |
+ echo "" >> ${iacfg} |
170 |
+ done |
171 |
+ echo "}" >> ${iacfg} |
172 |
fi |
173 |
+ echo "" >> ${iacfg} |
174 |
done |
175 |
- |
176 |
- if [ "${IBM_YABOOT}" == "FALSE" ] |
177 |
- then |
178 |
- rm ${etc_kmsg} |
179 |
- rmdir $1/etc |
180 |
- if [ -d $1/ppc ] |
181 |
- then |
182 |
- rm -r $1/ppc |
183 |
- fi |
184 |
- fi |
185 |
- |
186 |
;; |
187 |
sparc*) |
188 |
# NO SOFTLEVEL SUPPORT YET |