diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-03-12 14:42:20 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-03-12 14:42:20 +0100 |
commit | fdc973fa4e29cada901b9499160a0478b59cefea (patch) | |
tree | 4fd9d8666d4d788c0ae4afe3086cd68e917b67b5 /package/base-files/src/etc/init.d | |
parent | 7aaac91a674b427e42e38cc6b86ada72fdc5e417 (diff) | |
parent | 9cbc124a64439c1ac24a62ceed63efaf55e5760a (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/base-files/src/etc/init.d')
-rw-r--r-- | package/base-files/src/etc/init.d/boot | 5 | ||||
-rw-r--r-- | package/base-files/src/etc/init.d/fs | 69 | ||||
-rwxr-xr-x | package/base-files/src/etc/init.d/rcS | 4 |
3 files changed, 73 insertions, 5 deletions
diff --git a/package/base-files/src/etc/init.d/boot b/package/base-files/src/etc/init.d/boot index 8daf52b89..fc2f79ac2 100644 --- a/package/base-files/src/etc/init.d/boot +++ b/package/base-files/src/etc/init.d/boot @@ -4,11 +4,6 @@ . /etc/functions.sh -# disable kernel messages -if [ -f /proc/sys/kernel/printk ];then - echo 0 > /proc/sys/kernel/printk -fi - # remount /dev with smaller size mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev diff --git a/package/base-files/src/etc/init.d/fs b/package/base-files/src/etc/init.d/fs new file mode 100644 index 000000000..f79d9348d --- /dev/null +++ b/package/base-files/src/etc/init.d/fs @@ -0,0 +1,69 @@ +#!/bin/sh +#INIT 60 +[[ $1 = autostart ]] || exit 0 + +# activate swap +[ -x /sbin/swapon ] && { swapon -a; } + +# activate any logical volumes +[ -x /usr/sbin/lvm ] && { lvm vgscan; lvm vgchange -ay; } + +# filesystem checks +[ -x /sbin/fsck.ext2 ] && { + for i in $(grep ext2 /etc/fstab|awk '{ print $1}');do fsck.ext2 $i;done; +} +[ -x /sbin/fsck.ext3 ] && { + for i in $(grep ext3 /etc/fstab|awk '{ print $1}');do fsck.ext3 $i;done; +} +[ -x /sbin/fsck.ext4 ] && { + for i in $(grep ext4 /etc/fstab|awk '{ print $1}');do fsck.ext4 $i;done; +} +[ -x /sbin/fsck.xfs ] && { + for i in $(grep xfs /etc/fstab|awk '{ print $1}');do xfs_repair $i;done; +} +# local filesystems +grep ext2 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep ext2 /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext2 + fi +fi +grep ext3 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep ext3 /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext3 + fi +fi +grep ext4 /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep ext4 /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t ext4 + fi +fi +grep xfs /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep xfs /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t xfs + fi +fi + +# mount net filesystems (nfs/cifs) +grep nfs /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep nfs /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t nfs + fi +fi +grep cifs /proc/filesystems >/dev/null 2>&1 +if [ $? -eq 0 ];then + grep cifs /etc/fstab >/dev/null 2>&1 + if [ $? -eq 0 ];then + mount -a -t cifs + fi +fi +exit 0 diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS index d34cce6e9..9daa8f5cd 100755 --- a/package/base-files/src/etc/init.d/rcS +++ b/package/base-files/src/etc/init.d/rcS @@ -1,4 +1,8 @@ #!/bin/sh +# disable kernel messages +if [ -f /proc/sys/kernel/printk ];then + echo 0 > /proc/sys/kernel/printk +fi echo "System initialization ..." export PATH=/bin:/sbin:/usr/bin:/usr/sbin ln -s /proc/self/fd/2 /dev/stderr |