LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-10-2013, 06:57 PM   #151
aaazen
Member
 
Registered: Dec 2009
Posts: 358

Rep: Reputation: Disabled

Quote:
Originally Posted by Erik_FL View Post
Are you referring to booting the DVD or booting from the hard disk?
The boot is from a DVD.

From Slackware64 current, I create a "grub2-efi" package from SlackBuild.org grub2:

http://slackbuilds.org/repository/14.0/system/grub2/

The Grub2 2.00 source is from GNU:

http://www.gnu.org/software/grub/grub-download.html


But add several compile options to make the grub2-efi package build:
--with-platform=efi
--disable-werror

And a patch to stdio.h for the gets() function:
Code:
=== modified file 'grub-core/gnulib/stdio.in.h'
--- grub-core/gnulib/stdio.in.h 2010-09-20 10:35:33 +0000
+++ grub-core/gnulib/stdio.in.h 2012-07-04 15:18:15 +0000
@@ -140,8 +140,10 @@
 /* It is very rare that the developer ever has full control of stdin,
    so any use of gets warrants an unconditional warning.  Assume it is
    always declared, since it is required by C89.  */
+#if defined gets
 #undef gets
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
 
 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
After installing the "grub2-efi" package I build the bootx64.efi (cdrom.efi) image:

Code:
#! /bin/bash
set -x
set -e
MODDIR="/usr/lib64/grub/x86_64-efi"
cd $MODDIR

# get list of all modules
MODS=$(ls *mod | xargs | sed -e 's/.mod//g')

cd /root
mkdir -p grub

cat <<_EOT_ >grub/cdrom.cfg
set prefix=/boot/grub
set root=(cd0)
_EOT_

grub-mkimage    -O x86_64-efi \
                -c grub/cdrom.cfg \
                -d /usr/lib64/grub/x86_64-efi \
                -p "/boot/grub" \
                -o grub/cdrom.efi \
                -v \
                $MODS

I create an msdos partition file from a EFI/BOOT/bootx64.efi directory and call it
EFI-imgs/efiboot.imgs

Then I burn a DVD using a modified version of Alien Bobs, mirror-slackware-current.sh script.

http://slackware.com/~alien/

The main modification is in the mkisofs:

Code:
 mkisofs -o slackware64-test-install-dvd.iso \
    -R -J -V "Slackware-test DVD" \
    -hide-rr-moved -hide-joliet-trans-tbl \
    -v -d -N -sort isolinux/iso.sort \
    -preparer "Slackware-test build for x86_64 by comet.berkeley \
    -publisher "The Slackware Linux Project - http://www.slackware.com/" \
    -A "Slackware-test DVD - build 10_Apr_2013" \
    -x ./source  \
    -eltorito-boot isolinux/isolinux.bin \
    -eltorito-catalog isolinux/isolinux.boot \
    -no-emul-boot -boot-load-size 32 -boot-info-table \
    -eltorito-alt-boot \
    -eltorito-platform efi \
    -eltorito-boot       boot/grub/EFI-imgs/efiboot.img \
    -no-emul-boot \ 
    .
For debugging I eliminated the Grub2 configuration file as an issue.
I renamed /boot/grub/grub.cfg to /boot/grub/grub.config.

And when booting from the AMD machine, I immediately got the grub rescue prompt.

But again from the Intel box, it just said "Welcome to GRUB!" and hung with no prompt at all.
 
Old 04-10-2013, 08:48 PM   #152
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
I think this might relate to your problem with the prefix being incorrect.

http://lists.gnu.org/archive/html/gr.../msg00138.html

I checked the source code you referenced and it does not appear to have that patch.

The easiest way to check for the patch is to search file contents for "is_cdrom".

Edit: I believe there is a way to set the device name in the prefix when you create the grub program image. That might be a work around for the problem. Set the prefix to "(cd0)/boot/grub" instead of "/boot/grub" for example.

Last edited by Erik_FL; 04-10-2013 at 09:01 PM.
 
Old 04-11-2013, 02:39 PM   #153
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-15.0
Posts: 783

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
All this to get grub to work???
When elilo and rEFInd already work for slackware.
cheers
john
 
Old 04-11-2013, 03:08 PM   #154
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by AlleyTrotter View Post
All this to get grub to work???
When elilo and rEFInd already work for slackware.
cheers
john
GRUB works for hard disk booting just like ELILO and rEFInd. I have not been able to get ELILO to boot from a DVD, and so far GRUB has worked booting from a DVD on most UEFI and EFI computers.

There may not be a single boot loader that works well on all UEFI and EFI computers for both hard disk and optical disc booting. Slackware currently uses a different boot loader (ISOLINUX) on an optical disc versus a hard disk (LILO). So far I have not seen a UEFI/EFI boot loader for optical discs that appears to work on all UEFI/EFI computers. What works best on an optical disc for UEFI/EFI remains to be seen.

I am in favor of providing GRUB 2 as a Slackware package, even if GRUB 2 isn't the standard hard disk boot loader. ELILO is certainly adequate for hard disk booting, though all the kernel and initrd files have to be placed in the FAT EFI System Partition.
 
Old 04-11-2013, 11:22 PM   #155
aaazen
Member
 
Registered: Dec 2009
Posts: 358

Rep: Reputation: Disabled
Quote:
Originally Posted by Erik_FL View Post
I think this might relate to your problem with the prefix being incorrect.

http://lists.gnu.org/archive/html/gr.../msg00138.html

I checked the source code you referenced and it does not appear to have that patch.

The easiest way to check for the patch is to search file contents for "is_cdrom".

Edit: I believe there is a way to set the device name in the prefix when you create the grub program image. That might be a work around for the problem. Set the prefix to "(cd0)/boot/grub" instead of "/boot/grub" for example.
Thanks Erik,

This patch looks promising, but it does not quite fit Grub 2.00.

The patch is probably for a later version of Grub as lines mentioned in the patch are missing from Grub 2.00.

ELILO could use something like this patch.

-Richard
 
Old 04-12-2013, 10:48 AM   #156
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-15.0
Posts: 783

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by Erik_FL View Post
GRUB works for hard disk booting just like ELILO and rEFInd. I have not been able to get ELILO to boot from a DVD, and so far GRUB has worked booting from a DVD on most UEFI and EFI computers.
In a previous post in this thread I described a method to create a install dvd using "comet.berkely"s modified first script and incorporating a stub kernel which has successfully booted on every system I tried it on. Although admitting that 5 or 6 friends are not that large of a sampling, the dvd did UEFI boot. several were fairly recent Dell's not sure about all the systems as they are not slackware users so no full install was performed. I was only interested in the UEFI boot to "setup'.
I also submitted this info to PV but he does not seem to think it is useful as it involves a stub kernel. As always I defer to Pat's superior knowledge as I'm sure there are reasons this is not a workable solution or he would use it.
But my point is the elilo dvd boots on every computer I have tried it on. It also will boot in legacy mode if the system is not EFI/UEFI aware.
cheers
john

My apologies to all. Using the current current dated -- Thu Apr 11 03:52:06 UTC 2013 -- the method I described no longer boots.
So I will be giving up on that method since no one else seems to find it of use including PV.
John

Last edited by AlleyTrotter; 04-12-2013 at 02:23 PM. Reason: no longer works
 
Old 04-12-2013, 12:53 PM   #157
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by AlleyTrotter View Post
In a previous post in this thread I described a method to create a install dvd using "comet.berkely"s modified first script and incorporating a stub kernel which has successfully booted on every system I tried it on. Although admitting that 5 or 6 friends are not that large of a sampling, the dvd did UEFI boot. several were fairly recent Dell's not sure about all the systems as they are not slackware users so no full install was performed. I was only interested in the UEFI boot to "setup'.
I also submitted this info to PV but he does not seem to think it is useful as it involves a stub kernel. As always I defer to Pat's superior knowledge as I'm sure there are reasons this is not a workable solution or he would use it.
But my point is the elilo dvd boots on every computer I have tried it on. It also will boot in legacy mode if the system is not EFI/UEFI aware.
cheers
john
Thank you for all the testing you have done. I have only one UEFI computer, so I have even less of a test sampling. Your results with a kernel stub and ELILO are good news.

My point was simply that I don't think GRUB 2 has more problems than other UEFI boot loaders. I agree that GRUB 2 is complicated to install and configure. Some of my problems with booting from DVD were obviously because I didn't configure GRUB 2 correctly.

The testing that I did with ELILO indicated it would definitely work for booting from the hard disk. The only thing that I wasn't able to verify is if ELILO could be used on a DVD. I will be happy if Slackware uses ELILO as a boot loader for the hard disk.

I don't think it matters if the DVD uses the same boot loader as the "normal" one for the hard disk. It's more important that the DVD boots on the largest possible number of UEFI computers. A secondary concern is to avoid having too many variations of the boot DVD. That can hopefully be accomplished with a hybrid DVD which of course is more complicated to create and test. I only understand some of the issues with UEFI booting and I am also trusting Pat to make thoughtful decisions for Slackware.
 
Old 04-15-2013, 05:15 PM   #158
Dman58
Member
 
Registered: Nov 2010
Location: The Danger Zone
Distribution: Slackware & everything else in a VM
Posts: 294

Rep: Reputation: 31
Quote:
Originally Posted by michaelslack View Post
I've had success dual-booting doing the following on my samsung smart pc pro. The default bootloader is NOT /EFI/Boot/bootx64.efi (even though it exists), but rather /EFI/Microsoft/Boot/bootmgfw.efi (the files /EFI/Boot/bootx64.efi and /EFI/Microsoft/Boot/bootmgfw.efi are identical).

1. install slackware64 in CSM/legacy mode (this has its own little difficulties but assuming you get through this...)
2. don't install any bootloader
3. boot (again in CSM/legacy mode) using install medium/usb bootstick from setup
4. mount EFI system partition (/dev/sda2 say) as root: mount /dev/sda2 /boot/efi
5. then
* copy refind_x64.efi, refind.conf-sample and possibly the icons and drivers_x64 subdirectories from the refind binary distribution to /boot/efi/EFI/Microsoft/Boot
* cd /boot/efi/EFI/Microsoft/Boot
* mv bootmgfw.efi orig-bootmgfw.efi
* mv refind_x64.efi bootmgfw.efi
* mv refind.conf-sample to refind.conf and make sure the default "scanfor" entry is uncommented
* create a subdirectory /boot/efi/EFI/ELILO and cp /boot/elilo_x64.efi to it
* create a subdirectory /boot/efi/EFI/slackware and copy the slackware64 huge kernel (e.g. vimlinuz-huge-3.8.4) from /boot to it
* create and put an entry in /boot/efi/EFI/ELILO/elilo.conf something like
Code:
prompt
timeout=50
default=slackware

image=/EFI/slackware/vmlinuz-huge-3.8.4
    label=slackware
    root=/dev/sda6     
    read-only
    append=""
Then reboot in UEFI mode. The refind splash screen should open with every possible UEFI boot target listed: kernels, bootloaders, etc including the slackware elilo entry as well as /EFI/Microsoft/Boot/orig-bootmgfw.efi and /EFI/Boot/bootx64.efi . Choosing either of these last two should boot into windows.

Once you know it is working you can edit the refind.conf to remove the extraneous options on the splashscreen. I have "textonly" uncommented, I only have "scanfor manual", I have "scan_all_linux_kernels" commented out and I have two manual entries at the bottom that look like:

Code:
menuentry slackware {
         loader /EFI/ELILO/elilo_x64.efi
}

menuentry windows {
         loader /EFI/Microsoft/Boot/orig-bootmgfw.efi
}
I have finally successfully completed your steps to boot in UEFI mode. Thank you again. I still have to do some touching up to get it as I want it but for the most part everything is fine. Only thing is I have to specify "nomodeset" in order to get a stable screen. Upon boot the screen flickers and is all black except for the very top smidgen of a line.

I will keep at it for now and post back as I reach further.
 
Old 04-15-2013, 09:44 PM   #159
michaelslack
Member
 
Registered: Feb 2013
Location: Sydney
Distribution: slackware
Posts: 110

Rep: Reputation: 36
You're welcome Dman58, I'm glad you found the post helpful.

It is in a sense less than ideal, in that rather than change the "hard-wired" boot target we just substitute for it. But it seems that different vendors may be adding little things to the setup to make it tricky to change that boot target, so this method, while a little rough, will always work (so long as secure boot is off etc.).

Also I have not yet been able to create a UEFI-bootable install medium, although others seem to have done this. This could also vary in terms of ease/possibility between different vendors/devices. Thus this method of install in legacy mode, then install refind and switch to UEFI-booting is also (I guess) less than ideal, but it works!

Cheers,

Michael
 
Old 09-22-2013, 08:19 PM   #160
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,504

Rep: Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461
Bump!

Code:
Mon Sep 23 00:32:58 UTC 2013
EFI/BOOT/*:  Switch from elilo to GRUB for UEFI ISO boot.  Bring up a menu that
  offers to start the installer with or without the KMS console since it seems
  that under UEFI some cards require KMS, while others won't work if KMS is
  active.  Also, provide an option to scan for and offer to boot operating
  systems that are installed already.  This works here on VirtualBox, but I'd
  like to get some feedback from people who have real UEFI machines.  My
  understanding is that newer UEFI firmwares do support ISO9660 filesystems
  and this should work on those.  Older machines may still require a USB
  stick to boot the installer.
Any reports about this working (or not) on recent UEFI machines appreciated.
 
Old 09-22-2013, 09:47 PM   #161
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
My understanding is that newer UEFI firmwares do support ISO9660 filesystems and this should work on those.
UEFI firmwares are supposed read the El Torito Boot Records from optical media and load the correct "EF" platform image from there (which is usually a FAT filesystem). Reading ISO 9660 filesystems makes no sense, because standard conforming DVDs are supposed to have to have a UDF filesytem anyway. So which implementations do this?
 
Old 09-22-2013, 10:02 PM   #162
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,504

Rep: Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461
Quote:
Originally Posted by jtsn View Post
UEFI firmwares are supposed read the El Torito Boot Records from optical media and load the correct "EF" platform image from there (which is usually a FAT filesystem). Reading ISO 9660 filesystems makes no sense, because standard conforming DVDs are supposed to have to have a UDF filesytem anyway. So which implementations do this?
It works here on UEFI VirtualBox. And Patrick Verner (of Parted Magic fame) has told me that his real UEFI machine also works this way (no idea what machine it is, though).

I'm going to test using an EFI El-Torito image again, though. I think there's a good chance it was just elilo causing problems before, so we'll see how GRUB does.
 
Old 09-22-2013, 10:31 PM   #163
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
The main issue with VBox's EFI implementation is, that it's so incomplete and buggy, that it can't even successfully boot Windows. So if something doesn't work there, the only issue may just be VBox, and if something works there, it may only work on VBox and nowhere else.

Real UEFI implementations (AMI Aptio and Insyde H2O and Phoenix TrustedCore) also don't need (and usually don't have) a driver for optical filesystems, because the Windows DVD loads bootmgfw.efi via the El Torito image, which then can read UDF by itself. And of course every hardware vendor under the sun makes sure, that THIS works.

I will do some testing of -current on my UEFI hardware (AMI Aptio) this week and report the results.
 
Old 09-22-2013, 11:47 PM   #164
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,504

Rep: Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461Reputation: 8461
Reporting back! I made a 1.44MB FAT12 image (efiboot.img) containing only /EFI/BOOT/bootx64.efi (the GRUB2 EFI binary), and put it in the isolinux directory. Then I made an ISO image with this command:

Code:
mkisofs -o /tmp/slackware-dvd.iso -R -J -A "Slackware Install" -hide-rr-moved -v -v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table -sort isolinux/iso.sort -b isolinux/isolinux.bin -c isolinux/isolinux.boot -eltorito-alt-boot -no-emul-boot -eltorito-platform 0xEF -eltorito-boot isolinux/efiboot.img -boot-load-size 2880 -m 'source' -V "SlackDVD" .
Unfortunately, when I booted this in VirtualBox GRUB started but then just gave me a GRUB prompt and no menu. I also tried putting the entire contents of /EFI/BOOT/ in the El-Torito image to see if that would help, but there was no difference.

On other ISO images that use GRUB and support UEFI, what I've seen is that the El-Torito image only contains the GRUB binary. Perhaps this is another VirtualBox bug? I'm using Clonezilla as a reference currently, but haven't actually tried booting that. Perhaps I'll give it a try and see if that offers any hints.

One issue is that it appears that if the ISO contains an EFI binary in /EFI/BOOT/ in the main ISO9660 filesystem, then VirtualBox will use that in preference to the El-Torito image. So, I removed the bootx64.efi from there, and perhaps that has some bearing on things.

I'll keep trying things. It would be nice to have a working EFI El-Torito system so that most UEFI machines will be able to boot the ISO image. Any help testing on a real UEFI machine would be appreciated (perhaps I'll add the efiboot.img and fix the ISO mastering commands in isolinux/README.TXT so that could be more easily tested by people who have a real UEFI machine). And I'm still interested in any reports of success or failure with only the /EFI directory and not an El-Torito image.
 
Old 09-23-2013, 12:26 AM   #165
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by volkerdi View Post
Reporting back! I made a 1.44MB FAT12 image (efiboot.img) containing only /EFI/BOOT/bootx64.efi (the GRUB2 EFI binary), and put it in the isolinux directory.
I don't think UEFI is going to work with floppy disks. We need a FAT32 hard disk filesystem (media descriptor F8) and maybe even a valid GPT inside the image, I will investigate this further.

Quote:
I'll keep trying things. It would be nice to have a working EFI El-Torito system so that most UEFI machines will be able to boot the ISO image. Any help testing on a real UEFI machine would be appreciated (perhaps I'll add the efiboot.img and fix the ISO mastering commands in isolinux/README.TXT so that could be more easily tested by people who have a real UEFI machine). And I'm still interested in any reports of success or failure with only the /EFI directory and not an El-Torito image.
I already tried booting -current Slackware tree from a FAT32 USB stick (which UEFI supports natively) via the EFI directory:

It doesn't work. The GRUB menu shows up, but regardless of which option I choose, the machine freezes after pressing RETURN. The previously included ELILO was able to boot the installer, so I think we have a regression here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware and Grub2 - getting a UEFI mb running linuxbird Slackware 16 12-13-2012 08:40 AM
Slackware on a former UEFI system garpu Slackware - Installation 2 11-23-2012 10:59 PM
Slackware vs. EFI/UEFI kikinovak Slackware 4 10-21-2012 11:31 AM
Help Creating UEFI A MENU For My Bootable (BIOS/UEFI) CDROM ssenuta Linux - Hardware 0 08-27-2012 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration