Fix no getty on Xen Console
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 17 Sep 2009 15:21:26 +0000 (17:21 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 17 Sep 2009 15:21:26 +0000 (17:21 +0200)
Make Xen Image more similar to the normal install

config/xen-image/ipfire.cfg
lfs/xen-image

index 4faa2f8c678f49ff3c77fcef5f9d86d22d03975a..468a1035ed84ffbd8dccac9b9f74d6ed34736a05 100644 (file)
@@ -1,6 +1,3 @@
-#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
@@ -10,6 +7,7 @@ acpi=1
 apic=1
 
 ### network: do not change the mac adresses and never use your real mac adresse of your hardware here!! ###
+### the bridge must be present on you xen-system. Check the names!!! ###
 vif         = [
                   'mac=00:17:3E:BE:A1:1A, bridge=xenbrI',      ## Green
                   'mac=00:17:3E:BE:A1:1B, bridge=xenbrE',      ## Red
@@ -19,9 +17,8 @@ vif         = [
 
 
 disk = [
-               'file:/mnt/test/ipfire.img,xvda1,w', 
-               'file:/mnt/test/swap.img,xvdb1,w'
+               'file:/mnt/test/ipfire-boot.img,xvda1,w',
+               'file:/mnt/test/ipfire-swap.img,xvda2,w',
+               'file:/mnt/test/ipfire-root.img,xvda2,w',
+               'file:/mnt/test/ipfire-var.img,xvda2,w'
        ] #### Change path
-
-#root = "/dev/xvda1"
-#extra =  'xencons=tty console=hvc0 clocksource=jiffies ro'
index 5f171c448586de382f01d533e8e3fd65edff7b32..98cdb35ccd2fcc1ec61197d67006c1d596864f02 100644 (file)
@@ -47,15 +47,24 @@ md5 :
 IMGinst  := /install/images/$(SNAME)-$(VERSION).xen.$(MACHINE)-$(ED)-core$(CORE).tar.bz2
 MNThdd   := /install/harddisk
 
-IMGroot  := /install/images/$(SNAME)/$(SNAME).img
-IMGswap  := /install/images/$(SNAME)/swap.img
-SIZEroot := 1024
+IMGboot  := /install/images/$(SNAME)/$(SNAME)-boot.img
+IMGswap  := /install/images/$(SNAME)/$(SNAME)-swap.img
+IMGroot  := /install/images/$(SNAME)/$(SNAME)-root.img
+IMGvar   := /install/images/$(SNAME)/$(SNAME)-var.img
+
+SIZEboot := 30
 SIZEswap := 512
+SIZEroot := 512
+SIZEvar  := 1024
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -rf $(MNThdd) $(IMGinst) $(IMGroot) && mkdir -p $(MNThdd)
        mkdir -p /install/images/$(SNAME)   # /boot
 
+       #Create bootimage
+       dd bs=1M if=/dev/zero of=$(IMGboot) count=$(SIZEboot)
+       mkfs.ext3 -F $(IMGboot)
+
        #Create swapimage
        dd bs=1M if=/dev/zero of=$(IMGswap) count=$(SIZEswap)
        mkswap $(IMGswap)
@@ -64,11 +73,17 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        dd bs=1M if=/dev/zero of=$(IMGroot) count=$(SIZEroot)
        mkfs.ext3 -F $(IMGroot)
 
+       #Create varimage
+       dd bs=1M if=/dev/zero of=$(IMGvar) count=$(SIZEvar)
+       mkfs.ext3 -F $(IMGvar)
+
        # Mount Images
        mount -o loop $(IMGroot) $(MNThdd)
        mkdir $(MNThdd)/boot
        mkdir $(MNThdd)/var
        mkdir $(MNThdd)/var/log
+       mount -o loop $(IMGboot) $(MNThdd)/boot
+       mount -o loop $(IMGvar) $(MNThdd)/var
 
        # Install IPFire without kernel modules
        tar -C $(MNThdd)/ -xvjf /install/cdrom/$(SNAME)-$(VERSION).tbz2 \
@@ -81,9 +96,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
        #Create grub menuentry for pygrub
        mkdir $(MNThdd)/boot/grub
-       echo "default 1"                           > $(MNThdd)/boot/grub/grub.conf
+       echo "timeout 10"                          > $(MNThdd)/boot/grub/grub.conf
+       echo "default 0"                          >> $(MNThdd)/boot/grub/grub.conf
        echo "title IPFire (XEN-Kernel)"          >> $(MNThdd)/boot/grub/grub.conf
-       echo "  kernel /vmlinuz-$(KVER)-ipfire-xen root=/dev/xvda1 rootdelay=10 panic=10 console=xvc0 ro" \
+       echo "  kernel /vmlinuz-$(KVER)-ipfire-xen root=/dev/xvda3 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
@@ -105,10 +121,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        mount --bind /dev  $(MNThdd)/dev
        mount --bind /sys  $(MNThdd)/sys
        chroot $(MNThdd) /usr/bin/perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
-       sed -i -e "s|DEVICE1|#boot-disabled|g" $(MNThdd)/etc/fstab
-       sed -i -e "s|DEVICE2|/dev/xvdb1|g" $(MNThdd)/etc/fstab
-       sed -i -e "s|DEVICE3|/dev/xvda1|g" $(MNThdd)/etc/fstab
-       sed -i -e "s|DEVICE4|#var-disabled|g" $(MNThdd)/etc/fstab
+       sed -i -e "s|DEVICE1|/dev/xvda1|g" $(MNThdd)/etc/fstab
+       sed -i -e "s|DEVICE2|/dev/xvda2|g" $(MNThdd)/etc/fstab
+       sed -i -e "s|DEVICE3|/dev/xvda3|g" $(MNThdd)/etc/fstab
+       sed -i -e "s|DEVICE4|/dev/xvda4|g" $(MNThdd)/etc/fstab
 
        sed -i -e "s|FSTYPE|ext3|g" $(MNThdd)/etc/fstab
        cp -f $(MNThdd)/etc/mkinitcpio.conf $(MNThdd)/etc/mkinitcpio.conf.org
@@ -134,6 +150,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        #Add xvc0 to securetty
        echo xvc0 >> $(MNThdd)/etc/securetty
 
+       #Add getty for xvc0
+       echo "#Enable login for XEN" >> $(MNThdd)/etc/securetty
+       echo "8:2345:respawn:/sbin/agetty xvc0 9600" >> $(MNThdd)/etc/securetty
+
        #Disable some initskripts
        echo "#!/bin/sh" > $(MNThdd)/etc/rc.d/init.d/setclock
        echo "#!/bin/sh" > $(MNThdd)/etc/rc.d/init.d/keymap
@@ -164,6 +184,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        umount $(MNThdd)/proc
        umount $(MNThdd)/dev
        umount $(MNThdd)/sys
+       umount $(MNThdd)/var
+       umount $(MNThdd)/boot
        umount $(MNThdd)
 
        # Compress Image