Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Ming Liu <ming.liu@windriver.com>, "Chen, Qi" <Qi.Chen@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] initscripts/urandom: change random-seed directory
Date: Fri, 30 Nov 2012 11:24:12 -0800	[thread overview]
Message-ID: <50B907DC.7020303@linux.intel.com> (raw)
In-Reply-To: <1354270768-5265-1-git-send-email-ming.liu@windriver.com>

On 11/30/2012 02:19 AM, Ming Liu wrote:
> /etc/init.d/urandom fails to start/stop because it tries to save
> random-seed into /var/lib/urandom folder which does not exist in the
> file system.
>
Why not create it in the recipe's do_install?  Or possibly add it to 
volatiles file.

Also talk with Qi Chen about the readonly FS stuff to make sure this 
will work.

Sau!

> Fixed by using /var/lib/misc instead of /var/lib/urandom.
>
> Signed-off-by: Ming Liu <ming.liu@windriver.com>
> ---
>   meta/recipes-core/initscripts/initscripts-1.0/urandom | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/meta/recipes-core/initscripts/initscripts-1.0/urandom b/meta/recipes-core/initscripts/initscripts-1.0/urandom
> index eb3a7c3..1cf7c5c 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/urandom
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/urandom
> @@ -14,18 +14,19 @@
>   test -c /dev/urandom || exit 0
>   . /etc/default/rcS
>
> +SAVEDFILE=/var/lib/misc/random-seed
>   case "$1" in
>   	start|"")
>   		test "$VERBOSE" != no && echo "Initializing random number generator..."
>   		# Load and then save 512 bytes,
>   		# which is the size of the entropy pool
> -		if test -f /var/lib/urandom/random-seed
> +		if test -f $SAVEDFILE
>   		then
> -			cat /var/lib/urandom/random-seed >/dev/urandom
> +			cat $SAVEDFILE >/dev/urandom
>   		fi
> -		rm -f /var/lib/urandom/random-seed
> +		rm -f $SAVEDFILE
>   		umask 077
> -		dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \
> +		dd if=/dev/urandom of=$SAVEDFILE count=1 \
>   			>/dev/null 2>&1 || echo "urandom start: failed."
>   		umask 022
>   		;;
> @@ -34,7 +35,7 @@ case "$1" in
>   		# see documentation in linux/drivers/char/random.c
>   		test "$VERBOSE" != no && echo "Saving random seed..."
>   		umask 077
> -		dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \
> +		dd if=/dev/urandom of=$SAVEDFILE count=1 \
>   			>/dev/null 2>&1 || echo "urandom stop: failed."
>   		;;
>   	*)
>



  reply	other threads:[~2012-11-30 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 10:19 [PATCH] initscripts/urandom: change random-seed directory Ming Liu
2012-11-30 19:24 ` Saul Wold [this message]
2012-12-04  3:26   ` Ming Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B907DC.7020303@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=Qi.Chen@windriver.com \
    --cc=ming.liu@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox