]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - lfs/flash-images
u-boot: remove uneeded cflags and a unused rpi patch
[ipfire-2.x.git] / lfs / flash-images
index 55ffd0e819047b6b763398f973a97f070062f3b1..72e635073d2bfd2c08644823e78111cedb652f53 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2021  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        #
@@ -55,16 +55,19 @@ md5 :
 ###############################################################################
 # Installation Details
 ###############################################################################
-MNThdd   := /install/harddisk
-IMG      := /install/images/image.img
+MNThdd   := $(DIR_TMP)/harddisk
+IMG      := $(DIR_TMP)/image.img
 
 # All sizes in blocks
-ifeq "$(BUILD_ARCH)" "armv5tel"
+ifeq "$(BUILD_PLATFORM)" "arm"
  BOOTLOADER =
  S_OFFSET = 8192
 
  # FAT32
  PART_TYPE = c
+ifeq "$(BUILD_ARCH)" "aarch64"
+ BOOTLOADER = grub
+endif
 else
  BOOTLOADER = grub
  S_OFFSET = 8192
@@ -74,9 +77,9 @@ else
 endif
 
 # /boot:  128MB - OFFSET
-# /    : 1200 MB
+# /    : 1600 MB
 S_BOOT := $(shell echo $$(( 262144 - $(S_OFFSET) )))
-S_ROOT := 2477600
+S_ROOT := 3354038
 
 ifeq "$(EFI)" "1"
  S_EFI = 65536 # 32 MB
@@ -89,7 +92,7 @@ PADDING = 100 # MB
 ifeq "$(EFI)" "1"
  SFDISK      = $(SFDISK_BOOT)$(SFDISK_EFI)$(SFDISK_ROOT)
 else
- SFDISK      = $(SFDISK_BOOT)$(SFDISK_ROOT)
+ SFDISK      = $(SFDISK_BOOT),0,0\n$(SFDISK_ROOT)
 endif
 
 SFDISK_BOOT = $(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n
@@ -139,7 +142,7 @@ ifeq "$(EFI)" "1"
 endif
 
        # Install Pandaboard MLO and uboot first
-ifeq "$(BUILD_ARCH)" "armv5tel"
+ifeq "$(BUILD_ARCH)" "armv6l"
        cp -v /boot/MLO $(MNThdd)/boot/
        cp -v /boot/u-boot.img $(MNThdd)/boot/
        sync
@@ -149,9 +152,9 @@ endif
 
        # Install IPFire
 ifneq "$(BUILD_PLATFORM)" "arm"
-       tar -x --xz -C $(MNThdd)/ -f /install/cdrom/distro.img
+       tar $(TAR_OPTIONS) -x --zstd -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img
 else
-       tar -x -C $(MNThdd)/ -f /install/cdrom/distro.img
+       tar $(TAR_OPTIONS) -x -C $(MNThdd)/ -f $(DIR_TMP)/cdrom/distro.img
 endif
        -touch $(MNThdd)/lib/modules/$(KVER)-ipfire/modules.dep
        mkdir $(MNThdd)/proc
@@ -212,6 +215,12 @@ endif
        rm -f $(MNThdd)/etc/grub.d/11_linux_scon
 endif
 
+ifeq "$(BUILD_PLATFORM)" "arm"
+       # Insert the UUID to uENV.txt
+       sed -i $(MNThdd)/boot/uENV.txt \
+               -e "s/^root_dev=.*/root_dev=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
+endif
+
        # Set ramdisk mode to automatic
        echo RAMDISK_MODE=2 > $(MNThdd)/etc/sysconfig/ramdisk
 
@@ -246,11 +255,11 @@ endif
        # not copied to a block device)
        dd if=/dev/zero bs=1M count=$(PADDING) >> $(IMG)
 
-ifeq "$(BUILD_ARCH)" "armv5tel"
+ifeq "$(BUILD_ARCH)" "armv6l"
        # Install u-boot for Orangepi Zero/Nanopi DUO into image 8KB
        dd if=/usr/share/u-boot/orangepi_zero/u-boot-sunxi-with-spl.bin of=$(IMG) bs=1K seek=8 conv=notrunc
 endif
 
        # Compress Image
        xz $(XZ_OPT) < $(IMG) > $(IMAGE_FILE)
-       rm -rf $(IMG) $(MNThdd)
+       rm -rf $(IMG) $(MNThdd) $(DIR_TMP)/cdrom