I tried to add this in my local conf
PACKAGECONFIG_remove = " split-mender-config"
MENDER_PERSISTENT_CONFIGURATION_VARS = "RootfsPartA RootfsPartB"
IMAGE_INSTALL_append = " mender-migrate-configuration"
PREFERRED_VERSION_pn-mender-artifact = "2.0.%"
PREFERRED_VERSION_pn-mender-artifact-native = "2.0.%"
MENDER_ARTIFACT_EXTRA_ARGS_append = " -v 2"
with also the suggested MENDER_ARTIFACT_EXTRA_ARGS_append = " -v 2"
I signed the .mender file using the sign command, instead of write with -v 2.
It worked! I migrated from 1.7.0 to 2.1.0 warrior with success. The split worked as expected.
These are my config files after the migration from 1.7.0 to 2.1.0:
/etc/mender/mender.conf:
{
"ArtifactVerifyKey": "/etc/mender/artifact-verify-key.pem",
"InventoryPollIntervalSeconds": 28800,
"RetryPollIntervalSeconds": 300,
"ServerURL": "MY_SERVER",
"TenantToken": "dummy",
"UpdatePollIntervalSeconds": 1800
}
and /data/mender/mender.conf is:
{
"RootfsPartA": "/dev/mmcblk1p2",
"RootfsPartB": "/dev/mmcblk1p3"
}
If I run mount
at this point, I get that the current partition is /dev/mmcblk1p3. It’s ok.
Then I tried to upgrade again to a 2.1.0 warrior firmware with artifact version 3 with all this stuff commented:
#PACKAGECONFIG_remove = " split-mender-config"
#MENDER_PERSISTENT_CONFIGURATION_VARS = "RootfsPartA RootfsPartB"
#IMAGE_INSTALL_append = " mender-migrate-configuration"
#PREFERRED_VERSION_pn-mender-artifact = "2.0.%"
#PREFERRED_VERSION_pn-mender-artifact-native = "2.0.%"
#MENDER_ARTIFACT_EXTRA_ARGS_append = " -v 2"
But the result is a failure with rollback. This is the log:
2019-10-09 14:11:32 +0000 UTC info: Running Mender version 2.1.0
2019-10-09 14:11:32 +0000 UTC debug: handle update fetch state
2019-10-09 14:11:32 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:11:32 +0000 UTC debug: Received fetch update response &{200 OK 200 HTTP/1.1 1 1 map[Accept-Ranges:[bytes] Content-Length:[90675712] Content-Security-Policy:[block-all-mixed-content] Content-Type:[application/vnd.mender-artifact] Date:[Wed, 09 Oct 2019 14:11:32 GMT] Etag:["cae6a22392cad63831f072a4ab3d0d97"] Last-Modified:[Wed, 09 Oct 2019 14:11:05 GMT] Server:[Minio/RELEASE.2018-11-22T02-51-56Z (linux; amd64)] Vary:[Origin] X-Amz-Request-Id:[15CBFFEE0A849925] X-Minio-Deployment-Id:[7440c984-0cb7-41ab-9e65-c77bf1a96b2a] X-Xss-Protection:[1; mode=block]] 0x200e820 90675712 [] false false map[] 0x2076880 0x2067560}+
2019-10-09 14:11:32 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2019-10-09 14:11:33 +0000 UTC debug: handle update install state
2019-10-09 14:11:33 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:11:33 +0000 UTC debug: Read data from device manifest file: device_type=mydevice-staging
2019-10-09 14:11:33 +0000 UTC debug: Current manifest data: mydevice-staging
2019-10-09 14:11:33 +0000 UTC info: Update Module path "/usr/share/mender/modules/v3" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available
2019-10-09 14:11:33 +0000 UTC info: installer: authenticated digital signature of artifact
2019-10-09 14:11:33 +0000 UTC debug: checking if device [mydevice-staging] is on compatible device list: [mydevice-staging]
2019-10-09 14:11:33 +0000 UTC debug: installer: processing script: ArtifactCommit_Enter_10_migrate-configuration
2019-10-09 14:11:33 +0000 UTC debug: installer: successfully read artifact [name: 2.1.0-alpha.6; version: 3; compatible devices: [mydevice-staging]]
2019-10-09 14:11:33 +0000 UTC debug: Trying to install update of size: 813694976
2019-10-09 14:11:33 +0000 UTC debug: Active partition: /dev/mmcblk1p3
2019-10-09 14:11:33 +0000 UTC debug: Detected inactive partition /dev/mmcblk1p2, based on active partition /dev/mmcblk1p3
2019-10-09 14:11:33 +0000 UTC info: native sector size of block device /dev/mmcblk1p2 is 512, we will write in chunks of 1048576
2019-10-09 14:11:33 +0000 UTC info: opening device /dev/mmcblk1p2 for writing
2019-10-09 14:11:33 +0000 UTC info: partition /dev/mmcblk1p2 size: 813694976
2019-10-09 14:15:38 +0000 UTC info: wrote 813694976/813694976 bytes of update to device /dev/mmcblk1p2
2019-10-09 14:15:39 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:15:39 +0000 UTC info: State transition: update-store [Download_Enter] -> update-after-store [Download_Leave]
2019-10-09 14:15:39 +0000 UTC info: State transition: update-after-store [Download_Leave] -> update-install [ArtifactInstall]
2019-10-09 14:15:39 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:15:39 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:15:40 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:15:40 +0000 UTC debug: Inactive partition: /dev/mmcblk1p2
2019-10-09 14:15:40 +0000 UTC debug: Marking inactive partition (/dev/mmcblk1p2) as the new boot candidate.
2019-10-09 14:15:40 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 2
2019-10-09 14:15:40 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-10-09 14:15:40 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-10-09 14:15:40 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-10-09 14:15:40 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-10-09 14:15:40 +0000 UTC debug: Marking inactive partition as a boot candidate successful.
2019-10-09 14:15:40 +0000 UTC info: State transition: update-install [ArtifactInstall] -> reboot [ArtifactReboot_Enter]
2019-10-09 14:15:40 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:15:40 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:15:40 +0000 UTC debug: handling reboot state
2019-10-09 14:15:40 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:15:40 +0000 UTC info: rebooting device(s)
2019-10-09 14:15:40 +0000 UTC info: Mender rebooting from active partition: /dev/mmcblk1p3
2019-10-09 14:16:20 +0000 UTC info: Running Mender version 2.1.0
2019-10-09 14:16:20 +0000 UTC info: Update Module path "/usr/share/mender/modules/v3" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available
2019-10-09 14:16:20 +0000 UTC info: State transition: init [none] -> after-reboot [ArtifactReboot_Leave]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: upgrade_available=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:1]
2019-10-09 14:16:20 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> after-reboot [ArtifactReboot_Leave]
2019-10-09 14:16:20 +0000 UTC debug: handling state after reboot
2019-10-09 14:16:20 +0000 UTC info: State transition: after-reboot [ArtifactReboot_Leave] -> update-commit [ArtifactCommit_Enter]
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC debug: start executing script: ArtifactCommit_Enter_10_migrate-configuration
2019-10-09 14:16:20 +0000 UTC error: failed to report status: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:20 +0000 UTC error: statescript: can not send start status to server: reporting status failed: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:20 +0000 UTC error: failed to report status: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:20 +0000 UTC error: statescript: can not send finished status to server: reporting status failed: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:20 +0000 UTC error: transient error: error calling enter script for (error) update-commit state: error running enter state script(s) for ArtifactCommit_Enter state: statescript: error executing 'ArtifactCommit_Enter_10_migrate-configuration': 1 : exit status 1
2019-10-09 14:16:20 +0000 UTC info: State transition: update-commit [ArtifactCommit_Enter] -> rollback [ArtifactRollback]
2019-10-09 14:16:20 +0000 UTC debug: transitioning to error state
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC info: performing rollback
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: upgrade_available=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:1]
2019-10-09 14:16:20 +0000 UTC debug: Active partition: /dev/mmcblk1p2
2019-10-09 14:16:20 +0000 UTC debug: Detected inactive partition /dev/mmcblk1p3, based on active partition /dev/mmcblk1p2
2019-10-09 14:16:20 +0000 UTC debug: Marking inactive partition (/dev/mmcblk1p3) as the new boot candidate.
2019-10-09 14:16:20 +0000 UTC info: setting partition for rollback: 3
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-10-09 14:16:20 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-10-09 14:16:20 +0000 UTC debug: Marking inactive partition as a boot candidate successful.
2019-10-09 14:16:20 +0000 UTC debug: will try to rollback reboot the device
2019-10-09 14:16:20 +0000 UTC info: State transition: rollback [ArtifactRollback] -> rollback-reboot [ArtifactRollbackReboot_Enter]
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:20 +0000 UTC info: rebooting device(s) after rollback
2019-10-09 14:16:20 +0000 UTC info: Mender rebooting from inactive partition: /dev/mmcblk1p2
2019-10-09 14:16:47 +0000 UTC info: Running Mender version 2.1.0
2019-10-09 14:16:47 +0000 UTC info: Update was interrupted in state: rollback-reboot
2019-10-09 14:16:47 +0000 UTC info: Update Module path "/usr/share/mender/modules/v3" could not be opened (open /usr/share/mender/modules/v3: no such file or directory). Update modules will not be available
2019-10-09 14:16:47 +0000 UTC info: State transition: init [none] -> verify-rollback-reboot [ArtifactRollbackReboot_Leave]
2019-10-09 14:16:47 +0000 UTC debug: transitioning to error state
2019-10-09 14:16:47 +0000 UTC debug: Have U-Boot variable: mender_check_saveenv_canary=1
2019-10-09 14:16:47 +0000 UTC debug: List of U-Boot variables:map[mender_check_saveenv_canary:1]
2019-10-09 14:16:47 +0000 UTC debug: Have U-Boot variable: mender_saveenv_canary=1
2019-10-09 14:16:47 +0000 UTC debug: List of U-Boot variables:map[mender_saveenv_canary:1]
2019-10-09 14:16:47 +0000 UTC debug: Have U-Boot variable: upgrade_available=0
2019-10-09 14:16:47 +0000 UTC debug: List of U-Boot variables:map[upgrade_available:0]
2019-10-09 14:16:47 +0000 UTC info: State transition: verify-rollback-reboot [ArtifactRollbackReboot_Leave] -> after-rollback-reboot [ArtifactRollbackReboot_Leave]
2019-10-09 14:16:47 +0000 UTC debug: handling state after rollback reboot
2019-10-09 14:16:47 +0000 UTC info: State transition: after-rollback-reboot [ArtifactRollbackReboot_Leave] -> update-error [ArtifactFailure]
2019-10-09 14:16:47 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:47 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:47 +0000 UTC debug: handle update error state
2019-10-09 14:16:47 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2019-10-09 14:16:47 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:47 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:47 +0000 UTC debug: Handling Cleanup state
2019-10-09 14:16:47 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]
2019-10-09 14:16:48 +0000 UTC debug: statescript: timeout for executing scripts is not defined; using default of 1h0m0s seconds
2019-10-09 14:16:48 +0000 UTC debug: handle update status report state
2019-10-09 14:16:48 +0000 UTC error: failed to report status: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:48 +0000 UTC error: error reporting update status: reporting status failed: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:48 +0000 UTC error: failed to send status to server: transient error: reporting status failed: Put https://MY_WEBSITE_URL/api/devices/v1/deployments/device/deployments/343c0962-6dbe-4f55-b364-0286fe5a2dbe/status: dial tcp: lookup MY_WEBSITE_URL on [2001:4860:4860::8888]:53: dial udp [2001:4860:4860::8888]:53: connect: network is unreachable
2019-10-09 14:16:48 +0000 UTC info: State transition: update-status-report [none] -> update-retry-report [none]
2019-10-09 14:17:44 +0000 UTC debug: SIGUSR1 signal received.
2019-10-09 14:17:44 +0000 UTC debug: Sent wake up!
2019-10-09 14:17:44 +0000 UTC info: forced wake-up from sleep
2019-10-09 14:17:44 +0000 UTC info: State transition: update-retry-report [none] -> update-status-report [none]
2019-10-09 14:17:44 +0000 UTC debug: handle update status report state
2019-10-09 14:17:46 +0000 UTC debug: status reported, response 204 No Content
2019-10-09 14:17:46 +0000 UTC debug: attempting to upload deployment logs for failed update