initial version of scripts, config and debian package
[moebian] / install / etc / event.d / rcS-late
1 description "late rcS actions"
2
3 start on started xomap
4 stop on stopping bme
5
6 console none
7
8 script
9     # Generate fstab and mount /home
10     . /etc/default/mount-opts
11
12     grep '^/.* /home ' /etc/fstab && /bin/mount /home || echo "Failed to mount /home partition."
13
14     if [ ! -d /home/user ]
15     then
16       if [ -d /home/preinstalled ]
17       then
18         mv /home/preinstalled /home/user
19       else
20         mkdir /home/user
21       fi
22       cd /etc/skel
23       cp -a . /home/user
24       chown -R user:users /home/user
25     fi
26
27     # We can safely continue booting now.
28     initctl emit MOUNTS_OK
29
30     /sbin/swapon -a || echo "Failed to enable paging partition."
31
32     # Setup lowmem module
33     echo 32768  > /proc/sys/vm/lowmem_deny_watermark_pages
34     echo 98304  > /proc/sys/vm/lowmem_notify_high_pages
35     echo 131072 > /proc/sys/vm/lowmem_notify_low_pages
36     echo 1024   > /proc/sys/vm/lowmem_nr_decay_pages
37
38     # Exclude some UIDs from memory allocation denial.
39     # 30000 is messagebus, 30001 could be used by Matchbox
40     echo "30000 30001 30002 30003" > /proc/sys/vm/lowmem_allowed_uids
41
42     # Adjust flushing of memory card buffers
43     echo 40 > /proc/sys/vm/dirty_ratio
44     echo 10 > /proc/sys/vm/dirty_background_ratio
45
46     # Initialize PRNG pool with the HW RNG. Slow, but that's ok.
47     URANDOM_POOLSZ=512
48     if [ -e /dev/hwrng ]; then
49       echo "Seeding entropy pool"
50       dd if=/dev/hwrng of=/dev/urandom bs=$URANDOM_POOLSZ count=1
51     fi
52
53     # Data for the panic info driver
54     mount -t debugfs nodev /sys/kernel/debug
55     modprobe panic_info_buff
56     sleep 1
57     osso-product-info > /sys/kernel/debug/panic_info_buff
58 end script
59
60 normal exit 0