• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/initscripts/init.d/S20urandom
Maxime HadjinlianMaxime Hadjinlian committed 0f75b2635ee03 Oct 2015
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
#! /bin/sh
2
#
3
# urandom   This script saves the random seed between reboots.
4
#       It is called from the boot, halt and reboot scripts.
5
#
6
# Version:  @(#)urandom  1.33  22-Jun-1998  miquels@cistron.nl
7
#
8
​
9
[ -c /dev/urandom ] || exit 0
10
#. /etc/default/rcS
11
​
12
case "$1" in
13
    start|"")
14
        # check for read only file system
15
        if ! touch /etc/random-seed 2>/dev/null
16
        then
17
            echo "read-only file system detected...done"
18
            exit
19
        fi
20
        if [ "$VERBOSE" != no ]
21
        then
22
            printf "Initializing random number generator... "
23
        fi
24
        # Load and then save 512 bytes,
25
        # which is the size of the entropy pool
26
        cat /etc/random-seed >/dev/urandom
27
        rm -f /etc/random-seed
28
        umask 077
29
        dd if=/dev/urandom of=/etc/random-seed count=1 \
30
            >/dev/null 2>&1 || echo "urandom start: failed."
31
        umask 022
32
        [ "$VERBOSE" != no ] && echo "done."
33
        ;;
34
    stop)
35
        if ! touch /etc/random-seed 2>/dev/null
36
                then
37
                        exit
38
                fi
39
        # Carry a random seed from shut-down to start-up;
40
        # see documentation in linux/drivers/char/random.c
41
        [ "$VERBOSE" != no ] && printf "Saving random seed... "
42
        umask 077
43
        dd if=/dev/urandom of=/etc/random-seed count=1 \
44
            >/dev/null 2>&1 || echo "urandom stop: failed."
45
        [ "$VERBOSE" != no ] && echo "done."
46
        ;;
47
    *)
48
        echo "Usage: urandom {start|stop}" >&2
49
        exit 1
50
        ;;
51
esac
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.