Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
sigfile="/tmp/bmc.sig"
|
||||
imagebmc="/run/initramfs/image-bmc"
|
||||
bmcimage="/run/initramfs/bmc-image"
|
||||
publickey="/etc/activationdata/OpenBMC/publickey"
|
||||
bmclog="/tmp/update-bmc.log"
|
||||
|
||||
if [ -f $publickey ];then
|
||||
r="$(openssl dgst -verify $publickey -sha256 -signature $sigfile $bmcimage)"
|
||||
echo "$r" > $bmclog
|
||||
if [ "Verified OK" = "$r" ]; then
|
||||
mv $bmcimage $imagebmc
|
||||
rm -f $sigfile
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "No $publickey file" > $bmclog
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,21 @@
|
||||
[{
|
||||
"blob": "/flash/image",
|
||||
"handler": {
|
||||
"type": "file",
|
||||
"path": "/run/initramfs/bmc-image"
|
||||
},
|
||||
"actions": {
|
||||
"preparation": {
|
||||
"type": "skip"
|
||||
},
|
||||
"verification": {
|
||||
"type": "systemd",
|
||||
"unit": "phosphor-ipmi-flash-bmc-verify.service"
|
||||
},
|
||||
"update": {
|
||||
"type": "systemd",
|
||||
"unit": "reboot.target",
|
||||
"mode": "replace-irreversibly"
|
||||
}
|
||||
}
|
||||
}]
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Phosphor-ipmi-flash bmc verify service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/bmc-verify.sh
|
||||
Type=oneshot
|
||||
|
||||
[Install]
|
||||
WantedBy=phosphor-ipmi-flash-bmc-verify.target
|
||||
Reference in New Issue
Block a user