fix grammar errors
[bootcd.git] / build.sh
index 4a7890c..398c335 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -112,6 +112,12 @@ function build_cdroot()
     mv $CD_ROOT/var/lib/rpm $CD_ROOT/usr/relocated/var/lib/
     (cd $CD_ROOT/var/lib && ln -s ../../usr/relocated/var/lib/rpm rpm)
 
+    # get /var/cache/yum out, its 100Mb. create in its place a 
+    # symbolic link to /usr/relocated/var/cache/yum
+    mkdir -p $CD_ROOT/usr/relocated/var/cache/
+    mv $CD_ROOT/var/cache/yum $CD_ROOT/usr/relocated/var/cache/
+    (cd $CD_ROOT/var/cache && ln -s ../../usr/relocated/var/cache/yum yum)
+
     # get /lib/tls out
     mkdir -p $CD_ROOT/usr/relocated/lib
     mv $CD_ROOT/lib/tls $CD_ROOT/usr/relocated/lib/
@@ -264,15 +270,22 @@ function build()
 
     # build usb image and make it bootable with syslinux (instead of isolinux)
     USB_IMAGE=${ISO%*.iso}.usb
-    USB_KB=$(du -kc $ISO $CD_ROOT/usr/isolinux | awk '$2 == "total" { print $1 }')
+    # leave 1 MB of free space on the filesystem
+    USB_KB=$(du -kc $ISO $CD_ROOT/usr/isolinux | awk '$2 == "total" { print $1 + 1024 }')
     mkfs.vfat -C $USB_IMAGE $USB_KB
+
     mkdir -p $INITRD_MOUNT
     mount -o loop,rw $USB_IMAGE $INITRD_MOUNT
+
+    # populate the root of the image with the iso, pl_version, and the syslinux files
     cp -a $ISO $INITRD_MOUNT
     cp -a $CD_ROOT/usr/isolinux/{initrd.gz,kernel,message.txt,pl_version} $INITRD_MOUNT
     cp -a $CD_ROOT/usr/isolinux/isolinux.cfg $INITRD_MOUNT/syslinux.cfg
+
     umount $INITRD_MOUNT
     rmdir $INITRD_MOUNT
+
+    # make it bootable
     syslinux $USB_IMAGE
 }