source: trunk/package/block-mount/files/fsck.sh @ 26505

Last change on this file since 26505 was 26505, checked in by cshore, 5 years ago

[package] block-mount: Reverting 26503. Was already fixed in a better way in commit 26474.

File size: 794 bytes
Line 
1#!/bin/sh
2# Copyright 2010 Vertical Communications
3# This is free software, licensed under the GNU General Public License v2.
4# See /LICENSE for more information.
5#
6
7libmount_fsck() {
8        local device="$1"
9        local fsck_fstype="$2"
10        local fsck_enabled="$3"
11        local known_type
12        local found_fsck=0
13       
14
15        grep -q "$device" /proc/swaps || grep -q "$device" /proc/mounts || {
16                [ -e "$device" ] && [ "$fsck_enabled" -eq 1 ] && {
17                        for known_type in $libmount_known_fsck; do
18                                if [ "$known_type" = "$fsck_fstype" ]; then
19                                        fsck_${known_type} "$device"
20                                        found_fsck=1
21                                        break
22                                fi
23                        done
24                        if [ "$found_fsck" -ne 1 ]; then
25                                logger -t 'fstab' "Unable to check/repair $device; no known fsck for filesystem type $fstype"
26                        fi
27                }
28        }
29}
30
31libmount_known_fsck=""
32
33pi_include /lib/functions/fsck
34
Note: See TracBrowser for help on using the repository browser.