nvme-cli can update NVMe device firmware. Add code in chromeos-disk-firmware-update.sh to deal with NVMe device.
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/040ab8cf920ce610aac4b94797c42a1db8acf974 commit 040ab8cf920ce610aac4b94797c42a1db8acf974 Author: Gwendal Grignou <gwendal@chromium.org> Date: Wed May 24 06:59:04 2017 installer: fix list_fixed_nvme_disks Due to a cut and paste error, nvme variable in list_fixed_nvme_disks was not used. Return NVMe devices without their namespace. For insance if 2 block devices are present: nvme0n1 and nvme0n2, only nvme0 is returned. BUG= chromium:669596 TEST=Check on a machine with NVMe device that list_fixed_nvme_disks returns the name of the NVMe device. Validate use of xargs with: mkdir /tmp/nvme0n1 /tmp/nvme0n2 /tmp/nvme1n1 /tmp/nvme1n2 all_nvme="" for nvme in /tmp/nvme*; do nvme_base="${nvme##*/}" all_nvme="${all_nvme} ${nvme_base%n*}" done Check we have --nvme0-- --nvme1-- Using the last line of the function. Check storage_info returns identical data: /dev/nvme0 and /dev/nvme0n1 point to the same device. Change-Id: Ie341f8d92dbc14bdffb5ff445263c5747069d909 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/490646 Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/040ab8cf920ce610aac4b94797c42a1db8acf974/installer/share/chromeos-common.sh
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/ff5705ba699592522354332613931457f058c7be commit ff5705ba699592522354332613931457f058c7be Author: Gwendal Grignou <gwendal@chromium.org> Date: Wed May 24 06:59:05 2017 disk_updater: Add nvme firmware ugprade Allow nvme device firmware to upgraded like eMMC or SATA devices. BUG= chromium:669596 TEST=Unit test, check SSD in a proto machine is upgraded: /usr/sbin/chromeos-disk-firmware-update.sh --fw_package_dir /tmp/test_fw/google/disk/firmware Firmware download success Success activating firmware action:1 slot:1 Upgraded nvme0n1:INTEL_SSDPEKKW256G7 from PSF100C to PSF109C And back from 109 to 100. Check that when nvme cli command is not present, the script bails without error, just messages. Change-Id: I3d559bbc00c7cc52cae9b465bd804a54773e58fc Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/490647 Reviewed-by: Mike Frysinger <vapier@chromium.org> [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/INTEL_SSDPEKKW256G7-PSF100C.nvme [modify] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/chromeos-disk-firmware-ata-test.sh [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/test_nvme_dir/rules [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/nvme [modify] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/unit_test.sh [modify] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/scripts/chromeos-disk-firmware-update.sh [modify] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/chromeos-disk-firmware-mmc-test.sh [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/nvme_upgrade_failed_3 [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/test_nvme_dir/fw.bin [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/INTEL_SSDPEKKW256G7-PSF109C.nvme [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/nvme_upgraded_1 [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/chromeos-disk-firmware-nvme-test.sh [add] https://crrev.com/ff5705ba699592522354332613931457f058c7be/disk_updater/tests/nvme_good_2
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/bc1a8c46ec872730bb41ac259f6fc632d2f1ec54 commit bc1a8c46ec872730bb41ac259f6fc632d2f1ec54 Author: Gwendal Grignou <gwendal@chromium.org> Date: Thu Jun 01 23:50:58 2017 disk_updater: Add support for NVMe Add NVMe dependency and test script. BUG= chromium:669596 TEST=Check NVMe tests are run. Change-Id: Ie10148ce99e09cbe4b02cbed0b47b369630a333c Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/490667 Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/bc1a8c46ec872730bb41ac259f6fc632d2f1ec54/chromeos-base/disk_updater/disk_updater-9999.ebuild
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-eve-private/+/717ac2664481434530cb607767dead9429436bef commit 717ac2664481434530cb607767dead9429436bef Author: Gwendal Grignou <gwendal@chromium.org> Date: Tue Oct 10 19:19:05 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/46cebc24579f57f7e445d9b3fe10d5e6890f1552 commit 46cebc24579f57f7e445d9b3fe10d5e6890f1552 Author: Gwendal Grignou <gwendal@chromium.org> Date: Tue Oct 10 19:19:06 2017 hardware_DiskFirmwareUpgrade: Add support for NVMe DO NOT COMMIT UNTIL SAMSUNG ANNOUCES DEVICE. Allow testing Samsung NVMe Test upgrade/downgrade from E <-> T BUG= chromium:669596 CQ-DEPEND=CL:*464975 TEST=Check on eve with test_that, 1000 iterations. Change-Id: I8ae8a02beef971b0a730f898be42e4dc7aa80c68 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/688225 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org> [modify] https://crrev.com/46cebc24579f57f7e445d9b3fe10d5e6890f1552/server/site_tests/hardware_DiskFirmwareUpgrade/hardware_DiskFirmwareUpgrade.py [modify] https://crrev.com/46cebc24579f57f7e445d9b3fe10d5e6890f1552/server/site_tests/hardware_DiskFirmwareUpgrade/control
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/976d03d733bfc7c557c5a6a1382532cd87c6a472 commit 976d03d733bfc7c557c5a6a1382532cd87c6a472 Author: Gwendal Grignou <gwendal@chromium.org> Date: Tue Oct 10 19:19:05 2017 disk_updater: Upgrade firmware immediately if possible When upgrading with action 3 (update firmware without reboot), we need first to upload the firmware with action 0 (upload without update). Use one unused slot to do the operation. If slot N is used, use slot N+1 or the first writable slot if we are exceeding the number of slots. BUG= chromium:669596 TEST=Unit test + tested on Eve. Build 2 firmware packages, and ping-pong between firmware. Change-Id: I6382d1a248beec6a330ba89cca94b1de00e30923 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/636702 Reviewed-by: Mike Frysinger <vapier@chromium.org> [add] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/SAMSUNG_KUS040205M-DXC81G1T.nvme [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/test_nvme_dir/rules [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/unit_test.sh [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/scripts/chromeos-disk-firmware-update.sh [add] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/INTEL_SSDPEKKW256G7-PSF101C.nvme [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/nvme_upgrade_failed_3 [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/nvme_upgraded_1 [add] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/SAMSUNG_KUS040205M-DXC81G1E.nvme [modify] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/chromeos-disk-firmware-nvme-test.sh [add] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/nvme_upgraded_4 [add] https://crrev.com/976d03d733bfc7c557c5a6a1382532cd87c6a472/disk_updater/tests/nvme_upgraded_5
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-eve-private/+/b52fa1d350f23506d502b9b1d877c343cddadd17 commit b52fa1d350f23506d502b9b1d877c343cddadd17 Author: Gwendal Grignou <gwendal@chromium.org> Date: Tue Oct 31 01:47:45 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc commit a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc Author: Gwendal Grignou <gwendal@chromium.org> Date: Mon Jul 30 21:54:46 2018 disk_updater: Upgrade firmware immediately if possible When upgrading with action 3 (update firmware without reboot), we need first to upload the firmware with action 0 (upload without update). Use one unused slot to do the operation. If slot N is used, use slot N+1 or the first writable slot if we are exceeding the number of slots. BUG= chromium:669596 TEST=Unit test + tested on Eve. Build 2 firmware packages, and ping-pong between firmware. Change-Id: I6382d1a248beec6a330ba89cca94b1de00e30923 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/636702 Reviewed-by: Mike Frysinger <vapier@chromium.org> (cherry picked from commit 976d03d733bfc7c557c5a6a1382532cd87c6a472) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1136990 Reviewed-by: Wei-Han Chen <stimim@chromium.org> [add] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/SAMSUNG_KUS040205M-DXC81G1T.nvme [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/test_nvme_dir/rules [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/unit_test.sh [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/scripts/chromeos-disk-firmware-update.sh [add] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/INTEL_SSDPEKKW256G7-PSF101C.nvme [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/nvme_upgrade_failed_3 [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/nvme_upgraded_1 [add] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/SAMSUNG_KUS040205M-DXC81G1E.nvme [modify] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/chromeos-disk-firmware-nvme-test.sh [add] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/nvme_upgraded_4 [add] https://crrev.com/a0bd5c5bf3cf2b9e00324d8fc4c994a80d0e88dc/disk_updater/tests/nvme_upgraded_5
Comment 1 by gwendal@chromium.org
, Nov 29 2016Labels: OS-Chrome