From rd at tilde.se Wed Nov 1 22:51:31 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Wed, 01 Nov 2006 12:51:31 +0100 Subject: [flashboot] Script for diskimage-creation Message-ID: <45488A43.60907@tilde.se> Hi, Attached is a script that creates a diskimage-file for use with flashboot. This means that you no longer need to connect the flashcard to the system where you build flashboot. Instead you can gzip and move the imagefile to your PC and use tools like dd or http://m0n0.ch/wall/physdiskwrite.php to write it to your flashcard. The script needs to be adapted to the geometry of the disk you are using, right now this is done by editing the script but before we commit I will add something that lets the user specify this in the command-line. This scripts needs some testing and auditing before we can commit it, so it would be great if everyone can help out. Also, a great feature would be if the script could write directly to a flash-device. Not critical, but that would make it one step less for the people that use connect their flash to the system where the build flashboot. Anyone with a flashreader on their build-system could There is also two support-scripts that let you mount and unmount the image after creation. These can be used for creating and editing configuration after the image-creation process. Also, boot.conf needs to be copied to inital-conf before you start. This is the only file that is copied to the filesystem other than the boot-loader and kernel. Thanks, Rickard. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: build-diskimage.sh Url: http://lists.mindrot.org/pipermail/flashboot/attachments/20061101/7118b592/attachment.ksh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mountimage.sh Url: http://lists.mindrot.org/pipermail/flashboot/attachments/20061101/7118b592/attachment-0001.ksh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: umountimage.sh Url: http://lists.mindrot.org/pipermail/flashboot/attachments/20061101/7118b592/attachment-0002.ksh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: boot.conf Url: http://lists.mindrot.org/pipermail/flashboot/attachments/20061101/7118b592/attachment-0003.ksh From jacob.winther at gmail.com Mon Nov 6 14:08:31 2006 From: jacob.winther at gmail.com (Jacob Winther) Date: Mon, 6 Nov 2006 16:08:31 +1300 Subject: [flashboot] Script for diskimage-creation In-Reply-To: <45488A43.60907@tilde.se> References: <45488A43.60907@tilde.se> Message-ID: Tested with physdiskwrite and worked fine for me with some minor changes: let asize=$totalsize-$sectorstrack (I have 63 sectors/head) and less importantly MOUNTPOINT=/mnt (double slashes) Any reason why you need to specify totalsize and sectorscylinder instead of deriving them from c/h/s values? Cheers Jacob On 11/2/06, Rickard Dahlstrand wrote: > Hi, > > Attached is a script that creates a diskimage-file for use with > flashboot. This means that you no longer need to connect the flashcard > to the system where you build flashboot. Instead you can gzip and move > the imagefile to your PC and use tools like dd or > http://m0n0.ch/wall/physdiskwrite.php to write it to your flashcard. > > The script needs to be adapted to the geometry of the disk you are > using, right now this is done by editing the script but before we commit > I will add something that lets the user specify this in the command-line. > > This scripts needs some testing and auditing before we can commit it, so > it would be great if everyone can help out. > > Also, a great feature would be if the script could write directly to a > flash-device. Not critical, but that would make it one step less for the > people that use connect their flash to the system where the build > flashboot. Anyone with a flashreader on their build-system could > > There is also two support-scripts that let you mount and unmount the > image after creation. These can be used for creating and editing > configuration after the image-creation process. > > Also, boot.conf needs to be copied to inital-conf before you start. This > is the only file that is copied to the filesystem other than the > boot-loader and kernel. > > Thanks, Rickard. > > > stty com0 9600 > set tty com0 > > > _______________________________________________ > flashboot mailing list > flashboot at mindrot.org > http://lists.mindrot.org/mailman/listinfo/flashboot > > > > From rd at tilde.se Tue Nov 7 18:08:09 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Tue, 07 Nov 2006 08:08:09 +0100 Subject: [flashboot] Script for diskimage-creation In-Reply-To: References: <45488A43.60907@tilde.se> <454F3B74.10405@tilde.se> Message-ID: <455030D9.7080805@tilde.se> Hi Jakob, Jacob Winther wrote: > Hi > > I've attached my version, it also includes my c/h/s value. Small > feature request, a command line option to gzip it would be nice, as my > vmware box can't write images to my flash. I thought about this and this makes it harder and slower to use the mountme-scripts, and since it's so easy to gzip when you're done and need to send the image of the build machine, it might be easier to just do it manually. However I will add it to the instructions at the end. > > One other thought, my flash it 500Mb, and the contents of it is only > 10Mb, is there any way of making a smaller image that still looks like > a full image once installed. I guess my thoughts was that if the mbr, > disklabel and filesystem only write stuff to the beginning of the > disk, can you just write the first 10Mb of the disk and still have it > ready to be fully utilised, basically it would drop the time to write > the image down drastically. The thought has crossed my mind. However I know to little about these things to take any shortcuts, I have no idea how vnconfig will like a truncated image. An alternative is as you state above to use gzip as this is quite effective in compressing the zeros in the end. I'm coping the list if there is anyone else has thoughts on this subject. Rickard > > Nice work though. > > Cheers > Jacob > > On 11/7/06, Rickard Dahlstrand wrote: >> Hi Jacob, >> >> Thanks for testing, I agree with all of your changes. Any chance that >> you can send a patch or a complete script of these changes as they work >> for you. >> >> Regards, Rickard. >> >> Jacob Winther wrote: >> > Tested with physdiskwrite and worked fine for me with some minor >> changes: >> > >> > let asize=$totalsize-$sectorstrack (I have 63 sectors/head) >> > >> > and less importantly >> > >> > MOUNTPOINT=/mnt (double slashes) >> > >> > Any reason why you need to specify totalsize and sectorscylinder >> > instead of deriving them from c/h/s values? >> > >> > Cheers >> > Jacob >> > >> > >> > >> > On 11/2/06, Rickard Dahlstrand wrote: >> >> Hi, >> >> >> >> Attached is a script that creates a diskimage-file for use with >> >> flashboot. This means that you no longer need to connect the >> flashcard >> >> to the system where you build flashboot. Instead you can gzip and >> move >> >> the imagefile to your PC and use tools like dd or >> >> http://m0n0.ch/wall/physdiskwrite.php to write it to your flashcard. >> >> >> >> The script needs to be adapted to the geometry of the disk you are >> >> using, right now this is done by editing the script but before we >> commit >> >> I will add something that lets the user specify this in the >> >> command-line. >> >> >> >> This scripts needs some testing and auditing before we can commit >> it, so >> >> it would be great if everyone can help out. >> >> >> >> Also, a great feature would be if the script could write directly >> to a >> >> flash-device. Not critical, but that would make it one step less >> for the >> >> people that use connect their flash to the system where the build >> >> flashboot. Anyone with a flashreader on their build-system could >> >> >> >> There is also two support-scripts that let you mount and unmount the >> >> image after creation. These can be used for creating and editing >> >> configuration after the image-creation process. >> >> >> >> Also, boot.conf needs to be copied to inital-conf before you >> start. This >> >> is the only file that is copied to the filesystem other than the >> >> boot-loader and kernel. >> >> >> >> Thanks, Rickard. >> >> >> >> >> >> stty com0 9600 >> >> set tty com0 >> >> >> >> >> >> _______________________________________________ >> >> flashboot mailing list >> >> flashboot at mindrot.org >> >> http://lists.mindrot.org/mailman/listinfo/flashboot >> >> >> >> >> >> >> >> >> From rd at tilde.se Wed Nov 8 05:15:38 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Tue, 07 Nov 2006 19:15:38 +0100 Subject: [flashboot] Script for diskimage-creation Message-ID: <4550CD4A.8000502@tilde.se> BTW http://m0n0.ch/wall/physdiskwrite.php supports gzipped kernels. Rickard. From rd at tilde.se Wed Nov 8 19:19:26 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Wed, 08 Nov 2006 09:19:26 +0100 Subject: [flashboot] Script for diskimage-creation In-Reply-To: <4550CD4A.8000502@tilde.se> References: <4550CD4A.8000502@tilde.se> Message-ID: <4551930E.1050701@tilde.se> gzipped diskimages I mean. And on unix you can use the command: gunzip -c image.gz | dd of=/dev/sd0c Rickard. Rickard Dahlstrand wrote: > BTW http://m0n0.ch/wall/physdiskwrite.php supports gzipped kernels. > > Rickard. > > _______________________________________________ > flashboot mailing list > flashboot at mindrot.org > http://lists.mindrot.org/mailman/listinfo/flashboot > From hinman at ahpcrc.org Tue Nov 14 08:32:31 2006 From: hinman at ahpcrc.org (Lee Hinman) Date: Mon, 13 Nov 2006 15:32:31 -0600 Subject: [flashboot] anoncvs access for flashboot? Message-ID: Is there anoncvs access to flashboot? Thanks. -- Lee From djm at mindrot.org Tue Nov 14 08:36:38 2006 From: djm at mindrot.org (Damien Miller) Date: Tue, 14 Nov 2006 08:36:38 +1100 (EST) Subject: [flashboot] anoncvs access for flashboot? In-Reply-To: References: Message-ID: On Mon, 13 Nov 2006, Lee Hinman wrote: > > Is there anoncvs access to flashboot? Thanks. Yes: export CVS_RSH=ssh cvs -d anoncvs at anoncvs.mindrot.org:/cvs co flashboot Expect a SSH host RSA key with a fingerprint of: 8e:09:e9:fb:dc:af:e4:a5:e6:a0:e2:28:59:63:84:17 There is also a CVSweb interface at: http://cvsweb.mindrot.org/index.cgi/flashboot/ -d From rd at tilde.se Mon Nov 20 21:26:03 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Mon, 20 Nov 2006 11:26:03 +0100 Subject: [flashboot] Is it time for a new release?? Message-ID: <456182BB.6020906@tilde.se> Hi, I was thinking that with 4.0 released and all these neat changes being made to flashboot, that it might now be time for a new release. What do people think, is the stuff in the cvs tested enough? Also, what do you think about providing cf-images as part of the binary release? What size are normal or the max needed? 64/128 MB? Damien, I would be happy to provide you with all the images and binaries for the release if you feel that you lack the time to do it. Regards, Rickard. From rd at tilde.se Mon Nov 20 21:25:59 2006 From: rd at tilde.se (Rickard Dahlstrand) Date: Mon, 20 Nov 2006 11:25:59 +0100 Subject: [flashboot] Script for diskimage-creation In-Reply-To: <455030D9.7080805@tilde.se> References: <45488A43.60907@tilde.se> <454F3B74.10405@tilde.se> <455030D9.7080805@tilde.se> Message-ID: <456182B7.6050009@tilde.se> Rickard Dahlstrand wrote: > Jacob Winther wrote: > >> One other thought, my flash it 500Mb, and the contents of it is only >> 10Mb, is there any way of making a smaller image that still looks like >> a full image once installed. I guess my thoughts was that if the mbr, >> disklabel and filesystem only write stuff to the beginning of the >> disk, can you just write the first 10Mb of the disk and still have it >> ready to be fully utilised, basically it would drop the time to write >> the image down drastically. >> > The thought has crossed my mind. However I know to little about these > things to take any shortcuts, I have no idea how vnconfig will like a > truncated image. An alternative is as you state above to use gzip as > this is quite effective in compressing the zeros in the end. > > I'm coping the list if there is anyone else has thoughts on this subject. > I have done some more research and here is my conclusion. Fell free to comment. When we use the build-diskimage-script we are telling disklabel, fdisk and all the other tools that the disk we are writing to are for example 128 MB, it will then allocate and create a partition with that size. When we later write that image to a flash we are writing the partition-info as well. This means that if we write a 128 MB image to a 256 MB flash this will give us a 128 MB disk with 128 MB unused. In other words you can only use the 128 MB of the flash and the rest would be unallocated. Below are some output from a 128 MB file written to a 256 MB flash. As you can see obsd reports this as a 256 MB disk at boot and a 128 MB partition in disklabel and fdisk. So if we where to make a default smaller partition in the script we would have to resize it later in the process if the user wanted to use more of the flash. (There are some info on a process like that here: http://wiki.pfsense.com/wikka.php?wakka=FlashHowTo ) Other than that I don't think there is a problem. I don't know how sec/cyl differences will affect the disk, but from what I can see from other sources this should be no problem. Rickard. ------SNIP------- wd0 at pciide0 channel 0 drive 1: wd0: 1-sector PIO, LBA, 248MB, 508928 sectors ------SNIP------- [root at probe22 root]# disklabel -r wd0 # Inside MBR partition 3: type A6 start 32 size 250848 # /dev/rwd0c: type: SCSI disk: vnd device label: fictitious flags: bytes/sector: 512 sectors/track: 32 tracks/cylinder: 8 sectors/cylinder: 256 cylinders: 980 total sectors: 250880 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 250848 32 4.2BSD 2048 16384 952 # Cyl 0*- 979 c: 250880 0 unused 0 0 # Cyl 0 - 979 [root at probe22 root]# fdisk wd0 Disk: wd0 geometry: 490/16/32 [250880 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused *3: A6 0 1 1 - 489 15 32 [ 32: 250848 ] OpenBSD [root at probe22 root]# df Filesystem 512-blocks Used Avail Capacity Mounted on /dev/rd0a 29390 28340 1050 96% / mfs:26470 23774 19174 3412 85% /usr/local /dev/wd0a 243068 35436 195480 15% /flash [root at probe22 root]# df -h Filesystem Size Used Avail Capacity Mounted on /dev/rd0a 14.4M 13.8M 525K 96% / mfs:26470 11.6M 9.4M 1.7M 85% /usr/local /dev/wd0a 119M 17.3M 95.4M 15% /flash ------SNIP------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.mindrot.org/pipermail/flashboot/attachments/20061120/024a26f4/attachment.html