Skip to content

fng-install: mount back everything that was mounted before script started

Dmitry Petrov requested to merge restore-mounted-partititons into main

This is the most straight-forward fix for issue [746-001533] Error: /etc/shared isn't mounted after fng-install was run.

The essence of this approach is to add two new common functions to fng-install.sh.in:

  • "store_mount" will save the content of /proc/mounts. It will be run before umount_emmc is called the first time;
  • "restore_mount" will check that all partitions listed by store_mount are still mounted. And, if not, it will remount missing partitions. This routine will be called at the end of the cleanup function.

We decided to choose this options because of the following findings/logic:

  1. We found that the problem cannot be reproduced on iMX6 boards. After further digging, it was discovered that /dev/mmcblk0boot1, which contains /etc/shared, is not unmounted by umount_emmc function when fng-install.sh is issued. By contrast, on iMX8 boards, /etc/shared belongs to /dev/mmcblk0p3 due to PART_SCHEMA=2 and this partition is unmounted by umount_emmc function when fng-install.sh is started because mmcblk0p3 is not a "boot" eMMC partitions which are ignored.

And the provided solution/MR covers both cases (iMX6 and iMX8) and no additional logic is needed.

  1. Statements from SECO:
TODO: rethink the partitioning umount:
- everything is unmounted, no matter if partitioning is done or not
- This should be adapted, so only the partitions needed to be unmount are really unmount

TODO: Check why /etc/shared is unmounted in fng-install
 
TODO: Adapt fng-install, so that /etc/shared isn't unmounted anymore

This can be investigated, but we think that it will take reasonable time to understand and to rework logic for handling boot partitions on particular boards. Moreover we will need to check all boards (even not available for us) to unify logic of mounting/unmounting everywhere.

For example, if we will skip umounting of /etc/shared by umount_emmc in fng-install, there is a chance that eMMC will be repartitioned on next steps of fng-install, when it will be invoked with particular arguments. And we can't predict what will happen in this case.

As a result, we decided to implement some straightforward mechanism which will work everywhere out of box and that will affect only a partition with /etc/shared. So, we've followed a following statement from SECO: "Eventually add a remount to the initial state in the cleanup step (store the mount state, /etc/mtab or /proc/mount)"

But if rework of mount/umount logic in fng-install.sh should be done it's better to address this in separate task.

  1. Results of testing:
Test installation:  
 - running FNG System 15, install Yocto
 - running FNG System 15, install FNG System
 - running FNG System 3X, install Yocto
 - running FNG System 3X, install FNG System
 - A-B in Yocto

We successfully tested this MR on all system listed above both on iMX6 and on iMX8 except for:

  • FNG System 15 (installation of Yocto and FNG System) on iMX8(Tanaro), as we failed to find FNG System version 15 for this board;
  • AB Yocto test for iMX6.

Merge request reports

Loading