From owner-freebsd-sparc64@FreeBSD.ORG Sun Feb 15 08:57:19 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBBCC16A4CE for ; Sun, 15 Feb 2004 08:57:18 -0800 (PST) Received: from schlepper.zs64.net (schlepper.zs64.net [212.12.50.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52E1C43D1D for ; Sun, 15 Feb 2004 08:57:18 -0800 (PST) (envelope-from stb@lassitu.de) Received: from [127.0.0.1] (schlepper [212.12.50.230]) by schlepper.zs64.net (8.12.10/8.11.1) with ESMTP id i1FGvEEi032606; Sun, 15 Feb 2004 17:57:14 +0100 (CET) (envelope-from stb@lassitu.de) In-Reply-To: <20040116072040.GA99497@blossom.cjclark.org> References: <20040116072040.GA99497@blossom.cjclark.org> Mime-Version: 1.0 (Apple Message framework v612) Content-Type: multipart/mixed; boundary=Apple-Mail-1--227213988 Message-Id: <00C23764-5FD8-11D8-AA39-000393496BE8@lassitu.de> From: Stefan Bethke Date: Sun, 15 Feb 2004 17:57:13 +0100 To: cjclark@alum.mit.edu X-Mailer: Apple Mail (2.612) cc: sparc64@freebsd.org Subject: Re: OT: Solaris Jumpstart from FreeBSD X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2004 16:57:19 -0000 --Apple-Mail-1--227213988 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Am 16.01.2004 um 08:20 schrieb Crist J. Clark: > Before I hack away at the Solaris Jumpstart tools to get them to run > on FreeBSD, I was wondering if anyone here has done or can provide a > pointer to someone who has already done this and is willing to share > scripts, patches, etc. > > Sorry for being off topic, but I figured if any FreeBSD community knew > of something like this, this one would. I always wanted to do that, but never found the time to fully set up a server. One problem that I did need to solve: extract the data from a install cd image. The standard Solaris CDs have one ISO in the usual location, but are also labelled and have UFS filesystems on them, which are neccessary for booting. The attached little tool will print out block numbers from the image so that one can extract the filesystems with dd. Sample output: $ ./prtdklabel #include #include int compute_cksum(struct dk_label *l) { uint16_t *lb = (uint16_t *)l; int i; uint16_t cksum = 0; for (i=sizeof(*l)/sizeof(*lb); i; i--) { cksum ^= *lb++; } return cksum; } int main(int argc, char*argv[]) { struct dk_label l; int i; int bpc; read(0, &l, sizeof(l)); if (l.dkl_magic != DKL_MAGIC) { printf("Invalid magic %x, not a disk label.\n", l.dkl_magic); return 1; } if (compute_cksum(&l) != 0) { printf("Correct magic, but incorrect checksum, invalid disk label.\n"); return 1; } bpc = l.dkl_nsect*l.dkl_nhead; printf("Label: %-.*s\n", LEN_DKL_ASCII, l.dkl_asciilabel); printf("Cylinders: %d\n", l.dkl_ncyl); printf("Heads: %d\n", l.dkl_nhead); printf("Sectors: %d\n", l.dkl_nsect); printf("VTOC version: %d\n", l.dkl_vtoc.v_version); printf(" Partitions: %d\n", l.dkl_vtoc.v_nparts); printf(" Volume: %-.*s\n", LEN_DKL_VVOL, l.dkl_vtoc.v_volume); for (i=0; i Fon +49 170 346 0140 --Apple-Mail-1--227213988--