From owner-freebsd-small@FreeBSD.ORG Mon Jun 27 11:01:59 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EBDF16A42B for ; Mon, 27 Jun 2005 11:01:59 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 630B943D53 for ; Mon, 27 Jun 2005 11:01:59 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j5RB1xtE043163 for ; Mon, 27 Jun 2005 11:01:59 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j5RB1wJq043157 for freebsd-small@freebsd.org; Mon, 27 Jun 2005 11:01:58 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 27 Jun 2005 11:01:58 GMT Message-Id: <200506271101.j5RB1wJq043157@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-small@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2005 11:01:59 -0000 Current FreeBSD problem reports Critical problems Serious problems Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/01/04] misc/15876 small PicoBSD message of the day problems o [2001/06/18] misc/28255 small picobsd documentation still references ol o [2002/09/13] kern/42728 small many problems in src/usr.sbin/ppp/* afte o [2003/05/14] misc/52255 small picobsd build script fails under FreeBSD o [2003/05/14] misc/52256 small picobsd build script does not read in use 5 problems total. From owner-freebsd-small@FreeBSD.ORG Tue Jun 28 10:59:55 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4643C16A41C for ; Tue, 28 Jun 2005 10:59:55 +0000 (GMT) (envelope-from joker@init.ru) Received: from wolf.init.ru (wolf.init.ru [195.161.186.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A785643D1F for ; Tue, 28 Jun 2005 10:59:54 +0000 (GMT) (envelope-from joker@init.ru) Received: from yk.init.ru (yk.init.ru [195.161.186.13]) by wolf.init.ru (8.13.1/8.13.1) with ESMTP id j5SAxjwV035346; Tue, 28 Jun 2005 14:59:45 +0400 (MSD) (envelope-from joker@init.ru) Received: from [127.0.0.1] (localhost [127.0.0.1]) by yk.init.ru (8.13.3/8.13.3) with ESMTP id j5SAxhWw056763; Tue, 28 Jun 2005 14:59:45 +0400 (MSD) (envelope-from joker@init.ru) Message-ID: <42C12D9F.8050409@init.ru> Date: Tue, 28 Jun 2005 14:59:43 +0400 From: Yuri Kurenkov Organization: JSC INIT User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050614 X-Accept-Language: ru, en MIME-Version: 1.0 To: Luigi Rizzo References: <844f54af05042812041044a418@mail.gmail.com> <20050428121140.A94424@xorpc.icir.org> In-Reply-To: <20050428121140.A94424@xorpc.icir.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-small@freebsd.org Subject: Re: picobsd and freebsd 5.3 X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: joker@init.ru List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2005 10:59:55 -0000 Thanx, Luigi, for your development. You script modified for using makefs works with RELENG_4 and RELENG_5 and help to me migrate my CF versions from RELENG_4 to RELENG_5. But i take one small trouble: I can't build 1400K floppy images - makefs say me: ----8<------8<------8<------ `getarptab.o' is up to date. makefs: `/usr/src/release/picobsd/build/build_dir-tinet/mfs.tree' size of 2359296 is larger than the maxsize of 2355200. ----8<------8<------8<------ But native RELENG_4 `picobsd' build scrip make picobsd.bin with this config set succesfully. Can you help with this trouble? I'm wating for Your solutions :) Luigi Rizzo wrote: > maybe the attached version of the 'picobsd' script helps. > > I have removed the need to run with vnconfig and/or root privs, > and rely on "makefs" (from the ports). It also removes > one instance of {bsd|disk}label, so that might help. > > I have only tested this with 4.x and building picobsd > images based on 4.x and 5.x sources > > cheers > luigi > > On Thu, Apr 28, 2005 at 03:04:10PM -0400, john thomas wrote: > >>Hi there - I'm trying to use picobsd on freebsd 5.3 and having a few problems. >> >>I am simply doing "/usr/src/release/picobsd/build/picobsd bridge" as >>root, accepting all the defaults and selecting 'build' from the >>dialog. It sucessfully compiles the kernel, does crunchgen ok (with a >>few errors re: sshd which im confident I can fix in crunch.conf >>later), and then starts to build the floppy image and dies like this: >> >>Filesystem 1K-blocks Used Avail Capacity iused ifree %iused Mounted on >>/dev/md0c 2967 1311 1656 44% 70 376 16% >>/tmp/picobsd.7g7xz6SAFI >>/dev/md0c: FILE SYSTEM CLEAN; SKIPPING CHECKS >>/dev/md0c: clean, 3312 free (8 frags, 413 blocks, 0.1% fragmentation) >>0+1 records in >>0+1 records out >>13 bytes transferred in 0.000101 secs (128903 bytes/sec) >>disklabel -Brw -b /boot/boot1 -s /root/pico/build_dir-bridge/boot2 md0 auto >>usage: bsdlabel disk >> (to read label) >> bsdlabel -w [-n] [-m machine] disk [type] >> (to write label with existing boot program) >> bsdlabel -e [-n] [-m machine] disk >> (to edit label) >> bsdlabel -R [-n] [-m machine] disk protofile >> (to restore label with existing boot program) >> bsdlabel -B [-b boot] [-m machine] disk >> (to install boot program with existing on-disk label) >> bsdlabel -w -B [-n] [-b boot] [-m machine] disk [type] >> (to write label and install boot program) >> bsdlabel -R -B [-n] [-b boot] [-m machine] disk protofile >> (to restore label and install boot program) >>---> fail: Error <1> error code in <> >>Error while doing disklabel on of floppy.img size 1440 >>---> Aborting ./picobsd >> >>I added an echo of what seems to be the command that causes it to >>fail, you can see it in the output above but I'll also put it here: >>disklabel -Brw -b /boot/boot1 -s /root/pico/build_dir-bridge/boot2 md0 auto >>I'm pretty new to freebsd so I have no idea what that command is >>trying to achieve, but perusing the disklabel manpage shows no -r or >>-s arguments, and a quick look at >>http://www.freebsd.org/cgi/cvsweb.cgi/src/release/picobsd/build/picobsd >>shows that those options were both added in v1.29 (as well as a bunch >>of other things), which is the version that in 5.3. >> >>My end goal is to just end up with a kernel file (with embedded >>ramdisk image) that I can boot with grub (from a cf card), but I'm not >>sure how to fix the script to get there. >> >>Any suggestions would be great. >> >>Thanks. >>_______________________________________________ >>freebsd-small@freebsd.org mailing list >>http://lists.freebsd.org/mailman/listinfo/freebsd-small >>To unsubscribe, send any mail to "freebsd-small-unsubscribe@freebsd.org" >> >> -- Yuri V. Kurenkov [YVK9-RIPN] JSC "INIT", 88, Frunze st., Taganrog, 347904 RU http://www.init.ru Ph/Fax: +7-8634-391011 ICQ UIN: 21666578 From owner-freebsd-small@FreeBSD.ORG Tue Jun 28 12:48:29 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1BB816A41C for ; Tue, 28 Jun 2005 12:48:29 +0000 (GMT) (envelope-from jmelo@freebsdbrasil.com.br) Received: from capeta.freebsdbrasil.com.br (vrrp.freebsdbrasil.com.br [200.210.70.30]) by mx1.FreeBSD.org (Postfix) with SMTP id 33D4143D55 for ; Tue, 28 Jun 2005 12:48:27 +0000 (GMT) (envelope-from jmelo@freebsdbrasil.com.br) Received: (qmail 59173 invoked by uid 0); 28 Jun 2005 09:48:25 -0300 Received: from jmelo@freebsdbrasil.com.br by capeta.freebsdbrasil.com.br by uid 82 with qmail-scanner-1.22 (uvscan: v4.3.20/v4522. spamassassin: 2.64. Clear:RC:1(201.17.165.147):. Processed in 0.671402 secs); 28 Jun 2005 12:48:25 -0000 Received: from unknown (HELO ?10.69.69.2?) (201.17.165.147) by capeta.freebsdbrasil.com.br with SMTP; 28 Jun 2005 09:48:25 -0300 Message-ID: <42C14734.2040403@freebsdbrasil.com.br> Date: Tue, 28 Jun 2005 09:48:52 -0300 From: Jean Milanez Melo User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050614) X-Accept-Language: en-us, en MIME-Version: 1.0 To: joker@init.ru References: <844f54af05042812041044a418@mail.gmail.com> <20050428121140.A94424@xorpc.icir.org> <42C12D9F.8050409@init.ru> In-Reply-To: <42C12D9F.8050409@init.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Luigi Rizzo , freebsd-small@freebsd.org Subject: Re: picobsd and freebsd 5.3 X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2005 12:48:30 -0000 Yuri Kurenkov wrote: > Thanx, Luigi, for your development. You script modified for using > makefs works with RELENG_4 and RELENG_5 and help to me migrate my CF > versions from RELENG_4 to RELENG_5. But i take one small trouble: I > can't build 1400K floppy images - makefs say me: > > ----8<------8<------8<------ > `getarptab.o' is up to date. > makefs: `/usr/src/release/picobsd/build/build_dir-tinet/mfs.tree' size > of 2359296 is larger than the maxsize of 2355200. > ----8<------8<------8<------ > > But native RELENG_4 `picobsd' build scrip make picobsd.bin with this > config set succesfully. Can you help with this trouble? I'm wating for > Your solutions :) > > Luigi Rizzo wrote: > >> maybe the attached version of the 'picobsd' script helps. >> >> I have removed the need to run with vnconfig and/or root privs, >> and rely on "makefs" (from the ports). It also removes >> one instance of {bsd|disk}label, so that might help. >> >> I have only tested this with 4.x and building picobsd >> images based on 4.x and 5.x sources >> >> cheers >> luigi >> >> On Thu, Apr 28, 2005 at 03:04:10PM -0400, john thomas wrote: >> >>> Hi there - I'm trying to use picobsd on freebsd 5.3 and having a few >>> problems. >>> >>> I am simply doing "/usr/src/release/picobsd/build/picobsd bridge" as >>> root, accepting all the defaults and selecting 'build' from the >>> dialog. It sucessfully compiles the kernel, does crunchgen ok (with a >>> few errors re: sshd which im confident I can fix in crunch.conf >>> later), and then starts to build the floppy image and dies like this: >>> >>> Filesystem 1K-blocks Used Avail Capacity iused ifree %iused Mounted on >>> /dev/md0c 2967 1311 1656 44% 70 376 16% >>> /tmp/picobsd.7g7xz6SAFI >>> /dev/md0c: FILE SYSTEM CLEAN; SKIPPING CHECKS >>> /dev/md0c: clean, 3312 free (8 frags, 413 blocks, 0.1% fragmentation) >>> 0+1 records in >>> 0+1 records out >>> 13 bytes transferred in 0.000101 secs (128903 bytes/sec) >>> disklabel -Brw -b /boot/boot1 -s /root/pico/build_dir-bridge/boot2 >>> md0 auto >>> usage: bsdlabel disk >>> (to read label) >>> bsdlabel -w [-n] [-m machine] disk [type] >>> (to write label with existing boot program) >>> bsdlabel -e [-n] [-m machine] disk >>> (to edit label) >>> bsdlabel -R [-n] [-m machine] disk protofile >>> (to restore label with existing boot program) >>> bsdlabel -B [-b boot] [-m machine] disk >>> (to install boot program with existing on-disk label) >>> bsdlabel -w -B [-n] [-b boot] [-m machine] disk [type] >>> (to write label and install boot program) >>> bsdlabel -R -B [-n] [-b boot] [-m machine] disk protofile >>> (to restore label and install boot program) >>> ---> fail: Error <1> error code in <> >>> Error while doing disklabel on of floppy.img size 1440 >>> ---> Aborting ./picobsd >>> >>> I added an echo of what seems to be the command that causes it to >>> fail, you can see it in the output above but I'll also put it here: >>> disklabel -Brw -b /boot/boot1 -s /root/pico/build_dir-bridge/boot2 >>> md0 auto >>> I'm pretty new to freebsd so I have no idea what that command is >>> trying to achieve, but perusing the disklabel manpage shows no -r or >>> -s arguments, and a quick look at >>> http://www.freebsd.org/cgi/cvsweb.cgi/src/release/picobsd/build/picobsd >>> shows that those options were both added in v1.29 (as well as a bunch >>> of other things), which is the version that in 5.3. >>> >>> My end goal is to just end up with a kernel file (with embedded >>> ramdisk image) that I can boot with grub (from a cf card), but I'm not >>> sure how to fix the script to get there. >>> >>> Any suggestions would be great. >>> >>> Thanks. >>> _______________________________________________ >>> freebsd-small@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-small >>> To unsubscribe, send any mail to >>> "freebsd-small-unsubscribe@freebsd.org" >>> >>> > > Hi Luigi, Don't will you commit this "new" picobsd script? -- Atenciosamente Jean Milanez Melo FreeBSD Brasil LTDA. Fone: (31) 3281-9633 http://www.freebsdbrasil.com.br From owner-freebsd-small@FreeBSD.ORG Tue Jun 28 16:24:06 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C9F816A41C for ; Tue, 28 Jun 2005 16:24:06 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0059143D4C for ; Tue, 28 Jun 2005 16:24:05 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j5SGO2Ki001289; Tue, 28 Jun 2005 09:24:02 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j5SGNvtM001284; Tue, 28 Jun 2005 09:23:57 -0700 (PDT) (envelope-from rizzo) Date: Tue, 28 Jun 2005 09:23:57 -0700 From: Luigi Rizzo To: Jean Milanez Melo Message-ID: <20050628092357.A1258@xorpc.icir.org> References: <844f54af05042812041044a418@mail.gmail.com> <20050428121140.A94424@xorpc.icir.org> <42C12D9F.8050409@init.ru> <42C14734.2040403@freebsdbrasil.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <42C14734.2040403@freebsdbrasil.com.br>; from jmelo@freebsdbrasil.com.br on Tue, Jun 28, 2005 at 09:48:52AM -0300 Cc: freebsd-small@freebsd.org, joker@init.ru Subject: Re: picobsd and freebsd 5.3 X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2005 16:24:06 -0000 On Tue, Jun 28, 2005 at 09:48:52AM -0300, Jean Milanez Melo wrote: > Yuri Kurenkov wrote: > > > Thanx, Luigi, for your development. You script modified for using > > makefs works with RELENG_4 and RELENG_5 and help to me migrate my CF > > versions from RELENG_4 to RELENG_5. But i take one small trouble: I > > can't build 1400K floppy images - makefs say me: ... > Hi Luigi, > > Don't will you commit this "new" picobsd script? i am trying to figure out what dependencies exist and then commit it. cheers luigi From owner-freebsd-small@FreeBSD.ORG Wed Jun 29 05:47:50 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D655616A41C for ; Wed, 29 Jun 2005 05:47:50 +0000 (GMT) (envelope-from y.kurenkov@init.ru) Received: from wolf.init.ru (wolf.init.ru [195.161.186.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30A0043D48 for ; Wed, 29 Jun 2005 05:47:49 +0000 (GMT) (envelope-from y.kurenkov@init.ru) Received: from yk.init.ru (yk.init.ru [195.161.186.13]) by wolf.init.ru (8.13.1/8.13.1) with ESMTP id j5T5libi059047; Wed, 29 Jun 2005 09:47:44 +0400 (MSD) (envelope-from y.kurenkov@init.ru) Received: from [127.0.0.1] (localhost [127.0.0.1]) by yk.init.ru (8.13.3/8.13.3) with ESMTP id j5T5lg25026161; Wed, 29 Jun 2005 09:47:43 +0400 (MSD) (envelope-from y.kurenkov@init.ru) Message-ID: <42C235FE.4090209@init.ru> Date: Wed, 29 Jun 2005 09:47:42 +0400 From: Yuri Kurenkov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050614 X-Accept-Language: ru, en MIME-Version: 1.0 To: Luigi Rizzo References: <844f54af05042812041044a418@mail.gmail.com> <20050428121140.A94424@xorpc.icir.org> <42C12D9F.8050409@init.ru> <42C14734.2040403@freebsdbrasil.com.br> <20050628092357.A1258@xorpc.icir.org> In-Reply-To: <20050628092357.A1258@xorpc.icir.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-small@freebsd.org, joker@init.ru Subject: Re: picobsd and freebsd 5.3 X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2005 05:47:51 -0000 I'm add ffs options to makefs calls '-o bsize=4096 -o fsize=512' taken from newfs calls. This option solve promblem with first makefs call, but second call remain with error: *** Now transfer floppy tree if not already in MFS image makefs: `/usr/src/release/picobsd/build/build_dir-tinet/image.tree' size of 1523712 is larger than the maxsize of 1474560. Luigi Rizzo wrote: > On Tue, Jun 28, 2005 at 09:48:52AM -0300, Jean Milanez Melo wrote: > >>Yuri Kurenkov wrote: >> >> >>>Thanx, Luigi, for your development. You script modified for using >>>makefs works with RELENG_4 and RELENG_5 and help to me migrate my CF >>>versions from RELENG_4 to RELENG_5. But i take one small trouble: I >>>can't build 1400K floppy images - makefs say me: > > ... > >>Hi Luigi, >> >>Don't will you commit this "new" picobsd script? > > > i am trying to figure out what dependencies exist and then > commit it. > > cheers > luigi -- Yuri V. Kurenkov [YVK9-RIPN] JSC "INIT", 88, Frunze st., Taganrog, 347904 RU http://www.init.ru Ph/Fax: +7-8634-391011 ICQ UIN: 21666578 From owner-freebsd-small@FreeBSD.ORG Wed Jun 29 16:00:35 2005 Return-Path: X-Original-To: small@freebsd.org Delivered-To: freebsd-small@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0F8816A432 for ; Wed, 29 Jun 2005 16:00:35 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FF8643D1F for ; Wed, 29 Jun 2005 16:00:35 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j5TG0XgA043819; Wed, 29 Jun 2005 09:00:33 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j5TG0Xut043818; Wed, 29 Jun 2005 09:00:33 -0700 (PDT) (envelope-from rizzo) Date: Wed, 29 Jun 2005 09:00:33 -0700 From: Luigi Rizzo To: small@freebsd.org Message-ID: <20050629090033.B43646@xorpc.icir.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: updated picobsd build script X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2005 16:00:35 -0000 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline attached you can find the latest version of the picobsd build script, that can successfully build 5.x picobsd images hosted on 4.11 and probably 5.x and 6.x images on 5.x (untested). The interesting feature is that it uses sysutils/makefs to build the image so it can run without root privs. The image produced is bootable in qemu which is pretty nice for testing. It would be nice to be able to cross-build 6.x on 4.x but this is not "officially" supported in the main build scripts and so i am looking for a way around. There are issues with the makefiles in /usr/src which are not parsed correctly by the "make" in 4.11, and the "make" version on 6.x does not build using the compiler in 4.x - i am looking for a workaround. cheers luigi --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=picobsd Content-Transfer-Encoding: quoted-printable #!/bin/sh - # # $FreeBSD$ # This file requires sysutils/makefs to run # # The new PicoBSD build script. Invoked as # # picobsd [options] floppy_type site_name # # Where floppy_type is a directory where the picobsd config info # is held, and ${floppy_type}/floppy.tree.${site_name} contains # optional site-specific configuration. # # For Options, see the bottom of the file where the processing is # done. The picobsd(8) manpage might be of some help, but code and docs # tend to lose sync over time... # # This script depends on the following files: # # in ${PICO_TREE} : # Makefile.conf Makefile used to build the kernel # config shell variables, sourced here. # mfs.mtree mtree config file # # floppy.tree/ files which go on the floppy # mfs_tree/ files which go onto the mfs # # in ${MY_TREE} : # PICOBSD kernel config file # config shell variables, sourced here. # crunch.conf crunchgen configuration # floppy.tree.exclude files from floppy.tree/ which we do not need here. # floppy.tree/ local additions to the floppy.tree # floppy.tree.${site}/ same as above, site specific. # mfs_tree/ local additions to the mfs_free # #--- The main entry point is at the end. # # There are two set of initialization. The first one (set_defaults) # is done on entry to the script, and is used to set default values # for all variables which do not depend on floppy type and source tree. # # The second set is done after command line parsing, e.g. # to resolve dependencies on the source tree. # # Naming: # + variables that control operation (e.g. verbosity) and are generally # set from the command line have o_ ("option") as a name prefix # # + variables which contain pathnames and values that should not change # have c_ ("constant") as a name prefix # # + variables exported to Makefiles and subshells are CAPITAL # # + variables local to the script are lowercase, possibly with # an l_ ("local") prefix # SRC points to your FreeBSD source tree. # l_usrtree points to the /usr subdir for the source tree. # Normally /usr or ${SRC}/../usr # l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico # PICO_TREE is where standard picobsd stuff resides. # Normally ${SRC}/release/picobsd # You can set SRC with --src # It is not recommended to override the other variables. # MY_TREE (set later) is where this floppy type resides. # BUILDDIR is the build directory # set some default values for variables. # needs to be done as the first thing in the script. # log something on stdout if verbose. o_verbose=3D0 # this needs to be here! log() { if [ ${o_verbose} -gt 0 ] ; then printf "\n*** %s\n" "$*" if [ ${o_verbose} -gt 1 ] ; then read -p "=3D=3D=3D Press enter to continue" foo fi fi } logverbose() { local foo printf "\n*** %s\n" "$*" read -p "=3D=3D=3D Press enter to continue" foo } set_defaults() { # no way to use logging in this function, variable not set yet. # EDITOR is the editor you use # fd_size floppy size in KB (default to 1440). You can use 1480, # 1720, 2880, etc. but beware that only 1440 and 1480 will boot # from 1.44M floppy drives (1480 will not work on vmware). EDITOR=3D${EDITOR:-vi} fd_size=3D${fd_size:-1440} o_all_in_mfs=3D"yes" # put all files in mfs so you can boot and run # the image via diskless boot. o_clean=3D"" # do not clean o_interactive=3D"" # default is interactive o_verbose=3D0 # verbose level, 0 is silent o_tarv=3D"" # tar verbose flag, "" or "v" o_init_src=3D"" # non "" if we need to init libs and includes. o_makeopts=3D${MAKEOPTS:--s} # make options, be silent by default o_no_devfs=3Dyes # we do not want devfs o_do_modules=3D"" # do not build modules SRC=3D"/usr/src" # default location for sources c_startdir=3D`pwd` # directory where we start # used to lookup config and create BUILDDIR c_boot1=3D/boot/boot1 # boot blocks (in case you want custom ones) c_boot2=3D/boot/boot2 c_reply=3D${c_reply:-`mktemp "/tmp/reply.XXXXXXXXXX"`} # file where User replies will be put c_mnt=3D`mktemp -d "/tmp/picobsd.XXXXXXXXXX"` # mountpoint used to build memory filesystems c_fs=3Dfs.PICOBSD # filename used for the memory filesystem c_img=3Dpicobsd.bin # filename used for the picobsd image # select the right memory disk name case `uname -r` in 6.*|5.*) l_label=3D"bsdlabel" ;; *) l_label=3D"disklabel" ;; esac set -e trap fail 2 #trap fail 3 #trap fail 6 trap fail 15 } create_includes_and_libraries2() { local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then no=3D"-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" else no=3D"-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi MAKEOBJDIRPREFIX=3D${l_objtree} export MAKEOBJDIRPREFIX ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld make $no toolchain ) } create_includes_and_libraries() { local e i log "create_includes_and_libraries() for ${SRC}" # Optionally creates include directory and libraries. mkdir -p ${l_usrtree}/include # the include directory... mkdir -p ${l_usrtree}/share/misc # a few things go here mkdir -p ${l_usrtree}/lib # libraries mkdir -p ${l_usrtree}/sbin # some binaries # override variables for ownershiip and destinations # BINOWN:BINGRP are also used for include files (cd ${SRC}; \ BINOWN=3D`id -un` BINGRP=3D`id -gn` \ DESTDIR=3D${l_usrtree}/.. \ make -m ${SRC}/share/mk includes ) || fail $? includes # Pick up the correct headers for libraries. CFLAGS=3D"-nostdinc -I${l_usrtree}/include" ; export CFLAGS (cd ${SRC} # $e is the invocation of make with correct environment e=3D"MAKEOBJDIRPREFIX=3D${l_objtree}/picobsd/libraries \ BINOWN=3D`id -un` BINGRP=3D`id -gn` \ DESTDIR=3D${l_usrtree}/.. \ make -m ${SRC}/share/mk \ -DNOHTML -DNOINFO -DNOMAN -DNOSHARE -DNOFSCHG " log "do a 'make obj' in a few places." # This is very version-specific... The following works for 5.0 for i in lib secure/lib gnu/lib usr.sbin/pcvt/keycap \ gnu/usr.bin/perl usr.bin/lex usr.sbin/config ; do (cd ${i}; eval $e obj) done log "now make the static libraries" eval $e -DNOPROFILE -DNOPIC libraries (cd ${SRC}/usr.sbin/config eval $e # build binary eval $e install # install it ) ) || fail $? "libraries" log "Libraries done" } # set_type looks in user or system directories for the floppy type # specified as first argument, and sets variables according to the config. # file. Also sets MY_TREE and BUILDDIR and SITE set_type() { local a i log "set_type()" THETYPE=3D$1 SITE=3D$2 a=3D$1 for i in ${c_startdir}/${a} ${PICO_TREE}/${a} ; do log "set_type: checking $i" if [ -d $i -a -f $i/PICOBSD -a -f $i/crunch.conf ] ; then set -- `cat $i/PICOBSD | \ awk '/^#PicoBSD/ {print $2, $3, $4, $5, $6}'` if [ "$1" !=3D "" ]; then MFS_SIZE=3D$1 ; init_name=3D$2 mfs_inodes=3D$3 ; fd_inodes=3D$4 name=3D`(cd $i ; pwd) ` name=3D`basename $name` MY_TREE=3D$i BUILDDIR=3D${c_startdir}/build_dir-${name} log "Matching file $name in $i" return ; fi fi done echo "Type $a NOT FOUND" } clean_tree() { log "clean_tree()" if [ "${name}" =3D "" ] ; then echo "---> Wrong floppy type" exit 3 fi rm -rf ${BUILDDIR} } # prepare a message to be printed in the dialog menus. set_msgs() { # OK log "set_msgs()" MSG1=3D"Type: ${THETYPE} name $name" MSG=3D"PicoBSD build -- Current parameters:\n\n\t1. ${MSG1}\n\ \t2. MFS size: ${MFS_SIZE} kB\n\ \t3. Site-info: ${SITE}\n\t4. Full-path: ${MY_TREE}\n" } # Main build procedure. build_image() { log "build_image() <${name}>" [ "${name}" !=3D "" ] || fail $? bad_type clear set_msgs printf "${MSG}---> We'll use the sources living in ${SRC}\n\n" # read config variables from a global and then a type-specific file # basically STAND_LINKS and MY_DEVS, but can also override other # variables. #=20 . ${PICO_TREE}/build/config if [ -f ${MY_TREE}/config ] ; then . ${MY_TREE}/config fi # location of the object directory PICO_OBJ=3D${l_objtree}/picobsd/${THETYPE} log "PICO_OBJ is ${PICO_OBJ}" if [ ${OSVERSION} -ge 500035 ] ; then MAKEOBJDIRPREFIX=3D${l_objtree} export MAKEOBJDIRPREFIX log `cd ${SRC}; make -f Makefile.inc1 -V WMAKEENV` eval export `cd ${SRC}; make -f Makefile.inc1 -V WMAKEENV` fi # create build directory and subtree mkdir -p ${BUILDDIR}/crunch # remove any old stuff rm -f ${BUILDDIR}/kernel.gz ${BUILDDIR}/${c_fs} # invoke commands to build a kernel do_kernel # fill a subdirectory with things that go into the floppy # (mostly /etc and similar stuff) populate_floppy_fs # populate it and produce a file with the MFS image populate_mfs_tree # things which go into mfs # create, mount and fill a filesystem with floppy image fill_floppy_image # copies everything into the floppy } build_package() { local z msg log "build_package()" touch build.status echo "##############################################" >>build.status echo "## `date` ">>build.status echo "##############################################" >>build.status for z in bridge dial router net isp ; do set_type ${z} echo "---------------------------------------------">>build.status echo "Building TYPE=3D${z}, SIZE=3D${MFS_SIZE}" >>build.status msg=3D"(ok)" # error message build_image || msg=3D"** FAILED! **" echo " ${msg}">>build.status # where do i put things ? # clean_tree done exit 0 } # Set build parameters interactively main_dialog() { local ans i l log "main_dialog()" while [ true ] ; do set_msgs rm ${c_reply} dialog --menu "PicoBSD build menu -- (29 sep 2001)" 19 70 12 \ N "--> READY, build it <---" \ T "${MSG1}" \ K "edit Kernel config file" \ E "Edit crunch.conf file" \ S "MFS Size: ${MFS_SIZE}kB" \ I "Init type: ${init_name}" \ F "Floppy size: ${fd_size}kB" \ M "MFS bytes per inode: ${mfs_inodes}" \ U "UFS bytes per inode: ${fd_inodes}" \ $ "Site-info: ${SITE}" \ Q "Quit" \ 2> ${c_reply} ans=3D`cat ${c_reply}` rm ${c_reply} case ${ans} in T) l=3D"" for i in ${c_startdir} ${c_startdir}/* ${PICO_TREE}/* ; do if [ -d $i -a -f $i/PICOBSD -a -f $i/crunch.conf ]; then l=3D"$l `basename $i` `basename $i`" fi done log $l { dialog --menu "Setup the type of configuration" 12 70 5 $l \ 2> ${c_reply} && set_type "`cat ${c_reply}`" ${SITE} ; } || true ;; I) { dialog --menu "Choose your init(8) program" \ 10 70 2 init "Standard init (requires getty)" \ oinit "small init from TinyWare" 2> ${c_reply} \ && init_name=3D`cat ${c_reply}` ; } || true ;; K) ${EDITOR} ${MY_TREE}/PICOBSD ;; E) ${EDITOR} ${MY_TREE}/crunch.conf ;; S) { dialog --title "MFS Size setup" --inputbox \ "MFS size depends on what you need to put on the MFS image. Typically \ ranges between 820kB (for very small bridge/router images) to \ as much as 2500kB kB for a densely packed image. \ Keep in mind that this memory is \ totally lost to other programs. Usually you want to keep \ this as small as possible. " 10 70 2> ${c_reply} \ && MFS_SIZE=3D`cat ${c_reply}` ; } || true ;; \$) { dialog --title "Site info setup" --inputbox \ "Please enter the full path to the directory \ containing site-specific setup. \ This directory tree must contain files that replace \ standard ones in floppy.tree/ and mfs.tree/ . " \ 10 70 2> ${c_reply} && SITE=3D`cat ${c_reply}` ; } || true ;; F) { dialog --menu "Set floppy size" 15 70 4 \ 1440 "1.44MB" 1720 "1.72MB" 2880 "2.88MB" 4096 "4MB" \ 2> ${c_reply} && fd_size=3D`cat ${c_reply}` ; } || true ;; M) { dialog --title "MFS bytes per inode:" --inputbox \ "Enter MFS bytes per inode (typically 4096..65536). \ A larger value means fewer inodes but more space on MFS" \ 10 70 2> ${c_reply} && mfs_inodes=3D`cat ${c_reply}` ; } || true ;; U) { dialog --title "Floppy bytes per inode:" --inputbox \ "Enter floppy bytes per inode (typically 3072..65536). \ A larger value means fewer inodes but more space on the floppy." \ 10 70 2> ${c_reply} && fd_inodes=3D`cat ${c_reply}` ; } || true ;; N) break 2 ;; Q) exit 0 ;; *) echo "=07Unknown option \"${ans}\". Try again." sleep 2 clear ;; esac done } # Call the build procedure # Install image do_install() { log "do_install()" if [ "${o_interactive}" =3D "NO" ] ; then echo "+++ Build completed +++" cat .build.reply || true return fi dialog --title "Build ${THETYPE} completed" --inputbox \ "\nThe build process was completed successfuly.\n\ `cat .build.reply` \n\n\ Now we are going to install the image on the floppy.\n\ Please insert a blank floppy in /dev/fd0.\\n WARNING: the contents of the floppy will be permanently erased!\n\ \n\ Your options:\n\ * ^C or [Cancel] to abort,\n\ * Enter to install ${c_img},\n\ " 20 80 2> ${c_reply} if [ "$?" =3D "0" ]; then echo "Writing ${c_img}..." dd if=3D${BUILDDIR}/${c_img} of=3D/dev/fd0.${fd_size} else echo "Ok, the image is in ${c_img}" fi echo "Done." } #------------------------------------------------------------------- # invoke the Makefile to compile the kernel. do_kernel() { # OK log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ; # export CONFIG if [ "${o_do_modules}" =3D "yes" ] ; then MODULES=3D"" export MODULES fi make -m ${SRC}/share/mk -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel } # Populate the variable part of the floppy filesystem. Must be done before # the MFS because its content might need to be copied there as well. # # This involves fetching files from three subtrees, in this order: # # 1. a standard one, from which type-specific files are excluded; # 2. a type-specific one; # 3. a site-specific one. # # Files are first copied to a local tree and then compressed. populate_floppy_fs() { # OK local dst excl srcdir log "populate_floppy_fs()" dst=3D${BUILDDIR}/floppy.tree log "pwd=3D`pwd` Populating floppy filesystem..." # clean relics from old compilations. rm -rf ${dst} || true mkdir ${dst} excl=3D${MY_TREE}/floppy.tree.exclude if [ -f ${excl} ] ; then excl=3D"--exclude-from ${excl}" log "Files excluded from generic tree: `echo;cat ${excl}`" else excl=3D"" fi (cd ${PICO_TREE}/floppy.tree ; tar -cf - --exclude CVS ${excl} . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from generic floppy-tree `echo; ls -laR ${dst}`" srcdir=3D${MY_TREE}/floppy.tree if [ -d ${srcdir} ] ; then log "update with type-specific files:" (cd ${srcdir} ; tar -cf - --exclude CVS . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from type floppy-tree `echo; ls -laR ${dst}`" else log "No type-specific floppy-tree" fi if [ -d ${srcdir}.${SITE} ] ; then log "Update with site-specific (${SITE}) files:" (cd ${srcdir}.${SITE} ; tar -cf - --exclude CVS . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from site floppy-tree `echo; ls -laR ${dst}`" else log "No site-specific floppy-tree" fi # gzip returns an error if it fails to compress some file (cd $dst ; gzip -9 etc/* log "Compressed files in etc/ `echo; ls -l etc`" ) || true } # Populate the memory filesystem with binaries and non-variable # configuration files. # First do an mtree pass, then create directory links and device entries, # then run crunchgen etc. to build the binary and create links. # Then copy the specific/generic mfs_tree. # Finally, if required, make a copy of the floppy.tree onto /fd populate_mfs_tree() { local a dst log "populate_mfs_tree()" dst=3D${BUILDDIR}/mfs.tree # clean relics from old compilations. rm -rf ${dst} || true mkdir ${dst} log "pwd=3D`pwd`, Populating MFS tree..." # use type-specific mfs.mtree, default to generic one. a=3D${MY_TREE}/mfs.mtree [ -f ${a} ] || a=3D${PICO_TREE}/build/mfs.mtree log "Running mtree using $a..." mtree -deU -f $a -p ${dst} > /dev/null || fail $? mtree # XXX create links for i in ${STAND_LINKS}; do ln -s /stand ${dst}/$i done ln -s /dev/null ${dst}/var/run/log ln -s /etc/termcap ${dst}/usr/share/misc/termcap ( cd ${BUILDDIR}/crunch log "Making and installing crunch1 from `pwd` src ${SRC}..." a=3D${BUILDDIR}/crunch1.conf ( export BUILDDIR SRC MY_TREE PICO_OBJ ; make -m ${SRC}/share/mk \ -v -f ${PICO_TREE}/build/Makefile.conf ${BUILDDIR}/crunch.mk ) log "Libs are ${LIBS} " export SRC # used by crunch.mk # export LIBS CFLAGS log "Now make -f crunch.mk" make -m ${SRC}/share/mk ${o_makeopts} -f ${BUILDDIR}/crunch.mk strip --remove-section=3D.note --remove-section=3D.comment crunch1 mv crunch1 ${dst}/stand/crunch chmod 555 ${dst}/stand/crunch log "Making links for binaries..." for i in `crunchgen -l $a` ; do ln ${dst}/stand/crunch ${dst}/stand/${i}; done # rm $a # do not remove! ) || fail $? crunch if [ -f ${dst}/stand/sshd ] ; then log "Setting up host key for sshd:" if [ -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key.gz ] ; then log "Using existing host key" else log "Generating new host key"=20 ssh-keygen -t rsa1 -f ${BUILDDIR}/floppy.tree/etc/ssh_host_key \ -N "" -C "root@picobsd" gzip -9 ${BUILDDIR}/floppy.tree/etc/ssh_host_key* || true fi fi log "Copy generic and site-specific MFS tree..." for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do if [ -d ${MFS_TREE} ] ; then log "Copy ${MFS_TREE} ..." (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) fi done if [ "${o_all_in_mfs}" =3D "yes" ]; then log "Copy generic floppy_tree into MFS..." cp -Rp ${BUILDDIR}/floppy.tree/* ${dst}/fd fi if [ "${o_no_devfs}" !=3D "" ] ; then # create device entries using MAKEDEV (cd ${dst}/dev ln -s ${SRC}/etc/MAKEDEV ; chmod 555 MAKEDEV # log `pwd` sh ./MAKEDEV ${MY_DEVS} rm MAKEDEV ) fi if [ "`id -u`" =3D "0" ] ; then log "Fixing permissions" (cd ${dst}; chown -R root . ) fi if [ -n "${import_files}" ] ; then log "importing ${import_files} into mfs" # We do it in a chroot environment on the target so # symlinks are followed correctly. cp `which tar` ${dst}/my_copy_of_tar (cd ${l_usrtree}/.. ; tar cf - ${import_files} ) | \ (chroot ${dst} /my_copy_of_tar xf - ) rm ${dst}/my_copy_of_tar fi (cd ${BUILDDIR} # override the owner echo "/set uid=3D0 gid=3D0" > mtree.out mtree -c -p ${dst} -k "" >> mtree.out log "mtre.out at ${BUILDDIR}/mtree.out" makefs -t ffs -o bsize=3D4096 -o fsize=3D512 \ -s ${MFS_SIZE}k -f 100 -F mtree.out ${c_fs} ${dst} ls -l ${c_fs} ) log "done mfs image" } final_cleanup() { log "final_cleanup()" rm -rf ${c_mnt} ${c_reply} 2> /dev/null || true rm -f ${c_reply} } # fail errno errcode # This function is used to trap errors and print msgs # fail() { local errno errocode where errno=3D$1 errcode=3D$2 where=3D$3 echo "---> fail: Error <${errno}> error code <${errcode}> in <${where}>" case ${errcode} in mtree) echo "Error while making hierarchy in ${c_mnt}" ;; crunch) echo "Error while building ${name}." ;; missing_kernel) echo "Error: you must build PICOBSD${suffix} kernel first" ;; includes) echo "Error: failed while making includes" ;; libraries) echo "Error: failed while making libraries" ;; bad_type) echo "Error: unknown floppy type ${name}" ;; no_space) echo "Error: no space left on device (${where})" ;; no_mfs) echo "Error: while writing MFS into the kernel." ;; "") echo "User break" errcode=3D"userbreak" ;; *) echo "unknown error, maybe user break: $errno $errcode" ;; esac echo "---> Aborting $0" # try to cleanup the vnode. final_cleanup exit 2 } fill_floppy_image() { local blocks dst log "fill_floppy_image()" dst=3D${c_mnt} # where to create the image log "Preparing ${fd_size}kB floppy filesystem..." # correct blocks according to size. blocks=3D${fd_size}; if [ "${blocks}" =3D "1720" ]; then blocks=3D1722 elif [ "${blocks}" =3D "1480" ]; then blocks=3D1476 fi log "Labeling floppy image" log "patch ${c_boot2} to boot /kernel right away" b2=3D${BUILDDIR}/boot2 # modified boot2 cp -f ${c_boot2} ${b2} chmod 0644 ${b2} set `strings -at d ${b2} | grep "/boot/loader"` echo -e "/kernel\0\0\0\0\0" | \ dd of=3D${b2} obs=3D$1 oseek=3D1 conv=3Dnotrunc 2>/dev/null chmod 0444 ${b2} dst=3D${BUILDDIR}/image.tree rm -rf ${dst} mkdir -p ${dst} ( cd ${BUILDDIR} # $1 takes the offset of the MFS filesystem set `strings -at d kernel | grep "MFS Filesystem goes here"` mfs_ofs=3D$(($1 + 8192)) log "Preload kernel with file ${c_fs} at ${mfs_ofs}" dd if=3D${c_fs} ibs=3D8192 iseek=3D1 of=3Dkernel obs=3D${mfs_ofs} \ oseek=3D1 conv=3Dnotrunc 2> /dev/null log "Compress with kgzip and copy to floppy image" kgzip -o kernel.gz kernel cp -p kernel.gz ${dst}/kernel || fail $? no_space "copying kernel" log "Now transfer floppy tree if not already in MFS image" # now transfer the floppy tree. If it is already in mfs, dont bother. if [ "${o_all_in_mfs}" !=3D "yes" ] ; then cp -Rp floppy.tree/* ${dst} || \ fail $? no_space "copying floppy tree" fi ) (cd ${BUILDDIR} makefs -t ffs -o bsize=3D4096 -o fsize=3D512 \ -s ${blocks}k -f 50 ${c_img} ${dst} # ${l_label} -f `pwd`/${c_img} ${l_label} -w -f `pwd`/${c_img} auto # write in a label # copy partition c: into a: with some sed magic ${l_label} -f `pwd`/${c_img} | sed -e '/ c:/{p;s/c:/a:/;}' | \ ${l_label} -R -f `pwd`/${c_img} /dev/stdin ${l_label} -f `pwd`/${c_img} ls -l ${c_img} logverbose "after disklabel" ) # dump the primary and secondary boot dd if=3D${c_boot1} of=3D${BUILDDIR}/${c_img} conv=3Dnotrunc 2>/dev/null dd if=3D${b2} iseek=3D1 2> /dev/null | \ dd of=3D${BUILDDIR}/${c_img} oseek=3D2 conv=3Dnotrunc 2>/dev/null logverbose "done floppy image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply rm -rf ${dst} rm ${BUILDDIR}/kernel.gz ${BUILDDIR}/${c_fs} } # This function creates variables which depend on the source tree in use: # SRC, l_usrtree, l_objtree # Optionally creates libraries, includes and the like (for cross compiles, # needs to be done once). set_build_parameters() { log "set_build_parameters() SRC is ${SRC}" if [ "${SRC}" =3D "/usr/src" ] ; then l_usrtree=3D${USR:-/usr} else l_usrtree=3D${USR:-${SRC}/../usr} fi l_objtree=3D${l_usrtree}/obj-pico PICO_TREE=3D${PICO_TREE:-${SRC}/release/picobsd} set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` OSVERSION=3D$3 log "OSVERSION is ${OSVERSION}" if [ "${o_init_src}" !=3D "" ] ; then if [ ${OSVERSION} -lt 500035 ] ; then create_includes_and_libraries else create_includes_and_libraries2 fi fi if [ ${OSVERSION} -lt 500035 ] ; then # Create the right LIBS and CFLAGS for further builds. # and build the config program LIBS=3D"-L${l_usrtree}/lib" CFLAGS=3D"-nostdinc -I${l_usrtree}/include" export LIBS CFLAGS CONFIG=3D${l_usrtree}/sbin/config export CONFIG fi } #------------------------------------------------------------------- # Main entry of the script. Initialize variables, parse command line # arguments. set_defaults while [ true ]; do case $1 in --src) # set the source path instead of /usr/src SRC=3D`(cd $2; pwd)` shift ;; --init) o_init_src=3D"YES" ;; --floppy_size) fd_size=3D$2 shift ;; --all_in_mfs) o_all_in_mfs=3D"yes" ;; --no_all_in_mfs) o_all_in_mfs=3D"" ;; --modules) # also build kernel modules o_do_modules=3D"yes" ;; -n) o_interactive=3D"NO" ;; -clear|-clean|-c) # clean o_clean=3D"YES" o_interactive=3D"NO" ;; -v) # need -v -v to wait for user input o_verbose=3D$((${o_verbose}+1)) # verbose level o_tarv=3D"v" # tar verbose flag o_makeopts=3D"-d l" # be verbose ;; *) break ; ;; esac shift done set_build_parameters # things that depend on ${SRC} set_type $1 $2 # type and site, respectively # If $1=3D"package", it creates a neat set of floppies if [ "$1" =3D "package" ] ; then build_package fi if [ "${o_interactive}" !=3D "NO" ] ; then main_dialog fi if [ "${o_clean}" =3D "YES" ] ; then clean_tree else build_image do_install fi final_cleanup exit 0 --KsGdsel6WgEHnImy-- From owner-freebsd-small@FreeBSD.ORG Fri Jul 1 09:41:31 2005 Return-Path: X-Original-To: freebsd-small@freebsd.org Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B047A16A41C for ; Fri, 1 Jul 2005 09:41:31 +0000 (GMT) (envelope-from joker@init.ru) Received: from wolf.init.ru (wolf.init.ru [195.161.186.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20DD143D1D for ; Fri, 1 Jul 2005 09:41:30 +0000 (GMT) (envelope-from joker@init.ru) Received: from yk.init.ru (yk.init.ru [195.161.186.13]) by wolf.init.ru (8.13.1/8.13.1) with ESMTP id j619fRo3014930; Fri, 1 Jul 2005 13:41:27 +0400 (MSD) (envelope-from joker@init.ru) Received: from [127.0.0.1] (localhost [127.0.0.1]) by yk.init.ru (8.13.3/8.13.3) with ESMTP id j619fP52014088; Fri, 1 Jul 2005 13:41:26 +0400 (MSD) (envelope-from joker@init.ru) Message-ID: <42C50FBA.1000506@init.ru> Date: Fri, 01 Jul 2005 13:41:14 +0400 From: Yuri Kurenkov Organization: JSC INIT User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050614 X-Accept-Language: ru, en MIME-Version: 1.0 Newsgroups: gmane.os.freebsd.devel.small To: Luigi Rizzo , freebsd-small@freebsd.org References: <20050629090033.B43646@xorpc.icir.org> In-Reply-To: <20050629090033.B43646@xorpc.icir.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: updated picobsd build script X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: joker@init.ru List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2005 09:41:31 -0000 Luigi Rizzo wrote: > attached you can find the latest version of the picobsd build script, > that can successfully build 5.x picobsd images hosted on 4.11 and > probably 5.x and 6.x images on 5.x (untested). > The interesting feature is that it uses sysutils/makefs to build > the image so it can run without root privs. The image produced > is bootable in qemu which is pretty nice for testing. I can't build any 1440k images hosted on 4.11 and 5.4 with such problem: ---8<---------------8<-------------------8<--------------- Calculated size of `fs.PICOBSD': 3276800 bytes, 170 inodes Extent size set to 4096 fs.PICOBSD: 3.1MB (6400 sectors) block size 4096, fragment size 512 using 1 cylinder groups of 3.12MB, 800 blks, 192 inodes. super-block backups (for fsck -b #) at: 32, Populating `fs.PICOBSD' Image `fs.PICOBSD' complete -rwxr-xr-x 1 root wheel 3276800 1 ÉÀÌ 13:05 fs.PICOBSD makefs: `/usr/src/release/picobsd/build/build_dir-bridge/image.tree' size of 1556480 is larger than the maxsize of 1474560. *** Error code 1 ---8<---------------8<-------------------8<--------------- "Native" 4.11 script build this images successfully. 2880k images you script build successfully. I try to write builded by Your script 2880k images (4.11 and 5.4) to CD-R and CF and boot. But images don't boot whith diagnostic "Operating System not found". Builded by native 4.11 script (# $FreeBSD: src/release/picobsd/build/picobsd,v 1.1.2.28 2002/12/02 22:33:50 luigi Exp $) images boot succsessfully with same cofig set. Unbootable images successfully mount/umount and readable/writable. I Think, problem with installing /boot/boot* to image.. Thx for works, Luigi!.. > cheers > luigi > -- Yuri V. Kurenkov [YVK9-RIPN] JSC "INIT", 88, Frunze st., Taganrog, 347904 RU http://www.init.ru Ph/Fax: +7-8634-391011 ICQ UIN: 21666578