Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Key Validation feature on 202305 branch for Cisco Platforms #3078

Open
wants to merge 1 commit into
base: 202305
Choose a base branch
from

Conversation

selvipal
Copy link
Contributor

Disabling key validation feature in grub file as its not yet supported for Cisco platforms in 202305 branch

What I did

  1. Check if the platform we are installing the image on is a Cisco platform
  2. Return success if it is so we are on Cisco platform. This way, we do not perform signature verification as this feature is not yet supported on our platforms for 202305 branch

How I did it

Modified sonic-installer grub.py code

How to verify it

Use sonic-installer command without this fix and try to downgrade from 202305 image to 202205 image, you will see the error. With this fix, the image will be installed

Previous command output (if the output of a command-line utility has changed)

root@yy39-rp:/home/cisco# sonic-installer install sonic-cisco-8000.bin
New image will be installed, continue? [y/N]: y

Verifing image SONiC-OS-azure_cisco_202205.0-dirty-20231023.141040 signature...
Verifying image signature
Failure: CMS signature Verification Failed:

Error: Failed verify image signature
Aborted!
root@yy39-rp:/home/cisco#

New command output (if the output of a command-line utility has changed)

root@yy39-rp:/home/cisco# sonic-installer install sonic-cisco-8000.bin
New image will be installed, continue? [y/N]: y
efi not supported - exiting without verification

Installing image SONiC-OS-azure_cisco_202205.0-dirty-20231023.141040 and setting it as default...
Command: bash ./sonic-cisco-8000.bin
Verifying image checksum ... OK.
Preparing image archive ... OK.
Installing SONiC in SONiC
ONIE Installer: platform: x86_64-cisco-8000-r0
onie_platform: x86_64-8800_rp-r0
Installing SONiC to /host/image-azure_cisco_202205.0-dirty-20231023.141040
Directory /host/image-azure_cisco_202205.0-dirty-20231023.141040/ already exists. Cleaning up...
Archive:  fs.zip
   creating: /host/image-azure_cisco_202205.0-dirty-20231023.141040/boot/
  inflating: /host/image-azure_cisco_202205.0-dirty-20231023.141040/boot/System.map-5.10.0-18-2-amd64
  inflating: /host/image-azure_cisco_202205.0-dirty-20231023.141040/boot/config-5.10.0-18-2-amd64
  inflating: /host/image-azure_cisco_202205.0-dirty-20231023.141040/boot/initrd.img-5.10.0-18-2-amd64
  inflating: /host/image-azure_cisco_202205.0-dirty-20231023.141040/boot/vmlinuz-5.10.0-18-2-amd64
 extracting: /host/image-azure_cisco_202205.0-dirty-20231023.141040/fs.squashfs
Switch CPU vendor is: GenuineIntel
Switch CPU cstates are: disabled
EXTRA_CMDLINE_LINUX=
Installed SONiC base image SONiC-OS successfully

Command: grub-set-default --boot-directory=/host 0

Command: config-setup backup
Taking backup of current configuration

Command: mkdir -p /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mount -t squashfs /host/image-azure_cisco_202205.0-dirty-20231023.141040/fs.squashfs /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: sonic-cfggen -d -y /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/sonic/sonic_version.yml -t /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/usr/share/sonic/templates/sonic-environment.j2
Command: umount -r -f /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: rm -rf /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mkdir -p /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mount -t squashfs /host/image-azure_cisco_202205.0-dirty-20231023.141040/fs.squashfs /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mkdir -p /host/image-azure_cisco_202205.0-dirty-20231023.141040/rw
Command: mkdir -p /host/image-azure_cisco_202205.0-dirty-20231023.141040/work
Command: mkdir -p /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mount overlay -t overlay -o rw,relatime,lowerdir=/tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs,upperdir=/host/image-azure_cisco_202205.0-dirty-20231023.141040/rw,workdir=/host/image-azure_cisco_202205.0-dirty-20231023.141040/work /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: mkdir -p /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/var/lib/docker
Command: mount --bind /host/image-azure_cisco_202205.0-dirty-20231023.141040/docker /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/var/lib/docker
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs mount proc /proc -t proc
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs mount sysfs /sys -t sysfs
Command: cp /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/default/docker /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/tmp/docker_config_backup
Command: sh -c echo 'DOCKER_OPTS="$DOCKER_OPTS -H unix:// --storage-driver=overlay2 --bip=240.127.1.1/24 --iptables=false --ipv6=true --fixed-cidr-v6=fd00::/80 "' >> /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/default/docker
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs /usr/lib/docker/docker.sh start
mount: /sys/fs/cgroup/cpu: cgroup already mounted on /sys/fs/cgroup.
mount: /sys/fs/cgroup/cpuacct: cgroup already mounted on /sys/fs/cgroup.
Command: cp /var/lib/sonic-package-manager/packages.json /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/tmp/packages.json
Command: touch /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/tmp/docker.sock
Command: mount --bind /var/run/docker.sock /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/tmp/docker.sock
Command: cp /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/resolv.conf /tmp/resolv.conf.backup
Command: cp /etc/resolv.conf /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/resolv.conf
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs sh -c command -v sonic-package-manager
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs sonic-package-manager migrate /tmp/packages.json --dockerd-socket /tmp/docker.sock -y
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "initrd.img.old" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz" file in "/" when searching for (sub)modules (No such file or directory)
libyang[1]: Unable to get information about "vmlinuz.old" file in "/" when searching for (sub)modules (No such file or directory)
migrating package dhcp-relay
skipping dhcp-relay as installed version is newer
migrating package macsec
skipping macsec as installed version is newer
Command: chroot /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs /usr/lib/docker/docker.sh stop
Command: mv /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/tmp/docker_config_backup /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/default/docker
Command: cp /tmp/resolv.conf.backup /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs/etc/resolv.conf
Command: umount -f -R /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: umount -r -f /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: rm -rf /tmp/image-azure_cisco_202205.0-dirty-20231023.141040-fs
Command: sync

Command: sync

Command: sync

Command: sleep 3

Done
root@yy39-rp:/home/cisco#

… is not ready yet.

This will be removed once platform support is added.

Signed-off-by: selvipal <selvipal@cisco.com>
Copy link

linux-foundation-easycla bot commented Dec 12, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@selvipal
Copy link
Contributor Author

selvipal commented Jan 8, 2024

@abdosi Please review

@abdosi
Copy link
Contributor

abdosi commented Jan 9, 2024

@selvipal : please create PR for master branch and will do cherry-pick on all relevant branches as needed.

cc @anamehra for viz.

@selvipal
Copy link
Contributor Author

@abdosi I created the following PR against master: #3115 it is still going through checks
@anamehra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants