Bug#767471: [initramfs-tools] / formatted as ext3 but mounted as ext4 not fsck-able
Package: initramfs-tools
Version: 0.118
Severity: normal
--- Please enter the report below this line. ---
I have a ext3 formatted / which in /etc/fstab is mounted with ext4. This
does not cope well with the logic in hooks/fsck which assumes that
fsck.$fs will work with a filesystem entry $fs in /etc/fstab. So at boot
the initramfs warns that fsck.ext3 is missing and cannot do the check on
/. This may not be a common case but still a fsck error or warning at
boot for / it's annoying.
I've attached an untested patch with a tentative fix.
--- System information. ---
Architecture: i386
Kernel: Linux 3.16.6
Debian Release: jessie/sid
500 unstable ftp.de.debian.org
1 experimental ftp.de.debian.org
--- Package information. ---
Depends (Version) | Installed
=================================-+-============
klibc-utils (>= 2.0-1~) | 2.0.4-2
cpio | 2.11+dfsg-2
kmod | 18-3
OR module-init-tools | 18-3
udev | 215-5+b1
Recommends (Version) | Installed
====================================-+-===============
busybox (>= 1:1.01-3) | 1:1.22.0-9
OR busybox-initramfs |
OR busybox-static |
Suggests (Version) | Installed
==============================-+-===========
bash-completion |
--- Output from package bug script ---
-- initramfs sizes
-rw-r--r-- 1 root root 4,9M ago 13 12:02 /boot/initrd.img-3.14.16
-rw-r--r-- 1 root root 4,9M ott 6 12:07 /boot/initrd.img-3.16.4
-rw-r--r-- 1 root root 5,4M ott 27 11:39 /boot/initrd.img-3.16.5
-rw-r--r-- 1 root root 4,7M ott 28 11:31 /boot/initrd.img-3.16.6
-- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.16.6
root=UUID=770e4e60-f57b-4299-a18d-ed558a68d750 ro quiet
acpi_backlight=vendor
-- resume
RESUME=/dev/sda3
-- /proc/filesystems
ext3
ext2
ext4
fuseblk
-- lsmod
Module Size Used by
dm_mod 79494 0
iptable_filter 1762 0
ip_tables 15195 1 iptable_filter
x_tables 21829 2 ip_tables,iptable_filter
ctr 3857 1
ccm 7451 1
cpufreq_stats 3136 0
bnep 10410 2
bluetooth 241284 5 bnep
uinput 7665 1
ipv6 316592 26
cuse 6277 0
fuse 75002 2 cuse
joydev 8792 0
loop 17367 0
uvcvideo 64359 0
videobuf2_vmalloc 2968 1 uvcvideo
videobuf2_memops 2410 1 videobuf2_vmalloc
videobuf2_core 25764 1 uvcvideo
v4l2_common 6110 1 videobuf2_core
videodev 129098 3 uvcvideo,v4l2_common,videobuf2_core
i915 797927 3
fbcon 34821 71
bitblit 4640 1 fbcon
iTCO_wdt 5736 0
softcursor 1349 1 bitblit
arc4 2072 2
sdhci_pci 11598 0
iwldvm 110824 0
mac80211 450072 1 iwldvm
cfbfillrect 3317 1 i915
cfbimgblt 2296 1 i915
i2c_algo_bit 5374 1 i915
sdhci 24389 1 sdhci_pci
snd_hda_codec_hdmi 34683 2
mmc_core 97042 1 sdhci
snd_hda_codec_realtek 58964 1
snd_hda_codec_generic 48330 1 snd_hda_codec_realtek
pcspkr 2054 0
font 8131 1 fbcon
tileblit 2239 1 fbcon
samsung_laptop 9075 0
coretemp 5905 0
cfbcopyarea 3017 1 i915
psmouse 59351 0
e1000e 147839 0
evdev 10197 23
snd_hda_intel 20239 6
iwlwifi 88968 1 iwldvm
snd_hda_controller 20981 1 snd_hda_intel
snd_hda_codec 115704 5
snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
yenta_socket 20471 0
pcmcia_rsrc 1301 1 yenta_socket
cfg80211 464686 3 iwlwifi,mac80211,iwldvm
snd_hwdep 6187 1 snd_hda_codec
pcmcia_core 15627 1 yenta_socket
snd_pcm 86549 4
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
serio_raw 4666 0
drm_kms_helper 41936 1 i915
lpc_ich 13821 0
drm 276323 5 i915,drm_kms_helper
mfd_core 3603 1 lpc_ich
snd_timer 19153 1 snd_pcm
thermal 9844 0
i2c_i801 9223 0
i2c_core 43251 7
drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit,v4l2_common,videodev
battery 10068 0
fan 2914 0
acpi_cpufreq 7317 1
snd 66690 20
snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
uhci_hcd 20007 0
ptp 11299 1 e1000e
fb 53541 6
i915,fbcon,drm_kms_helper,softcursor,tileblit,bitblit
video 14778 2 i915,samsung_laptop
processor 27061 3 acpi_cpufreq
soundcore 6676 2 snd,snd_hda_codec
ehci_pci 3650 0
ehci_hcd 37716 1 ehci_pci
backlight 8165 3 i915,video,samsung_laptop
fbdev 1065 2 fb,fbcon
ac 3973 0
button 5583 1 i915
pps_core 7345 1 ptp
intel_agp 11368 0
thermal_sys 22339 4 fan,video,thermal,processor
intel_gtt 12812 3 i915,intel_agp
-- /etc/initramfs-tools/modules
-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto
-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no
-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:
/usr/share/initramfs-tools/hooks:
btrfs
busybox
dmsetup
fsck
fuse
intel_microcode
keymap
klibc
kmod
lvm2
mountall
ntfs_3g
plymouth
resume
thermal
udev
uswsusp
zz-busybox
diff --git a/hooks/fsck b/hooks/fsck
index cc860b5..d8efa58 100755
--- a/hooks/fsck
+++ b/hooks/fsck
@@ -77,6 +77,20 @@ get_fstypes() {
get_fstype /usr
}
+copy_fsck_prog() {
+ fstype=$1
+ prog="/sbin/fsck.${fstype}"
+ if [ -h "$prog" ]; then
+ link=$(readlink -f "$prog")
+ copy_exec "$link"
+ ln -s "$link" "${DESTDIR}/$prog"
+ elif [ -x "$prog" ] ; then
+ copy_exec "$prog"
+ else
+ echo "Warning: /sbin/fsck.${fstype} doesn't exist, can't install to initramfs, ignoring."
+ fi
+}
+
case $1 in
prereqs)
prereqs
@@ -114,14 +128,10 @@ for type in $(get_fstypes | sort | uniq); do
continue
fi
- prog="/sbin/fsck.${type}"
- if [ -h "$prog" ]; then
- link=$(readlink -f "$prog")
- copy_exec "$link"
- ln -s "$link" "${DESTDIR}/$prog"
- elif [ -x "$prog" ] ; then
- copy_exec "$prog"
- else
- echo "Warning: /sbin/fsck.${type} doesn't exist, can't install to initramfs, ignoring."
+ copy_fsck_prog "$type"
+ # ext4 can mount ext3 filesystems but even when mount with ext4, the ext3 fsck would
+ # be called by e2fsck. So copy ext3 to be sure. Better safe than sorry
+ if [ "$type" = 'ext4' ] ; then
+ copy_fsck_prog 'ext3'
fi
done
Reply to: