]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - lfs/flash-images
Rewritten the iptables cgi, fixes bug #578
[people/pmueller/ipfire-2.x.git] / lfs / flash-images
index ead007c0281f9c71a6d3323cc701f13d5462b3f4..5eff02a8242b111fa401db9f3df0f84fce8e67d7 100644 (file)
@@ -54,7 +54,7 @@ SIZEboot := 20
 IMGroot  := /install/images/rootfs
 SIZEroot := 500
 IMGvar   := /install/images/varfs
-SIZEvar  := 450
+SIZEvar  := 430
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -rf $(MNThdd) $(IMGinst) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) && mkdir -p $(MNThdd)
@@ -76,11 +76,15 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        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
-       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
        touch $(MNThdd)/lib/modules/$(KVER)-ipfire/modules.dep
        mv $(MNThdd)/bin/uname.bak $(MNThdd)/bin/uname
        mkdir $(MNThdd)/proc
@@ -102,17 +106,19 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        ln -s ipfirerd-$(KVER)-emergency.img $(MNThdd)/boot/ipfirerd-$(KVER).img
 
        # 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
-       echo "/bin/rm -f /boot/ipfirerd-$(KVER).img"     >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
-       echo "/usr/local/bin/rebuild-initrd"             >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
-       echo "/usr/local/sbin/setup /dev/null INSTALL"   >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
-       echo "rm -f /etc/rc.d/rcsysinit.d/S75firstsetup" >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "#!/bin/bash"                                   > $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "/bin/rm -f /boot/ipfirerd-$(KVER).img"        >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "/usr/local/bin/rebuild-initrd"                >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "/usr/local/sbin/setup /dev/null INSTALL"      >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "rm -f /etc/rc.d/rcsysinit.d/S75firstsetup \\" >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       echo "&& /sbin/reboot"                              >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+
        chmod +x $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
-       
+
        # Unmount
        umount $(MNThdd)/proc
        umount $(MNThdd)/dev
@@ -121,6 +127,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
@@ -153,6 +164,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        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)