Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2012 07:35:07 +0100
From:      Milan Obuch <milan@dino.sk>
To:        Rob Ballantyne <robballantyne3@gmail.com>, jeremyhu@freedesktop.org
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: Question about bootup
Message-ID:  <20120307073507.6bdd8e90@zeta.dino.sk>
In-Reply-To: <CAKLrb5fqn0jHrL78-%2B35bBesVkDPw8C_GfRiLuWPCJL3GgtdWg@mail.gmail.com>
References:  <CAKLrb5d=fos09L0fHY3Qdf4YRZ5FYBmHTV21iMzEybB65DpoSw@mail.gmail.com> <20120306075045.5be555b9@zeta.dino.sk> <CAKLrb5fqn0jHrL78-%2B35bBesVkDPw8C_GfRiLuWPCJL3GgtdWg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 6 Mar 2012 21:49:41 -0800
Rob Ballantyne <robballantyne3@gmail.com> wrote:

> Thank you Milan and Jeremy,
> 
>   That helped a lot.
> 
>   I looked at the code for bsdinstall that sets up the bootable disk
> and it appears to use GEOM/gpart to partition the disk. The manpage
> for gpart indicates it understands the Apple Partition system (APM).
> 

Yes, it works - I was able to install 9.0/powerpc64 with bsdinstall
easily. When doing it manually with gpart, all what differs from
usual way is selecting apm scheme, but it works already from
bsdinstall, so if you are not needing anything super fancy, no need to
work with gpart directly.

>   It appears that an HFS image file is manipulated during the kernel
> build process in
> the following section of a Makefile
> (/usr/src/sys/boot/powerpc/boot1.chrp)
> 
> boot1.hfs: boot1.elf bootinfo.txt
> 	echo ${.OBJDIR}
> 	uudecode ${.CURDIR}/hfs.tmpl.bz2.uu
> 	mv hfs.tmpl.bz2 ${.TARGET}.bz2
> 	bzip2 -f -d ${.TARGET}.bz2
> 	dd if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET}
> conv=notrunc dd if=${.CURDIR}/bootinfo.txt of=${.TARGET}
> seek=${BOOTINFO_OFFSET} \ conv=notrunc
> 

Yes, exactly here. Actually, there is Makefile.hfs for hfs template
creation, so you can see how exactly hfs filesystem image can be
created, but because some tool outside of usual kernel source is
needed, it is not normally used and only compiled boot1.elf and simple
bootinfo.txt is written into pre-created image file using predefined
file offsets.

>   It appears you may be able to substitute your own
> boot.elf/bootinfo.txt files at
> this stage (although it appears since the file content is being
> 'poked' into an existing
> hfs image this might be a bit sensitive to changes).
> 

All what matters is file size. If you are not trying to use way longer
files (see Makefile.hfs for some hints), you can alter anything
provided you are not trying to do something really silly :)

I did some bootinfo.txt hacks in order to create simple boot menu for
partition selection, with a bit of boot1.c editing as well, but I did
not found a way to use keyboard when invoking modified bootinfo.txt
automatically. All works using 'boot hd2:\bootinfo.txt' command from
openfirmware prompt, but I can't investigate more now (not that I know
where :) but that's another story).

Regards,
Milan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120307073507.6bdd8e90>