> I want to thank all of you who replied on my previous mail about the live > cd. I've seen many of those links you sent me which talk on how you can > create a live cd. I would have done it my self but unfortunatelly I cant due > to tech reasons right now. Also I dont know if it would have been good since > i am an openbsd noob ! As i said I study at the American College of Greece > and the head of dept agreed to use obsd for the teaching of unix instead of > the crapy linux and asked me to get it to him. So if someone can create this > live cd and upload it on the web just to download it and dist to all college > I would really apriciate it. I know that time is precious for everybody so > if noone can do it I will understand. But if you can you will help openbsd > grow not only in many ppl but in the educational system of c.i.s as well. > Thank you all very much again ! > > Best Regards > Alex
Okay here is my own REAL EASY Step-by-Step howto for an OpenBSD live CD Sorry for the possible bad english, my english is not the best at 2am, but I wanted to help you quick. The original (much better) How-To is in German, thus if you can speak German I could mail you the much better version. (If anybody is interested in a Live CD I could also translate it 1 : 1 ) Since I really love to show off my OpenBSD Live CD to friends. <anti_flame_request> IMHO Knoppix sucks compared to an OpenBSD live cd </anti_flame_request> (If you can't understand something just ASK and I will answer ASAP because I'm just to darn tired to even READ through it again) Here we go: The easy way (don't even ask for the complicated way): NOTE YOU NEED TO ADJUST THE SIZE OF THE MFS PARTITIONS TO YOUR NEEDS! You need a current system with the right (current) source code for it. Best thing is to make a release man 8 release Grab a virgin harddrive and put it into a spare i386 box, install openbsd onto this harddrive. DON'T make Partitions (actually you could BUT IMHO it makes everything much more complicated ) Configure it ( with X, packages, configs ) the way it should boot from the CD later on. Although you COULD use a DVD as medium, I would RECOMMEND you not to get over the size of a normal CD for the complete install. Once you have the System exactly the way you want it to be read on: Rip the harddrive out of the test box and put it into another box ( with cd/dvd burner ). Mount the drive somewhere and tar it up cd /mnt/ && tar pczf ~/livecd_root.tar.gz * Create a directory, this will be the root directory on the CD. # Of course you need a large enough /usr/ Partition "mkdir -p /usr/livecd/backups/dev" Untar the Stuff into the above livecd directory. cd /usr/livecd && tar pxzf ~/livecd_root.tar.gz We need some "backup" directories that will be used later cp -pR /usr/livecd/{var,etc,root,home} /usr/livecd/backups/ cp -pR /usr/livecd/dev/MAKEDEV /usr/livecd/backups/dev/ We need MFS partitions in order to be able to make config changes ... the content of the backup directories will be copied into them. For this purpose we use a modified "etc/rc" script --------------------------- /usr/livecd/etc/rc --------------------------------- # ... # After: rm -f /fastboot # XXX (root now writeable) echo 'mounting mfs' mount_mfs -s 51200 -o async,nosuid,nodev,noatime swap /var mount_mfs -i 4096 -s 6144 -o async,nosuid,nodev,noatime swap /etc mount_mfs -i 128 -s 2048 -o async,noatime swap /dev mount_mfs -s 6144 -o async,nosuid,nodev,noatime swap /tmp mount_mfs -s 8192 -o async,nosuid,nodev,noatime swap /home mount_mfs -s 8192 -o async,nosuid,nodev,noatime swap /root sleep 2 echo -n 'copying files: var ' cp -pR /backups/var/* /var echo -n 'etc ' cp -pR /backups/etc/* /etc echo -n 'dev ' cp -pR /backups/dev/* /dev echo -n 'home ' cp -pR /backups/home/* /home echo 'root' cp -pR /backups/root/.[a-z]* /root echo 'creating device nodes' cd /dev && sh MAKEDEV all # ... # After: if [ -f /sbin/kbd -a -f /etc/kbdtype ]; then # We need a root Password echo 'Need to set a root password' passwd -------------------------------------------------------------------------------- We need some basic devices (just create all) on the temporary boot /dev cd /usr/livecd/dev && ./MAKEDEV all Now we create the custom kernel (not much customization!) "cd /usr/src/sys/arch/i386/conf" "mv RAMDISK_CD RAMDISK_CD.old && cp GENERIC RAMDISK_CD" ------------------- /usr/src/sys/$arch/conf/RAMDISK_CD ------------------------- ... # config bsd swap generic < - was commented OUT! option RAMDISK_HOOKS option MINIROOTSIZE=3800 config bsd root on cd0a ... -------------------------------------------------------------------------------- Compile the new RAMDISK kernel config RAMDISK_CD && cd ../compile/RAMDISK_CD/ && make clean && make depend \ && make Copy the new ramdisk kernel to the livecd folder: cp bsd /usr/livecd We need to patch the Makefile.inc NOTE: YOU JUST NEED TO FIND THE APPROPRIATE TWO LINES BECAUSE THEY CHANGE KIND OF FREQUENTLY! THIS PATCH IS NOT AN EXACT DIFF PATCH ! FIND THE RIGHT LINES! -------------------------- patch-Makefile.in ----------------------------------- --- src/distrib/i386/common/Makefile.inc.orig Thu Mar 3 09:16:02 2005 +++ src/distrib/i386/common/Makefile.inc Thu Mar 3 09:16:32 2005 @@ -33,8 +33,7 @@ newfs -m 0 -o space -i 524288 -c 80 ${VND_RDEV} mount ${VND_DEV} ${MOUNT_POINT} cp ${BOOT} ${.OBJDIR}/boot -strip ${.OBJDIR}/boot -strip -R .comment ${.OBJDIR}/boot +strip -s -R .comment -K cngetc ${.OBJDIR}/boot dd if=${.OBJDIR}/boot of=${MOUNT_POINT}/boot bs=512 dd if=bsd.gz of=${MOUNT_POINT}/bsd bs=512 /usr/mdec/installboot -v ${MOUNT_POINT}/boot \ @@ -54,8 +53,7 @@ bsd.gz: bsd.rd cp bsd.rd bsd.strip -strip bsd.strip -strip -R .comment bsd.strip +strip -s -R .comment -K cngetc bsd.strip gzip -c9 bsd.strip > bsd.gz bsd.rd:${IMAGE} bsd rdsetroot -------------------------------------------------------------------------------- We need to install crunch: cd /usr/src/distrib/crunch && make obj depend all install Create the boot image and insert new kernel cd /usr/src/distrib/i386/ramdisk_cd && rm -rf obj/* && make Copy the Boot Image to the livecd folder cp /usr/src/distrib/i386/ramdisk_cd/obj/cdromXX.fs /usr/livecd/ Change the fstab files so that you can boot correctly: ----------------------- /usr/livecd/etc/fstab ---------------------------------- /dev/cd0a / cd9660 ro,noatime 0 0 /dev/cd0a / cd9660 ro,noatime 0 0 swap /dev mfs rw,noatime,-s=12000 0 0 swap /tmp mfs rw,noatime,-s=262144 0 0 swap /var mfs rw,noatime,-s=262144 0 0 swap /root mfs rw,noatime,-s=262144 0 0 swap /home mfs rw,noatime,-s=262144 0 0 swap /etc mfs rw,noatime,-s=131072 0 0 -------------------------------------------------------------------------------- Now just create an ISO Image to burn "cd /usr/livecd" "mkisofs -b cdromXX.fs -c boot.catalog -R -v -o /tmp/livecd.iso /usr/livecd" and burn it with your favorite app (I love cdrecord) Kind regards ahb (hope you will have fun with a NICE live CD) p.s. THANKS to all developers and everybody involved with OBSD! Great system for all situations (besides playing games ;) )!