[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EFI PXE boot using grubx64.efi - Large images

From: Locane
Subject: Re: EFI PXE boot using grubx64.efi - Large images
Date: Fri, 29 Dec 2017 18:20:46 -0800

Randy, you are a god.  That totally worked.  The critical piece of
information I was missing was that you can pass *URL*s to the root= kernel
parameter.  I had no idea you could do that.  I think I've actually even
seen it before in our other deployments, but for some reason didn't make
the connection that it would also work with a CentOS kernel.

I had a local copy of the CentOS 7.4 ISO on our production server, so I
grabbed the initrd and vmlinuz files from its x86_64/images/pxeboot
directory, and set them up to be the linuxefi and initrdefi parameters.
Then, I took the squashfs image out of the ISO I wanted to boot to (by
mounting it to a directory and yanking it out of LiveOS/ ) and then put it
in an http accessible directory, then set the parameter to reference it.
This is what I ended up with:

menuentry 'Testing LiveCD' {
   linuxefi efi/vmlinuz initrd=efi/initrd.img ksdevice=bootif
rootfstype=auto root=live:http://<SERVER
IP>/livecd/testing_efi_squashfs.img ro rd.luks=0
   initrdefi efi/initrd.img

Where "efi/vmlinuz" and "efi/initrd.img" are in a subdirectory called efi
at (because I use Cobbler) /var/lib/tftpboot/ and the files from the
x86_64/images/pxeboot section of the standard CentOS 7.4 ISO.

I actually go through a lot of acrobatics to create my own custom CentOS 7
LiveCD using Lorax and then (used to) use the old iso-to-pxeboot tools to
convert it in to a format that is servable over PXE.

I will write a blog post on this whole process and how I arrived here
because I honestly couldn't find ANYONE trying to do this over an EFI PXE
menu - hopefully someone will see it and be able to use it to not go
through the same pain I have been on and off for the last 8 months.

On Fri, Dec 29, 2017 at 12:41 PM, Locane <address@hidden> wrote:

> Randy you are an amazing human being - I'm working on setting this up and
> trying it right now (even before your summary response) - I will let
> everyone know how it goes!
> On Fri, Dec 29, 2017 at 12:27 PM, Randy Goldenberg <
> address@hidden> wrote:
>> tl;dr:
>> Use the kernel and initrd at centos/7.4.1708/os/x86_64/images/pxeboot.
>> Get the squashfs root file system from the ISO, in LiveCD.
>> Use the following boot environment:
>> vmlinuz initrd=initrd.img ip=dhcp root=live:http://you.know.wher
>> rootfstype=auto ro quiet
>> rhgb rd.luks=0
>> On Friday December 29, 2017, Randy Goldenberg wrote:
>>> Disclaimer: For PXE booting I use iPXE, not grub. I successfully EFI
>>> booted the CentOS 7.4 LiveCD using the procedure outlined below, and iPXE.
>>> I would not expect PXE booting with grub to be substantially different.
>>> I found a CentOS 7 LiveCD that appears to be the one you're trying to
>>> boot, on a CentOS mirror at centos/7.4.1708/isos/x86_64/Ce
>>> ntOS-7-x86_64-LiveGNOME-1708.iso.  This is the image used.  For
>>> preparing your PXE booting setup, mount the ISO.
>>> The initrd inside the ISO at isolinux/ does not support booting over the
>>> network.  Various attempts to inject the needed drivers using dracut were
>>> unsuccessful.  Instead of the kernel and initrd in the ISO, I used the
>>> kernel and initrd available on CentOS mirrors at
>>> centos/7.4.1708/os/x86_64/images/pxeboot.  Put these files wherever you
>>> put stuff to be loaded by grub; probably your tftp directory (iPXE can
>>> access these using http, much faster).
>>> The ISO contains a squashfs archive of the root file system used for
>>> live booting, in the "LiveOS" directory.  Copy the LiveOS directory to your
>>> http server.
>>> The ISO has a boot menu at isolinux/isolinux.cfg.  This was the model
>>> for the iPXE boot entry below, tweaked a bit for loading the root file
>>> system over http.  It has also been tweaked for EFI booting, by adding the
>>> name of the kernel and a definition of an initrd variable to the boot
>>> environment.  For details on the boot options, consult the dracut manual.
>>> I would expect adjusting it to fit the conventions of grub PXE booting to
>>> be trivial:
>>> kernel ${boot-url}CentOS-7-x86_64-LiveGNOME-1708/vmlinuz
>>> initrd ${boot-url}CentOS-7-x86_64-LiveGNOME-1708/initrd.img
>>> imgargs vmlinuz initrd=initrd.img ip=dhcp root=live:${boot-url}CentOS-7-
>>> x86_64-LiveGNOME-1708/squashfs.img rootfstype=auto ro
>>> quiet  rhgb rd.luks=0
>>> "${boot-url}" is defined elsewhere.  Replace it with the URL for the
>>> files on your http or tftp server, as appropriate.
>>> Please let me know if you have any questions.
>>> Thanks,
>>> Randy
>>> On Thursday December 28, 2017, Locane wrote:
>>> I know that the files exist and are accessible, since they are the same
>>>> files
>>>> that regular legacy PXE references.  That root= parameter is in the
>>>> legacy PXE
>>>> menu entry too.
>>>> Here's the legacy PXE menu entry that works if you're curious:
>>>> LABEL LiveCD
>>>>         kernel /images/LiveCD/vmlinuz
>>>>         MENU LABEL ^LiveCD
>>>>         append initrd=/images/LiveCD/initrd.img ksdevice=bootif
>>>> root=live:/
>>>> boot.iso kssendmac text  ks=http://<SERVER
>>>> IP>/cblr/svc/op/ks/profile/LiveCD
>>>>         ipappend 2
>>>> On Thu, Dec 28, 2017 at 12:12 PM, Locane <address@hidden> wrote:
>>>>   The grub entry looks like this currently:
>>>>   menuentry 'Do not use broken livecd' {
>>>>      linuxefi images/LiveCD/vmlinuz initrd=images/LiveCD/initrd.img
>>>> ksdevice=
>>>>   bootif lang=  root=live:/boot.iso kssendmac text  ks=http://<SERVER
>>>> IP>/
>>>>   cblr/svc/op/ks/profile/LiveCD
>>>>      initrdefi images/LiveCD/initrd.img
>>>>   }
>>>>   On Thu, Dec 28, 2017 at 12:09 PM, Randy Goldenberg <
>>>>   address@hidden> wrote:
>>>>       On Wednesday December 27, 2017, Locane wrote:
>>>>           Hello all!  I hope this is the appropriate list for Grub2
>>>>           questions, if not
>>>>           please let me know.
>>>>           As a self-taught DevOps person, I'm missing some knowledge.
>>>>           At the moment, I'm trying to boot a 1.2 gigabyte CentOS 7.4
>>>> livecd
>>>>           from an
>>>>           EFI PXE menu using grubx64.efi, and I'm running in to the
>>>> error
>>>>           "Cannot
>>>>           allocate initrd".
>>>>       How have you configured grub for booting the live CD?
>>>>       Thanks,
>>>>       Randy
>>>>       _______________________________________________
>>>>       Help-grub mailing list
>>>>       address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]