Skip to content

Commit 07b7631

Browse files
committed
Merge branch 'github-pull-51'
For different implementations of fsck for different filesystems, it may be necessary to pass non-standard options. Or even rewrite all options passed to fsck. * github-pull-51: feature/fsck: Add fsck arguments support Signed-off-by: Alexey Gladkov <[email protected]>
2 parents 1af6724 + 1036da9 commit 07b7631

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

features/fsck/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ appear that cannot be fixed, a shell will be opened for repair.
77
## Boot parameters
88

99
- `no-fsck`, `fastboot` disables fsck execution.
10+
11+
## Parameters
12+
13+
- **FSCK_ARGS** -- Specifies fsck arguments. By default `-p`.

features/fsck/config.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-3.0-or-later
22
FSCK_DATADIR ?= $(FEATURESDIR)/fsck/data
33
FSCK_FILES ?=
4+
FSCK_ARGS ?=

features/fsck/data/lib/uevent/handlers/040-mountdev

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
. shell-locks
66
. shell-source
77

8-
FSCK_ARGS="-p"
98
source_if_exists /etc/sysconfig/fsck
109

1110
. /etc/init.d/functions
@@ -30,7 +29,7 @@ handler()
3029

3130
rootdelay_pause
3231

33-
action "Checking filesystem [$MOUNTDEV]:" fsck -t noloop,noswap -T "$MOUNTDEV" -- $FSCK_ARGS ||
32+
action "Checking filesystem [$MOUNTDEV]:" fsck -t noloop,noswap -T "$MOUNTDEV" -- ${FSCK_ARGS-} ||
3433
rc=$?
3534

3635
if [ "$rc" = 0 ] || [ "$rc" = 1 ]; then

features/fsck/rules.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ $(call assign-shell-once,FSCK_RUNTIME_FILES,$(FEATURESDIR)/fsck/bin/find-files)
55
PUT_FEATURE_DIRS += $(FSCK_DATADIR)
66
PUT_FEATURE_FILES += $(FSCK_FILES) $(FSCK_RUNTIME_FILES)
77

8+
ifeq ($(FSCK_ARGS),)
9+
FSCK_ARGS = -p
10+
811
VENDOR =
912
ifneq ($(wildcard /etc/os-release),)
1013
VENDOR := $(shell sed -n -e 's/^ID=//p' /etc/os-release)
1114
endif
1215

1316
ifeq ($(VENDOR),altlinux)
14-
$(call set-sysconfig,fsck,FSCK_ARGS,-p -y)
17+
FSCK_ARGS += -y
18+
endif
1519
endif
20+
21+
$(call set-sysconfig,fsck,FSCK_ARGS,$(FSCK_ARGS))

0 commit comments

Comments
 (0)