Add custom first boot script

The first boot script is the one executed when the memory card is
freshly flashed and run on the board, this script is to initiate OS
environment. This custom script will genenate new secure keys in
/etc/ssh and back up to vendor partition using 'overlayroot' script.

Change-Id: Ibe84da3e33ffc893c319a9253793037c93a250fa
This commit is contained in:
Dongjin Kim
2021-05-08 05:07:05 +09:00
parent 343b995c00
commit 13f01b7824

View File

@@ -0,0 +1,20 @@
#!/bin/bash
STAMP=/overlay/vendor/.stamp_sshkey
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
if [ ! -f $STAMP ]; then
ssh-keygen -A
/usr/sbin/overlay-backup vendor
mount -o remount,rw /overlay/vendor
touch $STAMP
mount -o remount,ro /overlay/vendor
fi
exit 0