X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=lfs%2Fflash-images;h=8ed7f63756f4d3924a83289f24deaf5b4629bc65;hb=025e1fe146c254ddba14cddb02210d0d653cd676;hp=aeaace26e4bae40dff9129b3e53dc5501f31f53b;hpb=f5fe98feade7e6b2152197e0ed9bcef4e657064a;p=ipfire-2.x.git diff --git a/lfs/flash-images b/lfs/flash-images index aeaace26e4..8ed7f63756 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-2017 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,12 +31,12 @@ 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 + IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4-scon.$(BUILD_ARCH)-full-core$(CORE).img.gz else - IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4.$(MACHINE)-full-core$(CORE).img.gz + IMAGE_FILE = /install/images/$(SNAME)-$(VERSION).1gb-ext4.$(BUILD_ARCH)-full-core$(CORE).img.gz endif FSTAB_FMT = UUID=%s %-8s %-4s %-10s %d %d\n @@ -60,7 +60,7 @@ MNThdd := /install/harddisk IMG := /install/images/image.img # All sizes in blocks -ifeq "$(MACHINE_TYPE)" "arm" +ifeq "$(BUILD_PLATFORM)" "arm" BOOTLOADER = S_OFFSET = 8192 @@ -75,9 +75,9 @@ else endif # /boot: 64MB - OFFSET -# / : 700MB +# / : 850MB S_BOOT := $(shell echo $$(( 131072 - $(S_OFFSET) ))) -S_ROOT := 1433600 +S_ROOT := 1740800 PADDING = 100 # MB @@ -92,8 +92,9 @@ $(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" \ - | sfdisk -D -uS -H 64 -S 32 $(DEVICE) + echo -e "$(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n,0,0\n$$(( $(S_BOOT) + $(S_OFFSET) )),$(S_ROOT),L\n" \ + | sfdisk -uS $(DEVICE) + -echo -e "d\n2\nw\n\q\n" | fdisk $(DEVICE) kpartx -v -a $(DEVICE) @@ -116,19 +117,30 @@ endif mkdir -pv $(MNThdd)/boot mount $(PART_BOOT) $(MNThdd)/boot - # Install MLO and uboot first -ifeq "$(MACHINE_TYPE)" "arm" + # Install Pandaboard MLO and uboot first +ifeq "$(BUILD_PLATFORM)" "arm" cp -v /boot/MLO $(MNThdd)/boot/ cp -v /boot/u-boot.img $(MNThdd)/boot/ cp -v /boot/zImage-ipfire-multi $(MNThdd)/boot/ + cp -v /boot/uInit-ipfire-multi $(MNThdd)/boot/ + cp -v /boot/uImage-ipfire-kirkwood $(MNThdd)/boot/ + cp -v /boot/uInit-ipfire-kirkwood $(MNThdd)/boot/ + cp -v /boot/uEnv.txt $(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 "$(BUILD_PLATFORM)" "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,10 +155,9 @@ ifeq "$(SCON)" "1" 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 -ifeq "$(MACHINE_TYPE)" "arm" +ifeq "$(BUILD_PLATFORM)" "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 @@ -177,15 +188,19 @@ endif mkdir -pv $(MNThdd)/boot/grub chroot $(MNThdd) grub-mkconfig -o /boot/grub/grub.cfg - # Insert the UUID because grub-mkconfig fails to detect that correctly + # Insert the UUID because grub-mkconfig often fails to + # detect that correctly sed -i $(MNThdd)/boot/grub/grub.cfg \ - -e "s/root=[a-z0-9\/]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g" + -e "s/root=[A-Za-z0-9\/=-]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g" # Install GRUB - grub-install --force --recheck --no-floppy \ + grub-install --force --recheck --no-floppy --target=i386-pc \ --root-directory=$(MNThdd) $(DEVICE) endif + # Set ramdisk mode to automatic + echo RAMDISK_MODE=2 > $(MNThdd)/etc/sysconfig/ramdisk + # Automatically resize the root partition to its maximum size at first boot touch $(MNThdd)/.partresize @@ -206,6 +221,7 @@ endif -fsck.ext4 -f -y $(PART_ROOT) fsck.ext4 -f -y $(PART_ROOT) + sleep 10 #Ubuntu compiling: allow time to automount/dismount kpartx -d -v $(DEVICE) losetup -d $(DEVICE) @@ -213,6 +229,11 @@ endif # not copied to a block device) dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG) +ifeq "$(BUILD_PLATFORM)" "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)