Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace xxd with dd for google_nvme_id
`google_nvme_id` script currently uses `xxd` to parse nvme device info, but we need to install additional package `xxd` for fedora, `vim-common` and `vim-filesystem` for centos (or rhel) before using it. Replace it with `dd` and we do not need to install additional packages. See coreos/fedora-coreos-config#2412 (comment) We initially tried to replace it with cut, creating a different result expected. See: GoogleCloudPlatform#49 Discussing about the use of `dd`vs `cut`. Tests for Fedora CoreOS: nvme id-ns -b /dev/nvme0n1 | xxd -p --seek 384 | xxd -p -r | od -x 0000000 227b 6564 6976 6563 6e5f 6d61 2265 223a 0000020 6570 7372 7369 6574 746e 642d 7369 2d6b 0000040 2230 222c 6964 6b73 745f 7079 2265 223a 0000060 4550 5352 5349 4554 544e 7d22 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 * 0007200 nvme id-ns -b /dev/nvme0n1 | dd bs=1 skip=384 2>/dev/null | od -x 0000000 227b 6564 6976 6563 6e5f 6d61 2265 223a 0000020 6570 7372 7369 6574 746e 642d 7369 2d6b 0000040 2230 222c 6964 6b73 745f 7079 2265 223a 0000060 4550 5352 5349 4554 544e 7d22 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 * 0007200 Tests for Debian 12 nvme id-ns -b /dev/nvme0n1 | dd bs=1 skip=384 2>/dev/null | od -x 0000000 227b 6564 6976 6563 6e5f 6d61 2265 223a 0000020 6f6c 6163 2d6c 766e 656d 732d 6473 312d 0000040 2c22 6422 7369 5f6b 7974 6570 3a22 4c22 0000060 434f 4c41 535f 4453 7d22 0000 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 * 0007200 nvme id-ns -b /dev/nvme0n1 | dd bs=1 skip=384 2>/dev/null | od -x 0000000 227b 6564 6976 6563 6e5f 6d61 2265 223a 0000020 6f6c 6163 2d6c 766e 656d 732d 6473 312d 0000040 2c22 6422 7369 5f6b 7974 6570 3a22 4c22 0000060 434f 4c41 535f 4453 7d22 0000 0000 0000 0000100 0000 0000 0000 0000 0000 0000 0000 0000 * 0007200 Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
- Loading branch information