forked from MrChromebox/coreboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-uefi.sh
executable file
·63 lines (58 loc) · 2.26 KB
/
build-uefi.sh
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
#!/bin/bash
#
set -e
snb_ivb=("butterfly" "link" "lumpy" "parrot" "stout" "stumpy")
hsw=("falco" "leon" "mccloud" "monroe" "panther" "peppy" "tricky" "wolf" \
"zako");
bdw=("auron_paine" "auron_yuna" "buddy" "gandof" "guado" "librem13v1" \
"librem15v2" "lulu" "rikku" "samus" "tidus");
byt=("banjo" "candy" "clapper" "enguarde" "glimmer" "gnawty" "heli" \
"kip" "ninja" "orco" "quawks" "squawks" "sumo" "swanky" "winky");
bsw=("banon" "celes" "cyan" "edgar" "kefka" "reks" "relm" \
"setzer" "terra" "ultima" "wizpig");
skl=("asuka" "caroline" "cave" "chell" "lars" "librem13v2" "librem15v3" "sentry")
kbl=("atlas" "eve" "fizz" "librem13v4" "librem15v4" "nami" "nautilus" "nocturne" \
"rammus" "soraka")
str=("aleena" "barla" "careena" "kasumi" "liara")
json_file=cbmodels.json
rom_path=https://www.mrchromebox.tech/files/firmware/full_rom/
echo -e "{" > $json_file
if [ -z "$1" ]; then
build_targets=($(printf "%s " "${snb_ivb[@]}" "${hsw[@]}" "${bdw[@]}" \
"${byt[@]}" "${bsw[@]}" "${skl[@]}" "${kbl[@]}" "${str[@]}"));
else
build_targets=($@)
fi
for device in ${build_targets[@]}
do
filename="coreboot_tiano-${device}-mrchromebox_`date +"%Y%m%d"`.rom"
rm -f ~/dev/firmware/${filename}*
rm -rf ./build
cp configs/.config.${device}.uefi .config
make clean
make olddefconfig
make
cp ./build/coreboot.rom ./${filename}
cbfstool ${filename} print
sha1sum ${filename} > ${filename}.sha1
echo -e "\t\"${device}\": {" >> $json_file
echo -e "\t\t\"url\": \"${rom_path}${filename}\"," >> $json_file
echo -e "\t\t\"sha1\": \"$(cat ${filename}.sha1 | awk 'NR==1{print $1}')\"" >> $json_file
echo -e "\t}," >> $json_file
mv ${filename}* ~/dev/firmware/
if [ "${device}" == "peppy" ]; then
filename="coreboot_tiano-${device}_elan-mrchromebox_`date +"%Y%m%d"`.rom"
rm -rf ./build
sed -i 's/# CONFIG_ELAN_TRACKPAD_ACPI is not set/CONFIG_ELAN_TRACKPAD_ACPI=y/' .config
make
cp ./build/coreboot.rom ./${filename}
cbfstool ${filename} print
sha1sum ${filename} > ${filename}.sha1
echo -e "\t\"${device}-elan\": {" >> $json_file
echo -e "\t\t\"url\": \"${rom_path}${filename}\"," >> $json_file
echo -e "\t\t\"sha1\": \"$(cat ${filename}.sha1 | awk 'NR==1{print $1}')\"" >> $json_file
echo -e "\t}," >> $json_file
mv ${filename}* ~/dev/firmware/
fi
done
echo -e "}" >> $json_file