| 1 | # 270_overrule_migration_mode.sh |
| 2 | # Tricky script where we overrule the variable MIGRATION_MODE if it was set to true. |
| 3 | # This means that rear recover could fail because of disk size mismatches, but we give it try. |
| 4 | # The 'unattended' parameter must be present on the boot command line - for the moment |
| 5 | # this feature will only be used by automated PXE booting. |
| 6 | |
| 7 | # Nothing to do unless MIGRATION_MODE has a 'true' value: |
| 8 | is_true "$MIGRATION_MODE" || return 0 |
| 9 | |
| 10 | for kernel_command_line_parameter in $( cat /proc/cmdline ) ; do |
| 11 | if test 'unattended' = "$kernel_command_line_parameter" ; then |
| 12 | # In etc/rear/local.conf or via layout/prepare/default/250_compare_disks.sh the user may have |
| 13 | # enforced MIGRATION_MODE by setting the special 'TRUE' value in upper case letters |
| 14 | # that overrules switching off migration mode due to 'unattended' kernel option: |
| 15 | if test 'TRUE' = "$MIGRATION_MODE" ; then |
| 16 | LogPrint "User enforced manual disk layout configuration overrules 'unattended' recovery" |
| 17 | return |
| 18 | fi |
| 19 | LogPrint "Switching off manual disk layout configuration (MIGRATION_MODE) due to 'unattended' kernel option" |
| 20 | MIGRATION_MODE='false' |
| 21 | return |
| 22 | fi |
| 23 | done |
| 24 |