Xen Image now use pygrub to load ramdisk and kernel inside of the image
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 17 Sep 2009 12:59:18 +0000 (14:59 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 17 Sep 2009 12:59:18 +0000 (14:59 +0200)
Removed kernel/initrd outside of the xen-image
Fix savedefault handling

config/xen-image/ipfire.cfg
lfs/xen-image
src/paks/linux-xen/install.sh

index 185473763513d996276966cc970cc6cf28748cb0..4faa2f8c678f49ff3c77fcef5f9d86d22d03975a 100644 (file)
@@ -1,5 +1,7 @@
-kernel = "/mnt/test/boot/vmlinuz-KVER-ipfire-xen"    #### change path
-ramdisk ="/mnt/test/boot/ipfirerd-KVER-xen.img"      #### change path
+#kernel = "/mnt/test/boot/vmlinuz-KVER-ipfire-xen"    #### change path
+#ramdisk ="/mnt/test/boot/ipfirerd-KVER-xen.img"      #### change path
+
+bootloader = '/usr/bin/pygrub'
 
 memory = 128
 name = "ipfire-xen"
@@ -21,5 +23,5 @@ disk = [
                'file:/mnt/test/swap.img,xvdb1,w'
        ] #### Change path
 
-root = "/dev/xvda1"
-extra =  'xencons=tty console=hvc0 clocksource=jiffies ro'
+#root = "/dev/xvda1"
+#extra =  'xencons=tty console=hvc0 clocksource=jiffies ro'
index bb744927245e54f093e17fc9a031e66b10007f7d..5f171c448586de382f01d533e8e3fd65edff7b32 100644 (file)
@@ -54,7 +54,7 @@ SIZEswap := 512
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -rf $(MNThdd) $(IMGinst) $(IMGroot) && mkdir -p $(MNThdd)
-       mkdir -p /install/images/$(SNAME)/boot
+       mkdir -p /install/images/$(SNAME)   # /boot
 
        #Create swapimage
        dd bs=1M if=/dev/zero of=$(IMGswap) count=$(SIZEswap)
@@ -86,6 +86,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        echo "  kernel /vmlinuz-$(KVER)-ipfire-xen root=/dev/xvda1 rootdelay=10 panic=10 console=xvc0 ro" \
                                                  >> $(MNThdd)/boot/grub/grub.conf
        echo "  initrd /ipfirerd-$(KVER)-xen.img" >> $(MNThdd)/boot/grub/grub.conf
+       echo "# savedefault 0" >> $(MNThdd)/boot/grub/grub.conf
+
        ln -s grub.conf $(MNThdd)/boot/grub/menu.lst
 
        #Copy the meta-info of linux-xen package
@@ -150,10 +152,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
                $(MNThdd)/opt/pakfire/etc/pakfire.conf
 
        #Copy initramdisk, kernel and config
-       cp -f $(MNThdd)/boot/ipfirerd-$(KVER)-xen.img \
-               /install/images/$(SNAME)/boot
-       cp -f $(MNThdd)/boot/vmlinuz-$(KVER)-ipfire-xen \
-               /install/images/$(SNAME)/boot
+       #cp -f $(MNThdd)/boot/ipfirerd-$(KVER)-xen.img \
+       #       /install/images/$(SNAME)/boot
+       #cp -f $(MNThdd)/boot/vmlinuz-$(KVER)-ipfire-xen \
+       #       /install/images/$(SNAME)/boot
        cp $(DIR_SRC)/config/xen-image/* \
                /install/images/$(SNAME)
        sed -i -e "s|KVER|$(KVER)|g" /install/images/$(SNAME)/ipfire.cfg
index b2c8f383e5a6f934b5ad2545e396dc3f468df331..f87966f1d8bf1eb1e889455c34e4b313ea876302 100644 (file)
@@ -45,18 +45,19 @@ echo "" >> /boot/grub/grub.conf
 echo "title IPFire (XEN-Kernel)" >> /boot/grub/grub.conf
 echo "  kernel /vmlinuz-$KVER-ipfire-xen root=$ROOT rootdelay=10 panic=10 console=xvc0 $MOUNT" >> /boot/grub/grub.conf
 echo "  initrd /ipfirerd-$KVER-xen.img" >> /boot/grub/grub.conf
+echo "# savedefault $ENTRY" >> /boot/grub/grub.conf
 #
 # Test if we running already on xen
 #
-uname -r ¦ grep "ipfire-xen";
+uname -r | grep "ipfire-xen";
 if [ ${?} = 0 ]; then
        #Xen Kernel is active
        #Set grub default entry to this kernel
-       sed -i -e "s¦^default saved¦default $ENTRY¦g" /boot/grub/grub.conf
+       sed -i -e "s|^default saved|default $ENTRY|g" /boot/grub/grub.conf
 else
        #Normal Kernel
        #pygrub crash with "default saved"
-       sed -i -e "s¦^default saved¦#default saved¦g" /boot/grub/grub.conf
+       sed -i -e "s|^default saved|#default saved|g" /boot/grub/grub.conf
 fi
 #
 # Made initramdisk