]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - lfs/flash-images
kernel: add kernel for Raspberry Pi.
[ipfire-2.x.git] / lfs / flash-images
index fb1ca3da9902435704c0876b7273782b81346740..4091322a593b926bff9552637a4622226deb93a5 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2007-2011  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -44,17 +44,17 @@ md5 :
 ###############################################################################
 # Installation Details
 ###############################################################################
-IMGinst  := /install/images/$(SNAME)-$(VERSION).1gb-ext2.$(MACHINE)-full-core$(CORE).img
-IMGinsts := /install/images/$(SNAME)-$(VERSION).1gb-ext2-scon.$(MACHINE)-full-core$(CORE).img
+IMGinst  := /install/images/$(SNAME)-$(VERSION).2gb-ext2.$(MACHINE)-full-core$(CORE).img
+IMGinsts := /install/images/$(SNAME)-$(VERSION).2gb-ext2-scon.$(MACHINE)-full-core$(CORE).img
 MNThdd   := /install/harddisk
 IMGpart  := /install/images/part_area
 IMGboot  := /install/images/bootfs
 # don't change SIZEboot this without checking Image size
-SIZEboot := 20
+SIZEboot := 50
 IMGroot  := /install/images/rootfs
-SIZEroot := 500
+SIZEroot := 1400
 IMGvar   := /install/images/varfs
-SIZEvar  := 430
+SIZEvar  := 400
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -rf $(MNThdd) $(IMGinst) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) && mkdir -p $(MNThdd)
@@ -63,7 +63,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        dd bs=1k if=/dev/zero of=$(IMGpart) count=16
 
        # Create images for filesystems
-       dd bs=1K if=/dev/zero of=$(IMGboot) count=20464  # 20MB-16K
+       dd bs=1K if=/dev/zero of=$(IMGboot) count=51184  # 50MB-16K
        dd bs=1M if=/dev/zero of=$(IMGroot) count=$(SIZEroot)
        dd bs=1M if=/dev/zero of=$(IMGvar) count=$(SIZEvar)
 
@@ -84,13 +84,21 @@ endif
        mount -o loop $(IMGboot) $(MNThdd)/boot
        mount -o loop $(IMGvar)  $(MNThdd)/var
 
+       # Install MLO and uboot first
+ifeq "$(MACHINE_TYPE)" "arm"
+       cp -v /boot/MLO $(MNThdd)/boot/
+       cp -v /boot/u-boot.bin $(MNThdd)/boot/
+       sync
+       umount $(MNThdd)/boot
+       mount -o loop $(IMGboot) $(MNThdd)/boot
+endif
+
        # Install IPFire
        tar -C $(MNThdd)/ -xvaf /install/cdrom/$(SNAME)-$(VERSION).tlz
        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
        mount --bind /proc $(MNThdd)/proc
        mount --bind /dev  $(MNThdd)/dev
@@ -116,6 +124,11 @@ ifneq "$(MACHINE_TYPE)" "arm"
        cp -f $(MNThdd)/usr/share/grub/i386-pc/* $(MNThdd)/boot/grub/
 endif
 
+       # Setup symlink for partresize at first boot...
+       ln -sf ../init.d/partresize $(MNThdd)/etc/rc.d/rcsysinit.d/S25partresize
+       # Setup symlink for fsresize at second boot...
+       ln -sf ../init.d/fsresize $(MNThdd)/etc/rc.d/rcsysinit.d/S26fsresize
+
        # Unmount
        umount $(MNThdd)/proc
        umount $(MNThdd)/dev
@@ -124,18 +137,30 @@ endif
        umount $(MNThdd)/var
        umount $(MNThdd)
 
-       # zerofree the ext3 images to get better compression
+       # zerofree the ext2 images to get better compression
 ifneq "$(MACHINE_TYPE)" "arm"
        zerofree $(IMGboot)
+       -fsck.ext2 -f -y $(IMGboot)
+       fsck.ext2 -f -y $(IMGboot)
 endif
        zerofree $(IMGroot)
+       -fsck.ext2 -f -y  $(IMGroot)
+       fsck.ext2 -f -y  $(IMGroot)
        zerofree $(IMGvar)
+       -fsck.ext2 -f -y  $(IMGvar)
+       fsck.ext2 -f -y  $(IMGvar)
 
        # Cat to an image
        cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinst)
+
        # Write Partition table
+ifneq "$(MACHINE_TYPE)" "arm"
        echo -e ",$(SIZEboot),L,*\n,0,0\n,$(SIZEroot),L\n,$(SIZEvar),L\n" \
                | sfdisk -D -uM -H 64 -S 32 $(IMGinst)
+else
+       echo -e ",$(SIZEboot),c,*\n,0,0\n,$(SIZEroot),L\n,$(SIZEvar),L\n" \
+               | sfdisk -D -uM -H 64 -S 32 $(IMGinst)
+endif
 
 ifneq "$(MACHINE_TYPE)" "arm"
        # Install grub
@@ -160,6 +185,8 @@ ifneq "$(MACHINE_TYPE)" "arm"
        sed -i -e "s|#serial|serial|g" $(MNThdd)/boot/grub/grub.conf
        sed -i -e "s|#terminal|terminal|g" $(MNThdd)/boot/grub/grub.conf
        sed -i -e "s| panic=10 | console=ttyS0,115200n8 panic=10 |g" $(MNThdd)/boot/grub/grub.conf
+else
+       sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
 endif
 
        sed -i -e "s|1:2345:respawn:|#1:2345:respawn:|g" $(MNThdd)/etc/inittab
@@ -176,16 +203,28 @@ endif
        # zerofree the ext3 images to get better compression
 ifneq "$(MACHINE_TYPE)" "arm"
        zerofree $(IMGboot)
+       -fsck.ext2 -f -y  $(IMGboot)
+       fsck.ext2 -f -y  $(IMGboot)
 endif
        zerofree $(IMGroot)
+       -fsck.ext2 -f -y  $(IMGroot)
+       fsck.ext2 -f -y  $(IMGroot)
        zerofree $(IMGvar)
+       -fsck.ext2 -f -y  $(IMGvar)
+       fsck.ext2 -f -y  $(IMGvar)
 
        # Cat to an image
        cat $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar) > $(IMGinsts)
        rm -vf $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar)
+
        # Write Partition table
+ifneq "$(MACHINE_TYPE)" "arm"
        echo -e ",$(SIZEboot),L,*\n,0,0\n,$(SIZEroot),L\n,$(SIZEvar),L\n" \
                | sfdisk -D -uM -H 64 -S 32 $(IMGinsts)
+else
+       echo -e ",$(SIZEboot),c,*\n,0,0\n,$(SIZEroot),L\n,$(SIZEvar),L\n" \
+               | sfdisk -D -uM -H 64 -S 32 $(IMGinsts)
+endif
 
 ifneq "$(MACHINE_TYPE)" "arm"
        # Install grub
@@ -201,4 +240,3 @@ endif
        gzip -f9 $(IMGinsts)
 
        rm -rf $(MNThdd) $(IMGpart) $(IMGboot) $(IMGroot) $(IMGvar)
-