#!/bin/bash # Build bare root image from scratch (from within debian chroot) if [ $0 = "scratch" ] then echo "Building base ISO from scratch." isomaker -b /usr/share/mmaker/templates/basemod-2.6.7.xml -r http://www.morphix.org/debian/udeb -p grub-gfxboot-iso-udeb -p morphix-grub-menulist-udeb -p morphix-iso-grubtheme ben.iso # When adding a new kernel # replace the kernel, add minifo, fix miniroot, done :) # Build your custom kernel, including bzImage, modules and # modules_install # Download cloop # get cloop_2.01-4.tar.gz # http://www.morphix.org/debian/source/cloop_2.01-4.tar.gz # Download mini-fo from here: # http://gelux.programmers.ch/OverlayVFS # mini_fo.ko goes in the newiso/base/morphix file, with the rest of the modules. exit fi if [ $1 = "chroot1" ] then echo "Doing CHROOT portion 1" cd # Clean things up umount newiso rm -fr newiso rm -fr download umount miniroot rm -fr miniroot umount iso rm -fr iso umount baseiso rm -fr baseiso umount basemodule rm -fr basemodule rm lanforge.iso mkdir -p iso mount -o loop ben.iso iso cp -ar iso newiso mkdir download cp newiso/base/morphix download/ extract_compressed_fs download/morphix > download/morphix.iso cp iso/boot/miniroot.gz download gunzip download/miniroot.gz mkdir -p miniroot mount -o loop download/miniroot miniroot extract_compressed_fs download/morphix > download/morphix.iso mkdir -p baseiso mount -o loop download/morphix.iso baseiso cp -a baseiso basemodule cd basemodule/boot/ cp /home/greear/kernel/2.6/linux-2.6.7.morphix/arch/i386/boot/bzImage vmlinuz-2.6.7 cp /home/greear/kernel/2.6/linux-2.6.7.morphix/.config config-2.6.7 cp /home/greear/kernel/2.6/linux-2.6.7.morphix/System.map System.map-2.6.7 cd ~/basemodule/lib/modules # The lib_modules are from the kernel install, ie make modules_install. Tar # them up after building the kernel and place as specified below. tar -xvzf /home/greear/kernel/2.6/linux-2.6.7.morphix/lib_modules.tgz cd 2.6.7/misc cp /home/greear/kernel/2.6/cloop/cloop.ko ./cloop.ko cp /home/greear/kernel/2.6/mini_fo/mini_fo.ko . exit fi ## Outside the chroot, as user root if [ $1 = "outside" ] then echo "Doing depmod (outside of the chroot)" cd /home/greear/debian/sid/root/ depmod -b basemodule 2.6.7 fi if [ $1 = "chroot2" ] then echo "Doing CHROOT portion 2" # Back as root inside the chroot cd ~/miniroot/modules cp /home/greear/kernel/2.6/cloop/cloop.ko ./cloop.ko cp /home/greear/kernel/2.6/linux-2.6.7.morphix/drivers/ide/ide-cd.ko . cp /home/greear/kernel/2.6/linux-2.6.7.morphix/drivers/scsi/aic7xxx/aic7xxx.ko scsi/ for i in 3w-xxxx.ko advansys.ko atp870u.ko gdth.ko \ qlogicfas.ko u14-34f.ko \ BusLogic.ko aha152x.ko dtc.ko megaraid.ko \ qlogicfc.ko ultrastor.ko \ NCR53c406a.ko aha1542.ko eata.ko pas16.ko \ t128.ko wd7000.ko \ a100u2w.ko fdomain.ko psi240i.ko tmscsim.ko; do cp /home/greear/kernel/2.6/linux-2.6.7.morphix/drivers/scsi/$i scsi/$i done # Put it back together cd umount miniroot gzip download/miniroot cp download/miniroot.gz newiso/boot/ mkisofs -R -U -V "LANforge Live" --publisher "Candela Technologies" -cache-inodes -no-bak -pad basemodule > download/newmorphix.iso create_compressed_fs download/newmorphix.iso 65536 > download/morphix.new cp download/morphix.new newiso/base/morphix /usr/bin/make-iso newiso/ lanforge.iso umount baseiso umount ben.iso fi