[Top][All Lists]

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

Re: Extracting config file from GRUB EFI image

From: SevenBits
Subject: Re: Extracting config file from GRUB EFI image
Date: Thu, 5 May 2016 19:02:05 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 05/05/2016 06:33 AM, hoan wrote:
> an alternative way to recover the embedded grub.cfg inside your boot.efi
> is to put onto a fat partition efi.img with /EFI/BOOT/boot.efi
> then boot the efi.img
> for ex qemu-system-x86_64 -bios OVMF.fd efi.img
> the embedded grub.cfg is inside memdisk ! Just
> cat (memdisk)/boot/grub/grub.cfg

Hi! This sounds very interesting... I'll try it. How would I create this
FAT partition? I'm not familiar with QEMU.
> hope it helps.
> On 05/04/2016 10:20 PM, SevenBits wrote:
>> On 05/03/2016 11:56 PM, Andrei Borzenkov wrote:
>>> 04.05.2016 06:49, SevenBits пишет:
>>>> On Tuesday, May 3, 2016, Andrei Borzenkov <address@hidden> wrote:
>>>>> 04.05.2016 06:34, SevenBits пишет:
>>>>>> On Tuesday, May 3, 2016, Andrei Borzenkov <address@hidden
>>>>> <javascript:;>> wrote:
>>>>>>> 04.05.2016 03:57, SevenBits пишет:
>>>>>>>> I used this command to create a bootable GRUB UEFI image:
>>>>>>>> ../grub-mkstandalone -d . -o ~/Desktop/boot.efi --format=x86_64-efi
>>>>>>>> --grub-mkimage=../grub-mkimage --install-modules="boot linux ext2
>>>>> normal
>>>>>>>> configfile lspci ls help echo fat exfat hfs hfsplus part_msdos
>>>>>>>> part_gpt
>>>>>>>> part_apple terminal sleep loopback normal fixvideo iso9660 loadbios
>>>>>>>> setvariable applesetos"
>>>>>>>> /boot/grub/fonts/myfont.pf2='/boot/grub/fonts/unicode.pf2'
>>>>>>>> /boot/grub/grub.cfg='/home/user/Desktop/grub.cfg'
>>>>>>>> Unfortunately, I have accidentally erased the grub.cfg file
>>>>>>>> referenced
>>>>>>>> in this command and I (stupidly) did not include it in source
>>>>>>>> code with
>>>>>>>> my rest of my project.
>>>>>>>> Is there a way to extract this GRUB configuration file from a built
>>>>>>>> image? In other words, if I have an image that was built with
>>>>>>>> the above
>>>>>>>> command, can I extract the configuration file from it?
>>>>>>> You can take as
>>>>>>> example and
>>>>>>> extract GRUB modules parsing. Modules are in "mods" section of
>>>>>>> GRUB efi
>>>>>>> image. I actually started with standalone script to do it, but
>>>>>>> never had
>>>>>>> enough incentive to finish.
>>>>>> How exactly does this script work? Do I call it on my GRUB image?
>>>>> Did you try to read README before asking?
>>>> I can't access GitHub right now, which is why I asked. I'll check
>>>> out the
>>>> script tomorrow.
>>> BIS scans system for known bootloaders and bootloader related files. It
>>> is intended x86 systems with legacy boot (or, better - nobody tried it
>>> somewhere else). For supported bootloader it tries to parse binaries and
>>> display some more information.
>>> It has rudimentary support for EFI, but here the problem starts with
>>> simple fact that we have no way to even detect GRUB image - it may be
>>> stored under any name and located practically anywhere.
>> So, I've taken a look at the script, and while it appears to work, it
>> doesn't quite do what I need. The script scans my MBR, but I don't want
>> it to scan my MBR; I need to scan only *one* file that I have. Ideally,
>> I'd like to be able to pass the path of this file to the script.
>> In other words: I don't want to look at the system GRUB (which is using
>> legacy), but rather a specific GRUB EFI image on my hard drive.
>> Calling ./bootinfoscript -h gives the list of commands, but there isn't
>> any to specify the file to look at. Is there any way to accomplish this?
>>>>>> Can it actually extract files, or just list what files are
>>>>>> included in
>>>>> the
>>>>>> image?
>>>>> It does extract them during processing.
>>>> Fantastic.
>> _______________________________________________
>> Help-grub mailing list
>> address@hidden
> _______________________________________________
> Help-grub mailing list
> address@hidden

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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