X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=lfs%2Fflash-images;h=6c88180598b659dfa2ae79f77a5be3e9c4cf6592;hp=69b6b44ebd35999f058fb062e5233c6d201293ea;hb=c02327515412b1b3ffe147275623b8475fe03b1c;hpb=c42cbc86b3e052ec89c28e3fdd4fdb0fb50257de diff --git a/lfs/flash-images b/lfs/flash-images index 69b6b44ebd..6c88180598 100644 --- a/lfs/flash-images +++ b/lfs/flash-images @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2012 IPFire Team # +# Copyright (C) 2007-2014 IPFire Team # # # # 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 # @@ -31,7 +31,7 @@ TARGET = $(DIR_INFO)/$(THISAPP) DEVICE = $(shell losetup -f) PART_BOOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p1 -PART_ROOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p2 +PART_ROOT = /dev/mapper/$(patsubst /dev/%,%,$(DEVICE))p3 ifeq "$(SCON)" "1" IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4-scon.$(MACHINE)-full-core$(CORE).img.gz @@ -75,9 +75,11 @@ else endif # /boot: 64MB - OFFSET -# / : 700MB +# / : 750MB S_BOOT := $(shell echo $$(( 131072 - $(S_OFFSET) ))) -S_ROOT := 1433600 +S_ROOT := 1536000 + +PADDING = 100 # MB $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) # Stop if $(MNThdd) is still mounted @@ -90,7 +92,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) losetup $(DEVICE) $(IMG) # Write Partition table - echo -e "$(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n$$(( $(S_BOOT) + $(S_OFFSET) )),$(S_ROOT),L\n" \ + echo -e "$(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n,0,0\n$$(( $(S_BOOT) + $(S_OFFSET) )),$(S_ROOT),L\n" \ | sfdisk -D -uS -H 64 -S 32 $(DEVICE) kpartx -v -a $(DEVICE) @@ -114,19 +116,25 @@ endif mkdir -pv $(MNThdd)/boot mount $(PART_BOOT) $(MNThdd)/boot - # Install MLO and uboot first + # Install Pandaboard MLO and uboot first ifeq "$(MACHINE_TYPE)" "arm" cp -v /boot/MLO $(MNThdd)/boot/ cp -v /boot/u-boot.img $(MNThdd)/boot/ cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/ + # work around a u-boot bug not find the folders sometimes + mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-multi + mkdir -pv $(MNThdd)/boot/dtb-$(KVER)-ipfire-kirkwood sync umount $(MNThdd)/boot mount $(PART_BOOT) $(MNThdd)/boot endif # Install IPFire +ifneq "$(MACHINE_TYPE)" "arm" tar -x --lzma -C $(MNThdd)/ -f /install/cdrom/distro.img - +else + tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img +endif echo "LANGUAGE=en" >> $(MNThdd)/var/ipfire/main/settings echo "HOSTNAME=$(SNAME)" >> $(MNThdd)/var/ipfire/main/settings echo "THEME=ipfire" >> $(MNThdd)/var/ipfire/main/settings @@ -143,8 +151,7 @@ ifeq "$(SCON)" "1" ifeq "$(MACHINE_TYPE)" "arm" sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt - sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/boot.script - cd $(MNThdd)/boot && ./convert_bootscript + sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/uEnv.txt endif endif @@ -162,15 +169,10 @@ endif printf "$(FSTAB_FMT)" "$$(blkid -o value -s UUID $(PART_ROOT))" "/" \ "auto" "defaults" 1 1 >> $(MNThdd)/etc/fstab - # 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/S42fsresize - ifeq "$(BOOTLOADER)" "grub" ifeq "$(SCON)" "1" # Enable serial console on GRUB - echo "GRUB_TERMINAL=\"serial console\"" >> $(MNThdd)/etc/default/grub + echo "GRUB_TERMINAL=\"serial\"" >> $(MNThdd)/etc/default/grub echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> $(MNThdd)/etc/default/grub sed -i -e "s|panic=10|& console=ttyS0,115200n8|g" $(MNThdd)/etc/default/grub @@ -189,6 +191,9 @@ endif --root-directory=$(MNThdd) $(DEVICE) endif + # Automatically resize the root partition to its maximum size at first boot + touch $(MNThdd)/.partresize + # Unmount umount $(MNThdd)/proc umount $(MNThdd)/sys @@ -209,6 +214,15 @@ endif kpartx -d -v $(DEVICE) losetup -d $(DEVICE) + # Add padding at the end of the image (to fix alignment issues if the image is + # not copied to a block device) + dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG) + +ifeq "$(MACHINE_TYPE)" "arm" + # Install u-boot for LeMaker Banana Pi into image 8KB + dd if=/usr/share/u-boot/banana_pi/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc +endif + # Compress Image pigz -f9 < $(IMG) > $(IMAGE_FILE) rm -rf $(IMG) $(MNThdd)