|
Magoo's Wise Words | ||
| Posted: 24 Mar 07
P | The steps to booting from a flash drive 1. You need a working OpenBSD machine with a few GB of available disk space to compile and build ISO images on. See the OpenBSD Installation Guide if you are unfamiliar with installing OpenBSD. The OpenBSD documentation is excellent, so you should have no trouble. My contact information is later if you need assistance. 2. Make a directory to keep the cd's contents, such as /bootcd. If you can make this a separate partition so you can boot it for testing, that's all the better. 3. Download base40.tgz and etc40.tgz and untar them in this directory. You can find them on the OpenBSD mirrors. 4. Make sure the OpenBSD 4.0 sources are installed in /usr/scr/sys. If they aren't, download them and untar them there. They can also be found in the mirrors. 5. cd into /usr/src/sys/arch/i386/conf and copy the kernel config file called "GENERIC" to "CDBOOT" or some similar name. 6. Edit the CDBOOT file. You can use vi, but I prefer OpenBSD's mg, which is like a slimmed down emacs. Add the options RAMDISK_HOOKS and MINIROOTSIZE=3560 at the end of the options listed near the top of the file. This is to support ramdisks. Comment out the line "config bsd swap generic," as there will be no disk to swap to. Add the line "config bsd root on sd0a" to point to the flash drive for the root directory. This is assuming your USB drive shows up as /dev/sd0. When you are logged into a terminal, it should say what the device is if you are watching when you plug it in. 7. Save the file and exit mg (ctrl+x, ctrl+c.) Run the command "config CDBOOT" 8. cd into ../compile/CDBOOT and run "make clean && make depend && make" (takes a while) 9. Copy the file CDBOOT into /bootcd You now have your custom kernel. Now, we need to make a bootable image from these files. 10. Edit the file /usr/src/distrib/i386/common/Makefile.inc, replacing the lines strip ${.OBJDIR}/bootwith the line strip --strip-all -R .comment -K cngetc bsd.strip11. cd into /usr/src/distrib/i386/ 12. Create the directory CDBOOT as a copy of ramdisk_cd 13. Edit the makefile in CDBOOT, changing the line RAMDISK=RAMDISK_CD to RAMDISK=CDBOOT 14. Install crunch and crunchgen 15. cd /usr/src/distrib and "make" (this will take a few minutes) 16. cd /usr/src/distrib/i386/CDBOOT and "make" (You probably have time for a nap while this completes.) 17. Copy the file cdrom40.fs to /bootcd/boot.img /bootcd is now bootable. We just have to get it onto a CD and boot something from it.
18. Make an ISO from this directory. 19. Burn the ISO onto a CD. Make sure to burn it as a bootable image. The computer I was building on didn't have a burner, so I just moved the file to my desktop and burned it with Gnomebaker. 20. Install OpenBSD 4.0 onto the flash drive. If you boot the installation CD, it should be one of the choices of drives to install on. Make sure you partition carefully since you have limited space. See the OpenBSD FAQ for the minimum recommended partition size. If you go much smaller than that, it will cause problems later on. You don't need any swap space since we disabled that in the kernel. Also, I would give /var and /tmp extra space so that wear leveling has some extra room to work with. 21. Boot the computer from the CD you made. It should come up to a working system running on the flash drive. If you have issues, I frequent the Radified Forums and would be happy to help . Questions, suggestions, or comments? Next =>[Magoo's OpenBSD on USB Flash - Page 1, OpenBSD USB Flash] | Updated:
P |