diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-05-10 12:16:29 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-05-10 12:16:29 +0200 |
commit | a7734d41b583d39dd521438d4de292f8c531557c (patch) | |
tree | b1fe44f94490c20371ae2c2c8f665f39b06284f6 /package/base-files | |
parent | f58884abc002ffd7b9b7d36bd32231fa4ba7542d (diff) |
avoid automount of root disk partitions in mdev script
Diffstat (limited to 'package/base-files')
-rw-r--r-- | package/base-files/Makefile | 2 | ||||
-rwxr-xr-x | package/base-files/src/etc/init.d/fs | 4 | ||||
-rwxr-xr-x | package/base-files/src/etc/mdev/fs | 17 |
3 files changed, 14 insertions, 9 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index ceb20837a..90a30d24b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 89 +PKG_RELEASE:= 90 PKG_SECTION:= base PKG_DESCR:= basic files and scripts diff --git a/package/base-files/src/etc/init.d/fs b/package/base-files/src/etc/init.d/fs index 8bde402ec..2054d5426 100755 --- a/package/base-files/src/etc/init.d/fs +++ b/package/base-files/src/etc/init.d/fs @@ -18,14 +18,14 @@ for part in $rootparts; do fstype=$(grep "^$part" /etc/fstab|awk '{ print $3 }') mnt=$(grep "^$part" /etc/fstab|awk '{ print $2 }') [ -x /usr/sbin/fsck.$fstype ] && { - logger -t fs -s "Checking $fstype filesystem on $part" + logger -s "Checking $fstype filesystem on $part" fsck -p -t $fstype $part } grep $fstype /proc/filesystems >/dev/null 2>&1 if [ $? -eq 0 ];then mount $mnt else - logger -t fs -s "Filesystem $fstype not in kernel" + logger -s "Filesystem $fstype not in kernel" exit 1 fi done diff --git a/package/base-files/src/etc/mdev/fs b/package/base-files/src/etc/mdev/fs index c50857964..cbb031453 100755 --- a/package/base-files/src/etc/mdev/fs +++ b/package/base-files/src/etc/mdev/fs @@ -1,4 +1,9 @@ #!/bin/sh +# skip root disk here, will be handled in /etc/init.d/fs +rootdisk=$(readlink /dev/root) +if [ ${rootdisk} = ${MDEV} ];then + exit 0 +fi uuid=$(blkid /dev/${MDEV} | sed -n '/^.*UUID="\([^"]*\)".*$/s//\1/p') if [ -z $uuid ];then fs=$(grep "^/dev/${MDEV}[[:blank:]]" /etc/fstab | awk '{ print $3 }') @@ -10,7 +15,7 @@ else disk="${MDEV} (${uuid})" fi if [ -z $fs ];then - logger -t fs -s "Disk $disk not registered in /etc/fstab" + logger -s "Disk $disk not registered in /etc/fstab" exit 0 fi @@ -22,7 +27,7 @@ fi # filesystem check adk_fsck() { [ -x /usr/sbin/fsck.$fs ] && { - logger -t fs -s "Checking $fs filesystem on $disk" + logger -s "Checking $fs filesystem on $disk" fsck -p -t $fs ${MDEV} } } @@ -32,19 +37,19 @@ adk_mount() { mkdir -p $mnt >/dev/null 2>&1 grep $procfs /proc/filesystems >/dev/null 2>&1 if [ $? -eq 0 ];then - logger -t fs -s "Mounting $disk to $mnt" + logger -s "Mounting $disk to $mnt" mount $mnt if [ $? -ne 0 ];then - logger -t fs -s "Mounting $disk failed" + logger -s "Mounting $disk failed" fi else - logger -t fs -s "Required filesystem $procfs not available" + logger -s "Required filesystem $procfs not available" fi } case "${ACTION}" in add) - logger -t fs -s "Device ${MDEV} added to the system" + logger -s "Device ${MDEV} added to the system" adk_fsck adk_mount ;; |