mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-16 14:03:00 +02:00
Xen Image now use pygrub to load ramdisk and kernel inside of the image
Removed kernel/initrd outside of the xen-image Fix savedefault handling
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user