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

Added Redhat support and standardized SNP utility Script #5

Closed
wants to merge 17 commits into from

Conversation

LakshmiSaiHarika
Copy link
Contributor

This whole script works for both Ubuntu and RedHat(above 9 versions).

LakshmiSaiHarika and others added 17 commits December 5, 2023 00:49
1. Changed AMDSEV URL and AMDSEV branch for AMDSEV build with RHEL fixes

2. rhel_install_dependencies for rhel library package manager dependencies for AMDSEV branch.
      requires subscription manager credential for installing RedHat
libraries

3. set_grub_default_snp() using grubby tool for RHEL

4. Modified save_binary_paths() due to the differences in the location of guest kernel file path for ubuntu and rhel and differences in the boot menu for initial ram disk images(initd.img-<kernel-version> for ubuntu and initramfs-<kernel-version> for rhel)

Signed-off-by: Harika <lnittala@amd.com>
Code Cleaning for setup-host

Signed-off-by: Harika <lnittala@amd.com>
snp.sh - Added download_cloud_init_image()
download_redhat_guest_image.sh - To handle redhat cloud init image download via RedHat API

Signed-off-by: Harika <lnittala@amd.com>
Changed Ubuntu cloud-init configuration to standardize changes across various linux distribution.

Signed-off-by: Harika <lnittala@amd.com>
…g extraction

using rpm -qlp
         or
      dpkg -c to get vmlinuz-<guest-version>

Signed-off-by: Harika <lnittala@amd.com>
  Added guest_kernel_version
  Added guest_kernel_package()
  Copied  guest kernel package from host into guest and install kernel pckg onto guest
  Update correct initrd/initramfs file path in the host in save_binary_paths()

Signed-off-by: Harika <lnittala@amd.com>
…d from guest to host and changing source bins with correct initrd or initramfs file path.

Need to resume from booting guest with
   initrd filepath
   kernel filepath
   ovmf filepath

Signed-off-by: Harika <lnittala@amd.com>
Signed-off-by: Harika <lnittala@amd.com>
… launching RedHat guest

Signed-off-by: Harika <lnittala@amd.com>
Copy initrd/initramfs into home folder; change its permission to 644 for performing scp from guest into host
code cleaning

Signed-off-by: Harika <lnittala@amd.com>
Signed-off-by: Harika <lnittala@amd.com>
…unch-guest

Added error messages if RedHat Credentials not set
Updated save_binary_paths to replace initrd/initramfs path after intrd/initramfs scp from guest to host

Signed-off-by: Harika <lnittala@amd.com>
save_binary_paths- guest_kernel pointing to the latest guest kernel(vmlinuz) version
                   Add condition for source-bins first file edit

build_and_install_amdsev - fix in latest snp-release installation

Signed-off-by: Harika <lnittala@amd.com>
    save_binary_paths
    removed install_common_dependencies()

setfacl: /dev/sev: Only directories can have default ACLs
	Can't set default permission for the /dev/sev character device(which is treated as file in linux)

Standardized code for getting host kernel version

Unregister redhat subscription after attest-guest installation step (at the script end)

Signed-off-by: Harika <lnittala@amd.com>
1. Fix for updating INITRD_BIN to correct file(initrd/initramfs)
2. Add Unregister at the script end after installing attest-guest depedencies

Signed-off-by: Harika <lnittala@amd.com>
Added error message in case of RedHat and Fedora

Signed-off-by: Harika <lnittala@amd.com>
1. To add extra environment variables necessary for SNP setup
2. non-upm for RedHat is unsupported for now.

Signed-off-by: Harika <lnittala@amd.com>
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.

1 participant