]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - lfs/flash-images
flashimages: is dracut to create initrd.
[people/pmueller/ipfire-2.x.git] / lfs / flash-images
index f8567722100ccf126550a99de293566af9ee2fcf..dde98cb0a29a8c1f0a47b73f744baaf694985f55 100644 (file)
@@ -54,7 +54,7 @@ SIZEboot := 20
 IMGroot  := /install/images/rootfs
 SIZEroot := 500
 IMGvar   := /install/images/varfs
-SIZEvar  := 420
+SIZEvar  := 430
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -rf $(MNThdd) $(IMGinst) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) && mkdir -p $(MNThdd)
@@ -81,7 +81,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        mount -o loop $(IMGvar)  $(MNThdd)/var
 
        # Install IPFire
-       tar -C $(MNThdd)/ -xvjf /install/cdrom/$(SNAME)-$(VERSION).tbz2
+       tar -C $(MNThdd)/ -xvf /install/cdrom/$(SNAME)-$(VERSION).tlz --lzma
        echo "LANGUAGE=en" >> $(MNThdd)/var/ipfire/main/settings
        echo "HOSTNAME=$(SNAME)" >> $(MNThdd)/var/ipfire/main/settings
        echo "THEME=ipfire" >> $(MNThdd)/var/ipfire/main/settings
@@ -99,15 +99,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        sed -i -e "s|DEVICE2|#DEVICE2|g" $(MNThdd)/etc/fstab
        sed -i -e "s|DEVICE|/dev/sda|g" $(MNThdd)/etc/fstab
        sed -i -e "s|FSTYPE|ext2|g" $(MNThdd)/etc/fstab
-       cp -f $(MNThdd)/etc/mkinitcpio.conf $(MNThdd)/etc/mkinitcpio.conf.org
-       sed -i -e "s| autodetect | |g" $(MNThdd)/etc/mkinitcpio.conf
-       chroot $(MNThdd) /sbin/mkinitcpio -g /boot/ipfirerd-$(KVER)-emergency.img -k $(KVER)-ipfire 
-       cp -f $(MNThdd)/etc/mkinitcpio.conf.org $(MNThdd)/etc/mkinitcpio.conf
-       ln -s ipfirerd-$(KVER)-emergency.img $(MNThdd)/boot/ipfirerd-$(KVER).img
+       chroot $(MNThdd) /usr/local/bin/rebuild-initrd
 
        # Copy grub files manually
-       cp -f $(MNThdd)/usr/lib/grub/i386-pc/* $(MNThdd)/boot/grub/
-       chroot $(MNThdd) /usr/sbin/grub-set-default 0
+       cp -f $(MNThdd)/usr/share/grub/i386-pc/* $(MNThdd)/boot/grub/
+       #chroot $(MNThdd) /usr/sbin/grub-set-default 0
 
        # Create a script for rebuild-initrd and setup
        echo "#!/bin/bash"                                   > $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
@@ -127,6 +123,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        umount $(MNThdd)/var
        umount $(MNThdd)
 
+       # zerofree the ext3 images to get better compression
+       zerofree $(IMGboot)
+       zerofree $(IMGroot)
+       zerofree $(IMGvar)
+
        # Cat to an image
        cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinst)
        # Write Partition table
@@ -154,11 +155,22 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        sed -i -e "s|#terminal|terminal|g" $(MNThdd)/boot/grub/grub.conf
        sed -i -e "s| panic=10 | console=ttyS0,38400n8 panic=10 |g" $(MNThdd)/boot/grub/grub.conf
 
+       sed -i -e "s|1:2345:respawn:|#1:2345:respawn:|g" $(MNThdd)/etc/inittab
+       sed -i -e "s|2:2345:respawn:|#2:2345:respawn:|g" $(MNThdd)/etc/inittab
+       sed -i -e "s|3:2345:respawn:|#3:2345:respawn:|g" $(MNThdd)/etc/inittab
+       sed -i -e "s|4:2345:respawn:|#4:2345:respawn:|g" $(MNThdd)/etc/inittab
+       sed -i -e "s|5:2345:respawn:|#5:2345:respawn:|g" $(MNThdd)/etc/inittab
+       sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" $(MNThdd)/etc/inittab
        sed -i -e "s|#7:2345:respawn:|7:2345:respawn:|g" $(MNThdd)/etc/inittab
 
        umount $(MNThdd)/boot
        umount $(MNThdd)
 
+       # zerofree the ext3 images to get better compression
+       zerofree $(IMGboot)
+       zerofree $(IMGroot)
+       zerofree $(IMGvar)
+
        # Cat to an image
        cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinsts)
        rm -vf $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar)
@@ -178,3 +190,4 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        gzip -f9 $(IMGinsts)
 
        rm -rf $(MNThdd) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar)
+