Is it possible to run a command in a recipe as if it were run on the live system? If so, how? I want to import my key(s) into gpg before the image is created so I don't have to log onto the system after formatting the SD card.
I found a solution that involves specifying a post install script that runs when do_rootfs is called. All I added to my recipe which installs my public key on the system is below:
pkg_postinst_${PN}() {
#!/bin/sh
if [ -n "$D" ]; then
OPT="--homedir $D/home/root/.gnupg"
else
OPT=""
fi
gpg $OPT --import ${D}${datadir}/mykey.gpg
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With