I am trying to put OpenBSD on some Soekris machines. I have looked around and fount the flashrd toolkit. Uinsg it, I was able to create a bootable compact flash image for one of the machines. However, I pretty much did it by following the driections without understnaidng what was being don, and we all know where that leads :-) Now, I am trying to change a fwe things, and I need to get a better understnading of what is being done here. Specifically, I want to create a larger /usr partion in the vnd iamge. What determiens the size of these? I have looked through the cfgflashrd, and the growimg scripts, but I don't see any knobs to tweak in these for this. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
It's generally recommended to just do a full install; a couple of GB of Flash memory is now sufficiently cheap that mucking with flashrd probably isn't worth the effort. Joachim
yes. PLEASE. Follow the logic: * I use a special install * I want to customize it. * HELP ME! * I will get no support from ANYONE on the result. vs. * I use a standard install. * Things Just Work. Just yesterday, I inquired about "small" CF media. Smallest my local computer superstore had was...4G. 4G!! I can put most Windows and Linux installs in that! I ran file servers handling 50 users on one fourth that size! OpenBSD can do builds in that space. PLEASE, forget those mutant systems ever existed (or...don't ask about them here), stick to standard installs. IF you get to a point where the standard install doesn't do the job for some reason, by then you will probably understand the system well enough to do what you want done on your own, without asking people for help bastardizing a bastardized system. No one who is encouraging you to use some bastardized system for your solution is your friend, they are just encouraging you to waste your time unproductively. Nick.
Want a smaller one? I've a (4 years old) 256MB media in my soekris and I'd exchange it for the 4GB one ;-) Oh, and for the public: I'm running a boring standard installation of OpenBSD on it, with all sets except comp and the x stuff. Yes, manpages and games are installed, too. Ciao, Kili -- CRM114 isn't ugly like PERL. It's a whole different kind of ugly. -- John Bowker
OK with one resevation you have convinced me. Let's eliminate teh reservation. One of the features of the system I chose was that it mounts the flas RO, and uses memory filesystems for volatile stuff. Is this no longer important? I have 2 existing soekris systems that have been in service for years, and have not given any trouble. I want the new ones to be equally troubel free. Can i acomplish this with a stnadard install? second, I have no idea how to boot a Soekris box from install media. There is no floppy, no CD... how do I acomplish this? -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
As openbsd user on soekris systems base install works as you expect from The soekris does network boot, pxe install is simple to setup. After the pxe just load the bsd.rd file and the install env is running. Running memory filesystems could be for things like /var/run /var/log etc link /tmp to /var/tmp. But for the rest it is not really needed. I think. Regards Robert
As the manufacturers point out, 10,000 write cycles (basically the minimum) means you can overwrite the flash once per day for 27 years. Either netboot it, or buy a 600-in-1 usb adapter and install on a normal computer.
On Tue, 15 Dec 2009 15:15:25 -0500, Ted Unangst <ted.unangst@gmail.com> It's possible to kill CF cards doing builds or similar. The wear leveling isn't that great. I also find people don't necessarily realize the mysterious green boxes in wiring closets might have problems with surprise reboots. Or better yet a solar powered box up a radio tower out in the middle of nowhere. Using read-only filesystems avoids the need for an fsck to work first time every time in unattended reboots. I think it's useful, but then I've never asked for help for problems I couldn't reproduce on a stock system. :) -Anthony
I've been at this for a while, as you might guess. I've only ever seen two CF cards die. Around ten years ago, when they came to the market. I've used hundreds for various purposes. I've run a zaurus on a CF card (replace the drive to make it faster and run last longer). They never die. Same with SD and XD cards. I've taken nearly a hundred thousand photos and none of my cards are dead. The cards just plain don't die, and apparently the meme won't either.
i havent been using flash media as long as theo, but i will second this. i also figure it is cheaper for me to replace the media if it fails (which hasnt happened yet) than spend the time tweaking the install to not write to the media much. same applies to cutting the install down to fit on small disks. maybe other people have less value associated with their time than i do though :) dlg
hahahahahahahahaha try it. on something recent. come back in 10 years when you suceeded. -- Henning Brauer, hb@bsws.de, henning@openbsd.org BS Web Services, http://bsws.de Full-Service ISP - Secure Hosting, Mail and DNS Services Dedicated Servers, Rootservers, Application Hosting
I killed a microdrive on a zaurus by doing many many ports builds, i've never killed straight cf though. -0- -- Graduate life: It's not just a job. It's an indenture.
Here's a solution I was told from #openbsd on Freenode, on your local machine (assuming you run OpenBSD on a machine somewhere): 1) dd if=/dev/zero of=bsdrd-boot.img bs=1024 count=20480 2) vnconfig svnd0 bsdrd-boot.img 3) print 'z\na\n\n\n\n\nw\n' | disklabel -E svnd0 4) newfs svnd0a 5) mount /dev/svnd0a /mnt 6) cp /bsd.rd /boot /mnt 7) /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot svnd0 8) mkdir /mnt/etc && print 'stty com0 9600\nset tty com0\n' > /mnt/etc/boot.conf 9) umount /mnt 10) # insert CF card into a card reader 11) dd if=bsdrd-boot.img of=/dev/sdXc 12) # Remove CF card and insert into your Soekris box and boot it up 13) ... 14) Profit! Once you've done this you'll be able to continue the install over a serial console. Null modem cables are cheap. It would also be trivial to wire up an RJ-45 connector to a 9-pin serial port connector if you have a Cisco rollover cable handy. -- Aaron Mason - Programmer, open source addict I've taken my software vows - for beta or for worse
Being that I don't suggest that people use mysterious commands they
get off the Internet without fully understanding how they work,
here's an alternative way that I think will help
...on a standard PC.
11) Boot standard PC off install media (of whatever kind you want)
12) Install to the flash drive (probably sd0, but maybe not...), set
up serial console.
13) move install media to production machine
14) boot either:
14a) single user mode
15a) fix fstab to point to /dev/wd0 instead of /dev/sd0
16a) fix hostname.* to point to your target machine's NICs
or
14b) bsd.rd and do your install natively
15b) grumble about how long it takes to install on a slow machine
and a slow flash drive
16b) realize that fixing hostname* and fstab is really quite simple
(the "b" path is fewer steps listed, but takes longer, and is a
completely wasted second install)
17) enjoy.
You will note that my process is superior, because I have 17 steps
instead of the proposed 14 steps, and thus much geekier. Pay no
attention to the fact that I started counting at 10...
(yes, this process is probably a bit slower than that proposed, but
it is very easy to understand what is going on for new users, I
think).
faq14.html has a lot of info about flash drives, both as data and
boot media.
Nick.
On Tue, Dec 15, 2009 at 3:47 PM, Nick Holland I did exactly this on a ALIX.2D3 board from PCEngines a few months ago. Took me all of 40 minutes to bring the new SBC from out of the shipping box to a boot prompt. I would have been done a lot sooner if I hadn't fastened the motherboard into the case before installing the CF Card, but hey, I'm a software guy. Hardware confuses me. Since I have previous experience with windows, I didn't find the new machine slow at all. Gerald.
On Wed, Dec 16, 2009 at 10:47 AM, Nick Holland I suppose a few comments wouldn't have gone astray... my method works, although its description is terse. I did leave out a critical step that would stop it in its tracks - I didn't tell it to boot the ramdisk. Let's try this again: 1) Create a file 20mb in size (20,480 blocks of 1024 bytes each) - this will be our disk image. # dd if=/dev/zero of=bsdrd-boot.img bs=1024 count=20480 2) Set the file up as disk device svnd0 so that we can create a disklabel and mount it. # vnconfig svnd0 bsdrd-boot.img 3) Create a disk label with a single partition that encompasses the entire file: # print 'z\na\n\n\n\n\nw\n' | disklabel -E svnd0 4) Create a filesystem on the image's single partition # newfs svnd0a 5) Mount the image's partition to /mnt # mount /dev/svnd0a /mnt 6) Copy the ramdisk kernel and boot binary to /mnt # cp /bsd.rd /boot /mnt 7) Install the bootloader to the image # /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot svnd0 8) Create a boot.conf file with defaults that tell it to use the console and boot the ramdisk kernel # mkdir /mnt/etc # print 'stty com0 9600\nset tty com0\nboot hd0a:bsd.rd' > /mnt/etc/boot.conf 9) Unmount the volume # umount /mnt 10) Insert CF card into a card reader 11) Copy the image to the CF card # dd if=bsdrd-boot.img of=/dev/sdXc 12) Remove CF card and insert into your Soekris box 13) Connect a null modem cable into the Soekris box and your PC and fire up your favourite terminal program 14) Turn the soekris box on 15) Do a net install via your terminal program 16) ... 17) Profit! Mine is now as geeky as yours - and I started from 1. ^_^ I think a fresh install is better at first, since once the system is up and running you could take an image from the CF card and change the config files for another box. -- Aaron Mason - Programmer, open source addict I've taken my software vows - for beta or for worse
Nick Holland wrote: I sat down to add something to the FAQ about installing to Soekris and similar devices...then realized it was just a special case of the generic "I have no floppy or CD, how do I install?" question...and was about to add that when I realized... HEY! IT IS THERE ALREADY! http://www.openbsd.org/faq/faq4.html#noflopcd (I did just slightly enhance it for USB and ahci(4) attached storage devices and their issues) dang. hate it when I miss a really good "READ THE FAQ" opportunity. :) Nick.
Ufff, did you read link which I send before? http://www.kernel-panic.it/openbsd/embedded/ Because there is everything described including mounting fs ro, install and so on.
It's giving bad advices. You can setup a soekris using a perfectly normal install using pxeboot and a serial cable. If still you want to tweak things, you can do this after the install. There's absolutely no need for a soekris "howto". Ciao, Kili
No kidding. I'll quote just one line from the document to
prove the point that the author is missing the point.
Pri Mas SanDisk SDCFB-64 LBA 490-8-32 62 Mbyte
The third world has larger CF cards (apparently because all the old
ones died because their sectors were rewritten too much, so the meme
goes.)
Or to put it simpler: get a life.
I've been playing around with this lately, so I'm happy to have a stab at an answer, with the caveat that this reflects a recollection of my reading of the code rather than any attempt to make it work to your requirements. Whatever I may fail to clarify, recall, or understand is best taken to suggest that you'd be best served by reading the docs in full, consulting the code as necessary. To start with the details, I reckon that reading mkdist shows that it does a du on vnddirs in the filesystem tree from which you're building and add then pads out those sizes (i.e. look for the loop in mkdist following the comment "Determine sizes for partitions"). Reading code isn't, however, strictly necessary to answer your question: see the section of the FAQ that starts with "What is the basic flahrd layout? What are tardirs? mfsdirs? vnddirs?". More fundamentally, though: what are you trying to accomplish in growing /usr after laying down the flash image? It's likely more straightforward to lay down changes to the build (if not the personality, depending on whether your goal is to limit yourself to maintaining a single system or define a baseline build for use on multiple systems--if you're managing multiple systems, you might want to tweak the way you are preparing your builds and/or to modify the flashrd code so that it can pick up personality-related files from a separate tree than the build) on the regular filesystem tree from which you build the post-bootstrap flash svnd (i.e. the top-level directory you're passing as the mandatory parameter to flashrd), rather than trying to stack stuff onto the flash after this initial assembly is done. By the time you've got the basic image laid down in a file for your svnd, the initial partition scheme is already set. That doesn't mean that it's immutable, but it's a bit more work to do the slice and dice at that point. (cfgflashrd, on the other hand, is largely about configuring the ...
