Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 2002 15:05:27 +0200
From:      Thomas Moestl <tmoestl@gmx.net>
To:        Evren Yurtesen <eyurtese@turkuamk.fi>
Cc:        sparc@freebsd.org
Subject:   Re: sparc64 bootable CD
Message-ID:  <20020820130526.GA1130@crow.dom2ip.de>
In-Reply-To: <Pine.A41.4.10.10208201533530.76332-100000@bessel.tekniikka.turkuamk.fi>
References:  <Pine.A41.4.10.10208201533530.76332-100000@bessel.tekniikka.turkuamk.fi>

next in thread | previous in thread | raw e-mail | index | archive | help

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, 2002/08/20 at 15:37:35 +0300, Evren Yurtesen wrote:
> How is it possible to make a bootable CD for sparc64? I have ultra10
> I figured out its something with mkisofs and mksunbootcd program

mkisofs can do this itself, but you first need to create a boot slice
to put into the image.
I've attached a Makefile that I wrote some time back and that was used
to create the first bootable FreeBSD/sparc64 iso images.
It should still work, but is a bit outdated now, in particular, you
should be able to delete the 'boot1' and 'bootslice.sun4u' targets
(replacing the latter with 'bootfs.sun4u') now by using 'disklabel -B'
when building 'bootfs.sun4u', the zeroing mentioned in the Makefile
does not seem to be required by the frimware.
Note that you need to do most of the building on the sparc64 box (due
to file system endianess issues, and of course to get the sparc64
toolchain). The mkisofs step is an exception, you can just copy over
the files it needs and do it anywhere.

	- thomas

-- 
Thomas Moestl <tmoestl@gmx.net>	http://www.tu-bs.de/~y0015675/
              <tmm@FreeBSD.org>	http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C

--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=Makefile

# $Id: Makefile,v 1.5 2002/03/19 17:17:57 tmm Exp tmm $

# Location of the tree to be burned onto CD-ROM
ISOTREE?=	/home/tmm/cdfs/isotree
# Location of the src/sys tree to be used for building the boot block
SYSTREE?=	/mnt/tmm/sparc64/sys
BOOT1DIR=	${SYSTREE}/boot/sparc64/boot1
BOOT1=		boot1
LOADERDIR=	${SYSTREE}/boot/sparc64/loader
LOADER=		loader
# Size of the boot file system in 512-byte blocks, including a disk label
BOOTFSSZ?=	4096
MOUNTPT=	fsmnt

ALLTARGETS=	boot1 loader boot.sun4u bootslice.sun4u sparc64.iso

.PHONY: all clean

all:	sparc64.iso

boot1:
	cd ${BOOT1DIR} && ${MAKE} all
	cp -f ${BOOT1DIR}/${BOOT1} $@

# XXX: non-standard options, dependency is bogus, so always do a full rebuild
# for now.
loader:
	cd ${LOADERDIR} && \
	${MAKE} clean all LOADER_DISK_SUPPORT=yes LOADER_NET_SUPPORT=no \
	    LOADER_NFS_SUPPORT=no LOADER_TFTP_SUPPORT=no \
	    LOADER_CD9660_SUPPORT=yes
	cp -f ${LOADERDIR}/${LOADER} $@

# Build the boot file system. This needs to be done natively to get the correct
# FS endianess!
bootfs.sun4u:	loader
	dd if=/dev/zero of=$@ bs=512 count=${BOOTFSSZ}
	-mkdir ${MOUNTPT}
	MD=$$(mdconfig -a -t vnode -f $@) ; \
	DEV=/dev/$${MD}c ; \
	disklabel -w -r $$MD auto ; \
	newfs $$DEV ; \
	mount $$DEV ${MOUNTPT} ; \
	mkdir ${MOUNTPT}/boot ; \
	cp loader ${MOUNTPT}/boot/ ; \
	umount ${MOUNTPT} ; \
	mdconfig -d -u $${MD#md}

# The UFS slice on the CD-ROM is prepended by a pseudo disk label. The first
# (512-byte) block is zeroed out on Sun disks, so we do so, too.
# The next 15 sectors contain the boot code.
# Since a FreeBSD disk label is also 16 sectors in size, we can just overwrite
# it with with our boot1, which has the disk label portions zeroed out and is of
# the size of a label, leaving the file system that follows it intact.
bootslice.sun4u:	bootfs.sun4u boot1
	cp -f bootfs.sun4u $@
	dd if=boot1 of=$@ bs=512 conv=notrunc

# Create the ISO image, including the boot slice generated above.
# To make sure that the kernel will use the cd9660 file system as root fs
# there should be a /boot/loader.conf with boot_cdrom set to "YES".
sparc64.iso: bootslice.sun4u
	mkisofs -B ,,,,bootslice.sun4u -r -o $@ ${ISOTREE}

clean:
	-rm -f ${ALLTARGETS}

--lrZ03NoBR/3+SXJZ--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message




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