]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - lfs/flash-images
Merge commit 'ms/openvpn-n2n' into next
[people/teissler/ipfire-2.x.git] / lfs / flash-images
index cf2c3bc403246c37e1a2ea061018fd77162a3828..99ed45f28457f1683098310af79da3dcbc9d742c 100644 (file)
@@ -54,7 +54,7 @@ SIZEboot := 20
 IMGroot  := /install/images/rootfs
 SIZEroot := 500
 IMGvar   := /install/images/varfs
-SIZEvar  := 440
+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
@@ -94,30 +94,16 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        chroot $(MNThdd) /usr/bin/perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
        sed -i -e "s|MOUNT|ro|g" $(MNThdd)/boot/grub/grub.conf
        sed -i -e "s|KVER|$(KVER)|g" $(MNThdd)/boot/grub/grub.conf
-       sed -i -e "s|ROOT|/dev/sda3|g" $(MNThdd)/boot/grub/grub.conf
+       sed -i -e "s|ROOT|UUID=$$(blkid -sUUID $(IMGroot) | cut -d'"' -f2)|g" $(MNThdd)/boot/grub/grub.conf
        ln -s grub.conf $(MNThdd)/boot/grub/menu.lst
+       sed -i -e "s|DEVICE1|UUID=$$(blkid -sUUID $(IMGboot) | cut -d'"' -f2)|g" $(MNThdd)/etc/fstab
        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|DEVICE3|UUID=$$(blkid -sUUID $(IMGroot) | cut -d'"' -f2)|g" $(MNThdd)/etc/fstab
+       sed -i -e "s|DEVICE4|UUID=$$(blkid -sUUID $(IMGvar) | cut -d'"' -f2)|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
 
        # Copy grub files manually
-       cp -f $(MNThdd)/usr/lib/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 "&& /sbin/reboot"                              >> $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
-
-       chmod +x $(MNThdd)/etc/rc.d/rcsysinit.d/S75firstsetup
+       cp -f $(MNThdd)/usr/share/grub/i386-pc/* $(MNThdd)/boot/grub/
 
        # Unmount
        umount $(MNThdd)/proc
@@ -127,6 +113,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 +145,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 +180,4 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        gzip -f9 $(IMGinsts)
 
        rm -rf $(MNThdd) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar)
+