Skip to content

Commit

Permalink
Remove all uses of initrd
Browse files Browse the repository at this point in the history
It turns out that the kernel will already show the Secure Boot state before
it even gets to using an initrd.

Signed-off-by: Patrick Uiterwijk <[email protected]>
  • Loading branch information
puiterwijk committed Apr 3, 2018
1 parent 5ea905e commit 3ef2627
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
- run:
name: run simple version with python2
command: |
python2 ./ovmf-vars-generator --verbose --print-output --kernel-path vmlinuz --initrd-path initrd.img output2.vars
python2 ./ovmf-vars-generator --verbose --print-output --kernel-path vmlinuz output2.vars
- run:
name: run simple version with python3
command: |
python3 ./ovmf-vars-generator --verbose --print-output --kernel-path vmlinuz --initrd-path initrd.img output3.vars
python3 ./ovmf-vars-generator --verbose --print-output --kernel-path vmlinuz output3.vars
- store_artifacts:
path: output2.vars
Expand Down
24 changes: 6 additions & 18 deletions ovmf-vars-generator
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Licensed under MIT License, for full text see LICENSE
#
# Purpose: Launch a QEMU guest and enroll ithe UEFI keys into an OVMF
# variables ("VARS") file. Then boot a Linux kernel and initrd
# with QEMU. Finally, perform a check to verify if Secure Boot
# variables ("VARS") file. Then boot a Linux kernel with QEMU.
# Finally, perform a check to verify if Secure Boot
# is enabled.

from __future__ import print_function
Expand Down Expand Up @@ -124,20 +124,17 @@ def enroll_keys(args):


def test_keys(args):
logging.info('Grabbing test kernel and initrd')
logging.info('Grabbing test kernel')
kernel, kerneltemp = download(args.kernel_url, args.kernel_path,
'kernel', args.no_download)
initrd, initrdtemp = download(args.initrd_url, args.initrd_path,
'initrd', args.no_download)

logging.info('Starting verification')
try:
cmd = generate_qemu_cmd(
args,
True,
'-append', 'console=tty0 console=ttyS0,115200n8',
'-kernel', kernel,
'-initrd', initrd)
'-kernel', kernel)
p = subprocess.Popen(cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
Expand All @@ -160,8 +157,6 @@ def test_keys(args):
finally:
if kerneltemp:
os.remove(kernel)
if initrdtemp:
os.remove(initrd)


def parse_args():
Expand Down Expand Up @@ -191,24 +186,17 @@ def parse_args():
action='store_true')
parser.add_argument('--kernel-path',
help='Specify a consistent path for kernel')
parser.add_argument('--initrd-path',
help='Specify a consistent path for initrd')
parser.add_argument('--no-download', action='store_true',
help='Never download a kernel/initrd')
help='Never download a kernel')
parser.add_argument('--fedora-version',
help='Fedora version to get kernel/initrd for checking',
help='Fedora version to get kernel for checking',
default='27')
parser.add_argument('--kernel-url', help='Kernel URL',
default='https://download.fedoraproject.org/pub/fedora'
'/linux/releases/%(version)s/Everything/x86_64'
'/os/images/pxeboot/vmlinuz')
parser.add_argument('--initrd-url', help='Initrd URL',
default='https://download.fedoraproject.org/pub/fedora'
'/linux/releases/%(version)s/Everything/x86_64'
'/os/images/pxeboot/initrd.img')
args = parser.parse_args()
args.kernel_url = args.kernel_url % {'version': args.fedora_version}
args.initrd_url = args.initrd_url % {'version': args.fedora_version}

validate_args(args)
return args
Expand Down

0 comments on commit 3ef2627

Please sign in to comment.