[et-mgmt-tools] Getting koan/LiveCD running on F8

Dave Hatton lists at davehatton.it
Tue Dec 11 00:52:11 UTC 2007


I had to make some small changes to get koan/LiveCD building under 
Fediora 8 and then creating a Fedora 8 install under VMware.

for base.cfg the livecd tools don't seem the take the --packages flag 
anymore so I added the some extras to %package and also sfdisk seemed to 
want all 4 primary partions configured - although that might be down to 
me building in a VMware target machine
------------------------------------------ cut 
-------------------------------------------------
diff -U 10 base.cfg.orig base.cfg
--- base.cfg.orig       2007-11-22 11:22:49.000000000 +0000
+++ base.cfg    2007-12-06 16:14:59.000000000 +0000
@@ -1,46 +1,46 @@
 lang en_US.UTF-8
-keyboard us
-timezone US/Eastern
+keyboard uk
+timezone --utc Europe/London
 auth --useshadow --enablemd5
 selinux --disabled
 firewall --disabled
 rootpw --iscrypted \$1\$mF86/UHC\$WvcIcX2t6crBz2onWxyac.
 services --disable sshd
 
 # TODO: how to replace i386 with $basearch
 
 # TODO: apparently calling it fedora-dev instead of a-dev makes things
 # not work. Perhaps it has something to do with the default repos in
 # /etc/yum.repos.d not getting properly disabled?
 
-repo --name=todos 
--baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Everything/i386/os/
-repo --name=updatez 
--baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/7/i386/
+repo --name=todos 
--baseurl=http://repo.starground.co.uk/rpms-fedora/releases/8/Everything/i386/os/
+repo --name=updatez 
--baseurl=http://repo.starground.co.uk/rpms-fedora/updates/8/i386/
 repo --name=newkoan --baseurl=file:///tmp/newkoan/
 
 text
 bootloader --location=mbr
 install
 zerombr
 
 part / --fstype ext3 --size=1024 --grow --ondisk=/dev/sda --asprimary
 part swap --size=1027 --ondisk=/dev/sda --asprimary
 
 %packages
 @base
 #@core
 @hardware-support
 file
 syslinux
 kernel
 bash
-util-linux
+util-linux-ng
 koan
 avahi-tools
 #aspell-*
 -m17n-db-*
 -man-pages-*
 # gimp help is huge
 -gimp-help
 # lose the compat stuff
 -compat*
 # space sucks
@@ -58,20 +58,25 @@
 # duplicate functionality
 -tomboy
 -pinfo
 -wget
 # scanning takes quite a bit of space :/
 -xsane
 -xsane-gimp
 # while hplip requires pyqt, it has to go
 -hplip
 #-*debuginfo # error
+policycoreutils
+grub
+eject
+tree
+
 
 %post
 
 cat > /etc/rc.d/init.d/fedora-live << EOF
 #!/bin/bash
 #
 # live: Init script for live image
 #
 # chkconfig: 345 99 99
 
@@ -99,22 +104,24 @@
 chkconfig --level 345 atd off
 chkconfig --level 345 anacron off
 chkconfig --level 345 readahead_early off
 chkconfig --level 345 readahead_later off
 
 # Stopgap fix for RH #217966; should be fixed in HAL instead
 touch /media/.hal-mtab
 
 # take over a drive to use as temporary space
 sfdisk /dev/sda -uM << ESFDISK
-       ,1000
-       ;
+,1000
+;
+;
+;
 ESFDISK
 mkfs -t ext3 /dev/sda1
 
 # fix fstab/mtab
 
 cat >> /etc/fstab << EFSTAB
 /dev/sda1      /tmp/boot       ext3    defaults,noatime 0 0
 EFSTAB
 
 cat >> /etc/mtab << EMTAB
@@ -130,32 +137,32 @@
 mknod /dev/mapper/livecd-rw b 8 0
 grub-install --root-directory=/tmp/boot/ --no-floppy /dev/sda
 
 # need a grub.conf file to run grubby from within koan
 cat > /tmp/boot/boot/grub/grub.conf << EGRUB
 # grub.conf
 default=0
 timeout=5
 #splashimage=(hd0,0)/boot/grub/splash.xpm.gz
 hiddenmenu
-title spacer (2.6.21-1.3228.fc7)
+title spacer ()
        root (hd0,0)
        kernel /boot/vmlinuz
        initrd /boot/initrd.img
 EGRUB
 
 # now we're ready to do it for real
 INSERT_KOAN_ARGS --livecd
 
 # once through debugging
 # eject
-# reboot
+reboot
 
 EOF
 
 chmod 755 /etc/rc.d/init.d/fedora-live
 /sbin/restorecon /etc/rc.d/init.d/fedora-live
 /sbin/chkconfig --add fedora-live
 
 # save a little bit of space at least...
 rm -f /boot/initrd*
------------------------------------------ cut 
-------------------------------------------------



and for build.py I commented the --package stuff and corrected the 
_DISTRO_ stuff to F8
------------------------------------------ cut 
-------------------------------------------------
diff -U 10 build.py build1.py
--- build.py    2007-11-22 09:24:05.000000000 +0000
+++ build1.py   2007-12-04 08:25:40.000000000 +0000
@@ -25,23 +25,23 @@
 # tweak at your own risk
 
 basef = open("./base.cfg")
 base_config = basef.read()
 basef.close()
 
 # not expected to work with anything lower than FC-7
 # use i386 for compatibility, still works with x86_64
 # this is the LiveCD's OS, not the target install OS
 
-USE_DISTRO_SHORT = "FC-7"
-USE_DISTRO = "FC-7-i386"
-USE_REPO   = "fc7i386extras"
+USE_DISTRO_SHORT = "F8"
+USE_DISTRO = "F8-i386"
+USE_REPO   = "f8i386extras"
 
 # packages to put on the LiveCD
 
 packages = [
   "kernel", "bash", "koan", "policycoreutils", "grub", "eject", "tree"
 ]
 
 #=======
 
 def main(args):
@@ -87,22 +87,22 @@
    cfg.write(base_config.replace("INSERT_KOAN_ARGS", "/usr/bin/koan %s" 
% options.koan))
    cfg.close()
 
    # ======
 
    cmd = "livecd-creator"
    cmd = cmd + " --fslabel=koan-live-cd"
    cmd = cmd + " --config=/tmp/koanlive.cfg"
   
 
-   for x in packages:
-      cmd = cmd + " --package=%s" % x
+#  for x in packages:
+#     cmd = cmd + " --package=%s" % x
   
    print "running: %s" % cmd
 
    try:
        os.remove("koan-live-cd.iso")
    except:
        print "existing file not removed"
    subprocess.call(cmd, shell=True)
 
 if __name__ == "__main__":
------------------------------------------ cut 
-------------------------------------------------


Not much - but I hope this helps.

Dave Hatton




More information about the et-mgmt-tools mailing list