DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd May 2016
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default Creating a USB-based bootable installer for a macbook, can it be done?

As the title says.

I'm looking for precise instructions relating to macbook (intel) hardware. I've tried to accomplish this a couple of times but always failed to make the device (a usb stick) bootable and ultimately had to resort to booting from cd.

And as I'm still trying to get an OpenBSD installation running on my machine I'd prefer not to waste yet another cdr on the new snapshot I'd like to try.
Reply With Quote
  #2   (View Single Post)  
Old 23rd May 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,884
Default

Hello, and welcome.

I don't know if anyone else has an EFI-bootable Macbook 4.1 here. This is a small community, and for specific hardware like this, you may have better luck posting about this to the misc@ mailing list, which is read by a much larger audience of users, and about half of the developers.

I know that for 5.9, both the miniroot59.fs and install59.fs images are designed to be bootable via EFI or via legacy BIOS. But I don't have a Macbook, and apparently, no one else who is active on this forum has one either.
Reply With Quote
  #3   (View Single Post)  
Old 24th May 2016
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default

Hi jggimi,

thanks for your reply and for the welcome!

I used to be subscribed to misc@ once, quite a long time ago. Currently I just don't have time enough to deal with high volume mailing lists on top of everyting else. So I prefer to use misc@ passively by trawling the archives. BTW, the small community is actually one of the reasons I like this place. Makes it a lot easier to keep track of things, despite the drawback of far smaller input pool.

I haven't given up, yet. Creating a bootable USB stick for OpenBSD could apparently be as simple as creating a DOS-formated 1-partition USB drive and placing either of the BOOTIA32.EFI or BOOTX64.EFI files (available for 5.9 and newer) in a directory called /efi/boot. That alone is enough to have the drive show up on the macbook's graphical boot menue (pressing 'alt' at boot). And selecting the drive does indeed start the OpenBSD EFI bootloader. So far, so good. Unfortunately that's also when the problems start. It seems the bootloader has somehow can't access the filesystem properly.

I get errors like
Code:
open(hd0a:/etc/boot.conf): Invalid argument
Code:
start(hd0a:/.): Invalid argument
I'll see if I can find out more and will report back if I make any progress.
Reply With Quote
  #4   (View Single Post)  
Old 24th May 2016
NaWi NaWi is offline
Fdisk Soldier
 
Join Date: Aug 2015
Location: Austria
Posts: 52
Default

I have a MacBook 4.1 (Black, Penryn board) around here. Boot the install media using USB images freezes the machine since IIRC 5.8. I installed 5.7 from CD and updated using bsd.rd to a 5.9 current (some weeks old).

I am a littlebit out of this topic so no up to date infos.
Reply With Quote
  #5   (View Single Post)  
Old 24th May 2016
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default

Hi NaWi,

thanks for the input! I have to ask: do you remember how you booted your 5.7 system after installation? And more importantly: how do you boot your upgraded 5.9 installation? Also, are you dual-booting, with OSX for instance?


Meanwhile I've done some testing as to the matter of USB-based install media.
Assuming a USB-stick with a single partition a simple
Code:
dd if=install60.fs of=/dev/rdisk1s1 bs=1m
creates an installation image on OSX ('diskutil list' shows the devices and their identifiers). Regardless of partitioning (MBR, GPT) the volume shows up in the macbook's EFI boot menu and selecting it starts the OpenBSD EFI bootloader on OpenBSD 5.9 or higher.

Unfortunately the bootloader somehow can't access the filesystem on the USB stick, no matter which combination of partioning and filesystem type (the bootloader is hardwired to look for /etc/boot.conf):
Code:
probing: pc0 mem[572K 64K 2007M 152K 224K 4M 416K 36K 20K 48K 28K 716K 288K 44K
40K 16K 88K 4M 28K 20K 236K 5M 3M 144K 40K]
disk hd0* hd1
>> OpenBSD/amd64 EFIBOOT 3.30
open (hd0a:/etc/boot.conf) : Invalid argument
boot>
Diskinfo output from the bootloader:
Code:
boot> machine diskinfo
Disk    BlkSiz  IoAlign size    Flags   Checksum
hd0     512     0       28GB    0x0     0x3160067b      Removable
hd1     512     4       149GB   0x2     0x43031620
For comparison, OpenBSD's CD bootloader doesn't even see the USB drive before the kernel has booted. I'm beginning to think installing from a USB drive is somehow not yet possible, at least not on a macbook.
Reply With Quote
  #6   (View Single Post)  
Old 25th May 2016
NaWi NaWi is offline
Fdisk Soldier
 
Join Date: Aug 2015
Location: Austria
Posts: 52
Default

Hello !

I installed 5.7 from CD. After installing I booted it using Apples bootmanager (option key at boot). I used MBR and the system boots normally as on any other machine the SMP kernel. I used the whole disk and also full disk encryption works.

After collecting basic experience I used USB sticks instead of CD's. My problem was, that the installXX.fs frezes during boot the installer from 5.8 up. To update I used the bsd.rd from the working system. Boot in 5.8 and 5.9 is done the same way is in 5.7.

For dual boot have a look at rEFInd and jaspers blog post https://blog.jasper.la/openbsd-uefi-bootloader-howto/ I never tried dual boot but used the blog post to install OpenBSD on a Shuttle XS3?.

Using dd on the Mac works without problems. Plug the stick in, unmount it in DiskUtility run dd in terminal but use rdisk1 or whatever it is named. It is important to write to the device and not to a partition like rdisk1s1. Be careful to use the correct device ... dd overwrites everything. The USB stick here worked on a MacBook 4,1, MacBook Pro 9,1 and also 2 other systems.

Edit : the /etc/boot.conf error could be the reason of writing to a existing partition on a pre-formated stick. IIRC I also saw that.

Last edited by NaWi; 25th May 2016 at 06:24 AM. Reason: Added Edit :
Reply With Quote
  #7   (View Single Post)  
Old 25th May 2016
NaWi NaWi is offline
Fdisk Soldier
 
Join Date: Aug 2015
Location: Austria
Posts: 52
Default

I gave it a try, it is

Code:
sudo dd if=./install60.fs of=/dev/rdisk2 bs=1m
in my case. Boots without problems on a MacBook Pro 9,1. The only problem is, after a reboot El Capitan shutdown the machine because of the temp.

Last edited by NaWi; 25th May 2016 at 04:10 PM. Reason: Format code block. Added the m at the end.
Reply With Quote
  #8   (View Single Post)  
Old 25th May 2016
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default

Quote:
Originally Posted by NaWi View Post
It is important to write to the device and not to a partition like rdisk1s1.
Bull's eye, dammit! After changing dd's of=target as you suggested the USB-disk works as expected. The error messages are gone, I can properly change devices in the bootloader, look around with ls and the '*' on the device list at the top is also gone.

Thank you so much for pointing that detail out. I missed that completely.

That being said, the kernel doesn't boot past the entry point. It freezes just before the switch to the blue background display of the system message buffer. Which is exactly the same behaviour as when I try to boot the freshly installed system from hard disk.

Well, at least I can consider this topic resolved and return to try and solve my original problem.

Thanks again for the hint, NaWi! It is much appreciated.
Reply With Quote
  #9   (View Single Post)  
Old 26th May 2016
NaWi NaWi is offline
Fdisk Soldier
 
Join Date: Aug 2015
Location: Austria
Posts: 52
Default

You are welcome ... no problem.

I posted this at misc@ months ago.
http://marc.info/?l=openbsd-misc&m=145350181109130&w=2

I haven't tried the 6.0 kernel but 5.9 boots without problems in a installed system. My workaround was :

Install 5.7 from CD, configure network (in my case urtwn), download the 5.8 bsd.rd, run signify, overwrite the original in /, boot from bsd.rd, upgrade to 5.8, reboot and run sysmerge. Do the same for 5.9.

For dualboot have a look at the above link from jasper and rEFInd.
Reply With Quote
Old 7th February 2017
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default

To recapitulate the issue and wrap things up as reference for anyone with similar issues, the problem here is/was actually twofold:

1) creating:

As NaWi pointed out further above, writing with dd has to be done on the raw device device and not a partition. That was an oversight on my part. Using the correct syntax it works, of course.

2) USB-based bootable installer for a mac:

Early Intel-Macs boot USB devices automatically in EFI-mode. But the OpenBSD EFI-loader only supports GOP for its graphic protocol. The machine in question here is a MacBook 4,1 (early 2008) with an UGA graphics protocol EFI-firmware which is currently NOT supported by OpenBSD's efiboot. On this and earlier Intel Macs OpenBSD can only be booted in BIOS/legacy mode.

On later models the USB device should boot without problems. Furthermore, post-August 2012 MacBook Pros and Airs allegedly support booting USB media in BIOS/Legacy-mode.
Reply With Quote
Old 20th August 2017
nyg nyg is offline
Port Guard
 
Join Date: Jan 2017
Posts: 14
Default

Quote:
Originally Posted by fvgit View Post
2) USB-based bootable installer for a mac:

Early Intel-Macs boot USB devices automatically in EFI-mode. But the OpenBSD EFI-loader only supports GOP for its graphic protocol. The machine in question here is a MacBook 4,1 (early 2008) with an UGA graphics protocol EFI-firmware which is currently NOT supported by OpenBSD's efiboot. On this and earlier Intel Macs OpenBSD can only be booted in BIOS/legacy mode.

On later models the USB device should boot without problems. Furthermore, post-August 2012 MacBook Pros and Airs allegedly support booting USB media in BIOS/Legacy-mode.
Well that was really weird.

I have a Mac mini 3,1 (2009) with OpenBSD 6.0 installed last year. I had no issues with it but still I wanted to install a clean 6.1 from a USB key. I took the Mac mini from the living room (where it was not connected to any screens) and plugged it on my screen... It just wouldn't boot anymore. Not from the HD nor from the USB key. There was no error message, everything seemed fine but it kept rebooting infinitely...

When I saw your post, I unplugged it from my screen, restarted it, waited around 1-2 minutes, reconnected my screen and I could see the login screen again!
Reply With Quote
Old 20th August 2017
fvgit's Avatar
fvgit fvgit is offline
Fdisk Soldier
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("SGVyZSBiZSBkcmFnb25zC")'
Posts: 72
Default

What's your boot-mode? EFI or BIOS-legacy?
Reply With Quote
Old 4 Weeks Ago
nyg nyg is offline
Port Guard
 
Join Date: Jan 2017
Posts: 14
Default

Quote:
Originally Posted by fvgit View Post
What's your boot-mode? EFI or BIOS-legacy?
Sorry for the late answer. How can I find that out?
Reply With Quote
Reply

Tags
boot, macbook, usb

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macbook Pro 11,1 bceverly OpenBSD Installation and Upgrading 21 31st August 2015 01:12 PM
How to create a portable, bootable OpenBSD -NOT INSTALLER-? Crypto333 OpenBSD Installation and Upgrading 35 29th December 2014 07:44 AM
Using Qemu for creating bootable usb when wireless is needed Ninguem Guides 2 26th January 2013 12:23 AM
trouble creating freeBSD bootable usb aenimansot FreeBSD Installation and Upgrading 1 11th September 2011 03:12 AM
macbook 5.1 mousesack FreeBSD General 1 20th February 2009 10:01 PM


All times are GMT. The time now is 09:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick