forked from open-power/pnor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakelidpkg
executable file
·41 lines (34 loc) · 1.56 KB
/
makelidpkg
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
#!/bin/sh
# $1 = output file, e.g. $(BINARIES_DIR)/ebmc_lids.tar.gz
# $2 = PNOR scratch directory to pull data from, e.g. $(OPENPOWER_PNOR_SCRATCH_DIR)
echo "*** Building ebmc_lids.tar.gz"
OUTPUT_FILE=$1
OPENPOWER_PNOR_SCRATCH_DIR=$2
echo "Output : $OUTPUT_FILE"
echo "Scratch : $OPENPOWER_PNOR_SCRATCH_DIR"
ELIDS_DIR=$OPENPOWER_PNOR_SCRATCH_DIR/ebmc_lids/
mkdir $ELIDS_DIR
HOST_FW_LIDS_DIR=$ELIDS_DIR/host_fw_lids/
mkdir $HOST_FW_LIDS_DIR
#Log the files we used
ELIDS_STATUS=$ELIDS_DIR/ebmc_lids.status
printf "\nCopying Host FW IPL-time lids to $HOST_FW_LIDS_DIR \n\n" >> $ELIDS_STATUS
for lid_candidate in $OPENPOWER_PNOR_SCRATCH_DIR/*.ipllid; do
is_hbb=0
echo $lid_candidate | grep -q "HBB.ipllid" && is_hbb=1
if [ "$is_hbb" == "1" ] ; then
# use HBB.bin for the HBB content instead of the normal ipllid
cp -v "$OPENPOWER_PNOR_SCRATCH_DIR/HBB.bin" "$HOST_FW_LIDS_DIR/HBB.content" | tee -a $ELIDS_STATUS
else
cp -v "$lid_candidate" "$HOST_FW_LIDS_DIR/$(basename -- "$lid_candidate" .ipllid).content" | tee -a $ELIDS_STATUS
fi
done
# Prepare lids that will be consumed at runtime
RUNTIME_LIDS='HBRT HCODE HBD WOFDATA OCC'
printf "\nCopying Host FW runtime lids to $ELIDS_DIR \n\n" >> $ELIDS_STATUS
for lid_candidate in $RUNTIME_LIDS; do
cp -v $OPENPOWER_PNOR_SCRATCH_DIR/${lid_candidate}.staged $ELIDS_DIR/${lid_candidate}.content | tee -a $ELIDS_STATUS
cp -v $OPENPOWER_PNOR_SCRATCH_DIR/${lid_candidate}.header $ELIDS_DIR/${lid_candidate}.header | tee -a $ELIDS_STATUS
done
tar -zcvf $OUTPUT_FILE -C $ELIDS_DIR .
echo "$OUTPUT_FILE"