-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.sh
executable file
·49 lines (37 loc) · 1.07 KB
/
prepare.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
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
shopt -s extglob
d=$(dirname "${BASH_SOURCE[0]}")
rel=${1:-noble}
fw_rv64_opensbi=$(echo $d/firmware_rv64_opensbi_+([a-f0-9]).tar.zst)
fw_rv64_uboot=$(echo $d/firmware_rv64_uboot_+([a-f0-9]).tar.zst)
fw_rv64_uboot_acpi=$(echo $d/firmware_rv64_uboot_acpi_+([a-f0-9]).tar.zst)
qemu=$(echo $d/qemu_+([a-f0-9]).tar.zst)
rootfs=$(echo $d/rootfs_rv64_${rel}_*.tar)
mkdir -p $d/firmware
mkdir -p $d/qemu
if [[ ! -a $fw_rv64_opensbi ]]; then
$d/mkfirmware_rv64_opensbi.sh
fi
if [[ ! -a $fw_rv64_uboot ]]; then
$d/mkfirmware_rv64_uboot.sh
fi
if [[ ! -a $fw_rv64_uboot_acpi ]]; then
$d/mkfirmware_rv64_uboot_acpi.sh
fi
if [[ ! -a $qemu ]]; then
$d/mkqemu.sh
fi
if [[ ! -a $rootfs ]]; then
$d/mkrootfs_rv64_ubuntu.sh ${rel}
fi
if [[ ! -a $d/${rel}.img ]]; then
$d/mkimage_rv64_uefi.sh $rootfs $d/${rel}.img
fi
tar -C $d/firmware -xf $fw_rv64_opensbi
tar -C $d/firmware -xf $fw_rv64_uboot
tar -C $d/firmware -xf $fw_rv64_uboot_acpi
tar -C $d/qemu -xf $qemu