File system check always uses fsck.ext4, even when inappropriate

Issue #737 resolved
prl created an issue

MENU>Setup>Storage>File system check always uses /sbin/fsck.ext4 to do the file system check, even on file systems that aren’t in the ext family, and even though the firmware contains checkers for vfat and exfat.

The file system selection list in File system check should use an appropriate file system check program when possible, and disable and grey out entries in the list where no suitable checker is available.

Replication

Format a USB drive as FAT or exFAT, and connect it to the PVR. In MENU>Setup>Storage>File system check, select that file system to check and proceed with the check.

The check will start and then fail with an error popup, because an inapporpriate file system check program (/sbin/fsck.ext4) has been used.

Comments (5)

  1. Peter Urbanec

    You’ll probably find the following command very handy for identifying the file systems:

    root@devv2:~# blkid -c /dev/null -s TYPE
    /dev/mmcblk0p3: TYPE="vfat"
    /dev/mmcblk0p13: TYPE="ext4"
    /dev/sdb1: TYPE="ext4"
    

  2. Peter Urbanec

    Fix bug #737: File system check always uses fsck.ext4, even when inappropriate

    [Harddisk]

    Add function getRealFsType() to get a partition's actual file system type in cases where it can't be determined from the mount table (e.g. where it's a FUSE mount).

    Use getRealFsType() in getProcMounts() to use the actual file system on FUSE mounts.

    Add fsckOpts to Harddisk to list the program name and parameters used to check different file system types.

    Add attribute fs_type to Harddisk instances to hold the (first mounted) partition's filesystem type.

    In createCheckJob(), replace explicit tests on whether ext4 is supported on the system with a lookup of fsckOpts to find the appropriate fsck program and its parameters.

    If no appropriate fsck program can be found for a partition, createCheckJob() returns None.

    [HarddiskSetup]

    Allow for createCheckJob() (or any other Job creator in Harddisk) returning None. Only a generic error can be given at this point in the code.

    → <<cset 51563886a04e>>

  3. Peter Urbanec

    Fix bug #737: Improve HDD selection in storage format/check

    [Harddisk]

    Copy the list of user-friendly named for filesystem types from Screens.Action into Partition, remove the fake-up of the translation of fuseblk to NTFS, and add some more filesysteem types. Make the user-friendly filesystem type name translatable. Add getFsUserFriendlyType() to Partition to convert a system filesystem type into a user-friendly one, and add getFsUserFriendlyType( to Harddisk to return the user-friendly filesystem type of the HDD's first mounted partition.

    Add a method checkIsSupported() to indicate whether Harddisk has an options table entry for the filesystem and that its fsck program is available.

    [HarddiskSetup]

    When the menu list is constructed, call method isSelectable() on each item to allow subclasses to control whether list entries can be selected. Add an always-True isSelectable() HarddiskSelection, and add an isSelectable() to HarddiskFsckSelection thal only allows checking to be run on HDDs that have the necessary checkers.

    Adjust the menu list to the width and item height of its skin. Add a second entry in each list element for the filesystem type. Remove unused font=1 definition, and forced item height from the code.

    Remove unnecessary and incorrect translations in SubHarddiskMenuEntryComponent to allow passing None as the item argument to make an entry non-seectable. Grey out unselectable items.

    Change the "Job can not be run" popup in hddConfirmed() to be headed by "Internal error", since that error should not be able to occur.

    → <<cset a45b12c2fd71>>

  4. Log in to comment