-
Notifications
You must be signed in to change notification settings - Fork 41
/
fix_bootconfig.ppc64le
executable file
·127 lines (107 loc) · 2.7 KB
/
fix_bootconfig.ppc64le
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /bin/bash
# This script takes an unpacked ppc64le Live iso image in the form KIWI-NG currently creates.
#
# It modifies the tree to match ppx64le expectations.
#
# Usage:
#
# fix_bootconfig.ppc64le DST_DIR
#
# iso layout before:
# .
# ├── LiveOS
# │ └── squashfs.img
# └── boot
# └── ppc64le
# └── loader
# ├── initrd
# ├── isolinux.cfg
# ├── isolinux.msg
# └── linux
#
# iso layout adjusted:
# .
# ├── LiveOS
# │ └── squashfs.img
# ├── boot
# │ ├── grub2
# │ │ ├── core.elf
# │ │ ├── grub.cfg
# │ │ └── powerpc-ieee1275
# │ │ └── *.mod
# │ └── ppc64le
# │ ├── initrd
# │ └── linux
# └── ppc
# └── bootinfo.txt
#
dst="$1"
if [ ! -d "$dst" ] ; then
echo "fix_bootconfig.ppc64le: image dir \"$dst\" not found"
exit 1
fi
# KIWI config which should normally be inherited
# from a parent process in our case xorriso
# but that's not the case.
test -f $dst/.profile && . $dst/.profile
# ----------------
# Note:
#
# KIWI-NG creates an iso with isolinux boot files in boot/ppc64le/loader.
#
# These files are not needed except for kernel and initrd (and kernel params from isolinux.cfg).
#
# This script removes the isolinux config and adds ppc64le related config
# files. It also moves kernel and initrd to the usual location (in boot/s390x).
#
boot_dir=$dst/boot/ppc64le
grub_dir=$dst/boot/grub2
mkdir -p $boot_dir $grub_dir $dst/ppc
# if files are in a 'loader' subdir, move them out
if [ -d $boot_dir/loader ] ; then
mv $boot_dir/loader/{initrd,linux} $boot_dir
rm -r $boot_dir/loader
fi
chmod 644 $boot_dir/{initrd,linux}
# Create grub.cfg.
#
cat >$dst/boot/grub2/grub.cfg <<XXX
gfxmode=auto
set default="$kiwi_iname"
insmod gettext
if sleep --interruptible 0 ; then
timeout=60
fi
menuentry "$kiwi_iname" --class os --unrestricted {
echo 'Loading kernel...'
linux /boot/ppc64le/linux
echo 'Loading initrd...'
initrd /boot/ppc64le/initrd
}
menuentry "Check Installation Media -- $kiwi_iname" --class os --unrestricted {
echo 'Loading kernel...'
linux /boot/ppc64le/linux mediacheck=1 plymouth.enable=0
echo 'Loading initrd...'
initrd /boot/ppc64le/initrd
}
menuentry 'local' {
exit
}
submenu 'Other options...' {
menuentry 'Reboot' {
reboot
}
menuentry 'Exit to Open Firmware' {
exit
}
}
XXX
# Create bootinfo.txt
#
cat >$dst/ppc/bootinfo.txt <<XXX
<chrp-boot>
<description>$kiwi_iname</description>
<os-name>openSuSE Tumbleweed</os-name>
<boot-script>boot &device;:1,\boot\grub2\grub.elf</boot-script>
</chrp-boot>
XXX