[OE-core] Setting root password
Koen Kooi
koen at dominion.thruhere.net
Fri Oct 11 15:08:16 UTC 2013
Op 11 okt. 2013, om 16:35 heeft Jack Mitchell <ml at communistcode.co.uk> het volgende geschreven:
> What is the best way to set the root password for an image during build
> time?
>
> I have come across this snippet:
>
> ROOTFS_POSTPROCESS_COMMAND += " \
> sed 's%^root:[^:]*:%root:${PASSWD}:%' \
> < ${IMAGE_ROOTFS}/etc/shadow \
>> ${IMAGE_ROOTFS}/etc/shadow.new;\
> mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;"
>
> but it feels a bit hacky...
indeed, gnu sed has had a -i option for some years now, no needs to that intermediate file.
More information about the Openembedded-core
mailing list