Comment 5 for bug 1807030

Revision history for this message
Ryan Harper (raharper) wrote :

This is not a curtin bug. In your config, you're providing a late_commands which invoke grep and do not eat the return code, so if grep fails to find it's query, it returns 1 and this fails the install (one or more of the late_commands failed).

From config:

late_commands:
  01_efivars:
  - grep
  - efi
  - /proc/mounts
  02_efimnt:
  - mountpoint
  - /sys/firmware/efi/efivars
  03_hexdump:
  - curtin
  - in-target
  - --
  - sh
  - -c
  - 'grep efi /proc/mounts

From the install log we can see install was OK, but late_commands which run after install is complete failed:

Installation finished. No error reported.
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpmg3cwxp7/target/sys'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpmg3cwxp7/target/proc'] with allowed return codes [0] (capture=False)
Running command ['umount', '/tmp/tmpmg3cwxp7/target/dev'] with allowed return codes [0] (capture=False)
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: SUCCESS: curtin command curthooks
start: cmd-install/stage-hook/builtin/cmd-hook: curtin command hook
Finalizing /tmp/tmpmg3cwxp7/target
finish: cmd-install/stage-hook/builtin/cmd-hook: SUCCESS: curtin command hook
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['grep', 'efi', '/proc/mounts']
Exit code: 1