Permalink
Browse files

changed buildHook-HybridImage script layout and style

  • Loading branch information...
1 parent deb23ed commit 9dcca9a5a268d2c3ca45bbf9bf73164e69e19160 @pietheinstrengholt pietheinstrengholt committed Nov 16, 2011
Showing with 65 additions and 16 deletions.
  1. +65 −16 SDK/buildHook-HybridImage.sh
@@ -18,26 +18,75 @@
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
-rm -rf $WORKPATH/buildDEBs/build-installer.sh
-rm -rf $WORKPATH/buildDEBs/build-live-boot.sh
-rm -rf $WORKPATH/buildDEBs/build-live-config.sh
+INITRAMFS=casper
+BOOT_LOADER=grub2
+BINARY_IMAGES=iso
-rm -rf $WORKPATH/copyFiles-installer.sh
-rm -rf $WORKPATH/copyFiles-liveBoot.sh
+if [ "$INITRAMFS" = "casper" ] ; then
-# Set the output to be an USBHDD disk image
-sed -i "s/BINARY_IMAGES=iso/BINARY_IMAGES=iso-hybrid/g" $WORKPATH/buildLive/auto/config
+ echo "Using casper initramfs system"
-# We have to use syslinux in this case
-sed -i "s/BOOT_LOADER=grub2/BOOT_LOADER=syslinux/g" $WORKPATH/buildLive/auto/config
+ rm -rf $WORKPATH/buildDEBs/build-installer.sh
+ rm -rf $WORKPATH/buildDEBs/build-live-boot.sh
+ rm -rf $WORKPATH/buildDEBs/build-live-config.sh
+ rm -rf $WORKPATH/copyFiles-installer.sh
+ rm -rf $WORKPATH/copyFiles-liveBoot.sh
-# We need casper in this case
-sed -i "s/INITRAMFS=live-boot/INITRAMFS=casper/g" $WORKPATH/buildLive/auto/config
+ # We need casper in this case
+ sed -i "s/INITRAMFS=live-boot/INITRAMFS=casper/g" $WORKPATH/buildLive/auto/config
-# No installer
-sed -i "s/INSTALLER=true/INSTALLER=false/g" $WORKPATH/buildLive/auto/config
+ # No installer
+ sed -i "s/INSTALLER=true/INSTALLER=false/g" $WORKPATH/buildLive/auto/config
-# No grub
-sed -i "s/grub-pc/#grub-pc/g" $WORKPATH/buildLive/Files/config/package-lists/packages.list.chroot
-rm -rf $WORKPATH/buildLive/Files/config/binary_grub/
+ # Modify grub.cfg if needed
+ sed -i "s/\/live\//\/casper\//g" $WORKPATH/buildLive/Files/config/binary_grub/grub.cfg
+ sed -i "s/boot=live/boot=casper/g" $WORKPATH/buildLive/Files/config/binary_grub/grub.cfg
+fi
+
+if [ "$BINARY_IMAGES" = "iso-hybrid" ] ; then
+
+ # Set the output to be an Hybrid iso disk image
+ sed -i "s/BINARY_IMAGES=iso/BINARY_IMAGES=iso-hybrid/g" $WORKPATH/buildLive/auto/config
+
+ if [ "$BOOT_LOADER" = "syslinux" ] ; then
+
+ # We have to use syslinux in this case
+ sed -i "s/BOOT_LOADER=grub2/BOOT_LOADER=syslinux/g" $WORKPATH/buildLive/auto/config
+
+ # No grub
+ sed -i "s/grub-pc/#grub-pc/g" $WORKPATH/buildLive/Files/config/package-lists/packages.list.chroot
+ rm -rf $WORKPATH/buildLive/Files/config/binary_grub/
+ fi
+fi
+
+if [ "$BINARY_IMAGES" = "hdd" ] ; then
+
+ if [ "$BOOT_LOADER" ~ "grub" ] ; then
+ echo "This combination won't work"
+ exit 0
+ fi
+
+ # Set the output to be an USBHDD disk image
+ sed -i "s/BINARY_IMAGES=iso/BINARY_IMAGES=hdd/g" $WORKPATH/buildLive/auto/config
+
+ if [ "$BOOT_LOADER" = "syslinux" ] ; then
+
+ # We have to use syslinux in this case
+ sed -i "s/BOOT_LOADER=grub2/BOOT_LOADER=syslinux/g" $WORKPATH/buildLive/auto/config
+
+ # No grub
+ sed -i "s/grub-pc/#grub-pc/g" $WORKPATH/buildLive/Files/config/package-lists/packages.list.chroot
+ rm -rf $WORKPATH/buildLive/Files/config/binary_grub/
+
+ #workaround for Bug#622838 syslinux-live and hdd images
+ THISDIR=$(pwd)
+ mkdir -p $WORKPATH/buildLive/Files/config/includes.chroot/usr/share/syslinux/themes/ubuntu-oneiric/isolinux-live
+ cd $WORKPATH/buildLive/Files/config/includes.chroot/usr/share/syslinux/themes/ubuntu-oneiric/
+ ln -s isolinux-live syslinux-live
+ cd isolinux-live
+ ln -s isolinux.cfg syslinux.cfg
+ cd $THISDIR
+
+ fi
+fi

0 comments on commit 9dcca9a

Please sign in to comment.