Run the command in the beatbox recipe, as if in a live system

Is it possible to run a command in a recipe as if it were running on a live system? If so, how? I want to import my key into gpg before creating the image, so I do not need to log in after formatting the SD card.

+4
source share
1 answer

I found a solution that includes a post install script that runs when do_rootfs is called. Everything that I added to my recipe, which installs my public key in 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
}
+6
source

All Articles