[PATCH] 2.4 drivers_char_random.c fix sample shellscripts

[PATCH] 2.4 drivers_char_random.c fix sample shellscripts

Post by Dave Maiett » Mon, 16 Sep 2002 04:20:06



This fixes the sample shellscripts given in the comments of
drivers/char/random.c.
The scripts save and restore random seeds for /dev/random across reboots.

--- linux/drivers/char/random.c.orig    2002-09-14 14:56:03.000000000 -0400

   *    chmod 600 $random_seed
   *    poolfile=/proc/sys/kernel/random/poolsize
   *    [ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
- *     dd if=/dev/urandom of=$random_seed count=1 bs=bytes
+ *     dd if=/dev/urandom of=$random_seed count=1 bs=$bytes
   *
   * and the following lines in an appropriate script which is run as

   *    chmod 600 $random_seed
   *    poolfile=/proc/sys/kernel/random/poolsize
   *    [ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
- *     dd if=/dev/urandom of=$random_seed count=1 bs=bytes
+ *     dd if=/dev/urandom of=$random_seed count=1 bs=i$bytes
   *
   * For example, on most modern systems using the System V init
   * scripts, such code fragments would be found in

Dave Maietta
37167 North Orchard Cr #4-60
Westland MI 48186
734-326-3059
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] 2.4 drivers_char_random.c fix sample shellscripts

Post by Dave Maiett » Thu, 19 Sep 2002 08:50:10


[tyop in first sumbissoin, fixed here]
This fixes the sample shellscripts given in the comments of
drivers/char/random.c.
The scripts save and restore random seeds for /dev/random across reboots.

--- linux/drivers/char/random.c.orig    2002-09-14 14:56:03.000000000 -0400

   *    chmod 600 $random_seed
   *    poolfile=/proc/sys/kernel/random/poolsize
   *    [ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
- *     dd if=/dev/urandom of=$random_seed count=1 bs=bytes
+ *     dd if=/dev/urandom of=$random_seed count=1 bs=$bytes
   *
   * and the following lines in an appropriate script which is run as

   *    chmod 600 $random_seed
   *    poolfile=/proc/sys/kernel/random/poolsize
   *    [ -r $poolfile ] && bytes=`cat $poolfile` || bytes=512
- *     dd if=/dev/urandom of=$random_seed count=1 bs=bytes
+ *     dd if=/dev/urandom of=$random_seed count=1 bs=$bytes
   *
   * For example, on most modern systems using the System V init
   * scripts, such code fragments would be found in

Dave Maietta
North Orchard Cr #4-60
Westland MI 48186
734-326-3059
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. PATCH: specialix fix from 2.4 missing in 2.5

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/drivers/char/sx.c linux-2.5.61-ac1/drivers/char/sx.c
--- linux-2.5.61/drivers/char/sx.c      2003-02-15 03:39:30.000000000 +0000

                        return 0;
        }

+       /* Now we're pretty much convinced that there is an SI board here,
+          but to prevent trouble, we'd better double check that we don't
+          have an SI1 board when we're probing for an SI2 board.... */
+
+       write_sx_byte (board, SI2_ISA_ID_BASE,0x10);
+       if ( IS_SI1_BOARD(board)) {
+               /* This should be an SI1 board, which has this
+                  location writable... */
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10)
+                       return 0;
+       } else {
+               /* This should be an SI2 board, which has the bottom
+                  3 bits non-writable... */
+               if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10)
+                       return 0;
+       }
+
        printheader ();

        printk (KERN_DEBUG "sx: Found an SI board at %lx\n", board->hw_base);

--
Dim rhyfel mewn ein enw ni
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Runpipe v1.0 beta

3. patch - tdfxfb fixes for 2.4.x

4. Can you switch mouse buttons in X?

5. [PATCH][2.4] fix permissions in /proc

6. Just got 2.0, now no PPP

7. [2.4] reiserfs: parser fix patch

8. NIC Question on Solaris 8

9. Patch to fix TIOCGWINSZ/ioctl/telnet problem (2.4)?

10. [2.4] reiserfs: parser fix patch, resend

11. 2.4: Minor build fix for ext3 (2.4 and 2.5)

12. 2.4 iget5_locked port attempt to 2.4 (supposedly fixed NFS version this time)

13. PATCH: fix ALi 32bitisms, fix ALi FIFO, fix ALi IRQ crash