summaryrefslogtreecommitdiff
path: root/RIKOR/gen-self-image
blob: 6dc558a3a965e71f9f468ba42d54efa017907d45 (plain)
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
#!/bin/sh

image=$1
images_dir=/opt/exports/images/sila-32MiB
target_dir=/opt/exports/images/rikor-ro-sila

if [ "x${image}" = "x" ] ; then
  iname=`ls -Art ${images_dir} | grep 'static.mtd.all.tar' | tail -n 1`
  image="${images_dir}/${iname}"
fi

if [ "x${image}" = "x" ] ; then
  echo "Cannot find applicable image"
  exit 1
fi

timestamp=`echo ${image} | sed 's,.*obmc-phosphor-image-cp2-5422-\([0-9]*\).*,\1,'`

cat flash-sila-bmc.in ${image} > flash-sila-bmc-${timestamp}
chmod a+x flash-sila-bmc-${timestamp}

mkdir -p ${target_dir}
cp -a flash-sila-bmc-${timestamp} ${target_dir}/

rm -f flash-sila-bmc-${timestamp}