]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - lfs/flash-images
core140: ship glibc built with new gcc
[ipfire-2.x.git] / lfs / flash-images
index 900f526fb86b19d1e22f63ecb3bb94aaf977f8eb..332bd1fdf8b8ca6c556d046cdc42550b7c90bf2c 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2019  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        #
@@ -65,45 +65,39 @@ ifeq "$(BUILD_PLATFORM)" "arm"
 
  # FAT32
  PART_TYPE = c
+ifeq "$(BUILD_ARCH)" "aarch64"
+ BOOTLOADER = grub
+endif
 else
  BOOTLOADER = grub
  S_OFFSET = 8192
 
- # Logical
+ # Linux
  PART_TYPE = L
 endif
 
-ifeq "$(EFI)" "1"
- S_EFI = 204800
-else
- S_EFI = 0
-endif
-
 # /boot:  128MB - OFFSET
-# /    : 1200 MB
+# /    : 1400 MB
 S_BOOT := $(shell echo $$(( 262144 - $(S_OFFSET) )))
-S_ROOT := 2477600
-
-ifeq "$(BUILD_ARCH)" "x86_64"
-       EFI_ARCH = x64
-endif
+S_ROOT := 2934784
 
-ifeq "$(BUILD_ARCH)" "i586"
-       EFI_ARCH = ia32
+ifeq "$(EFI)" "1"
+ S_EFI = 65536 # 32 MB
+else
+ S_EFI = 0
 endif
 
 PADDING = 100 # MB
 
 ifeq "$(EFI)" "1"
- SFDISK_EFI  = $(S_OFFSET),$(S_EFI),U,*\n
  SFDISK      = $(SFDISK_BOOT)$(SFDISK_EFI)$(SFDISK_ROOT)
 else
- SFDISK_SWAP = ,0,0\n
- SFDISK      = $(SFDISK_BOOT)$(SFDISK_SWAP)$(SFDISK_ROOT)
+ SFDISK      = $(SFDISK_BOOT),0,0\n$(SFDISK_ROOT)
 endif
 
-SFDISK_BOOT = $(shell echo $$(( $(S_OFFSET) + $(S_EFI) ))),$(S_BOOT),$(PART_TYPE)\n
-SFDISK_ROOT = $(shell echo $$(( $(S_OFFSET) + $(S_EFI) + $(S_BOOT) ))),$(S_ROOT),L\n
+SFDISK_BOOT = $(S_OFFSET),$(S_BOOT),$(PART_TYPE),*\n
+SFDISK_EFI  = $(shell echo $$(( $(S_OFFSET) + $(S_BOOT) ))),$(S_EFI),U\n
+SFDISK_ROOT = $(shell echo $$(( $(S_OFFSET) + $(S_BOOT) + $(S_EFI) ))),$(S_ROOT),L\n
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # Stop if $(MNThdd) is still mounted
@@ -118,11 +112,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        # Write Partition table
        echo -e "$(SFDISK)" | sfdisk -uS $(DEVICE)
 
-       # Remove 2nd empty partition
-ifneq "$(EFI)" "1"
-       -echo -e "d\n2\nw\n\q\n" | fdisk $(DEVICE)
-endif
-
        kpartx -v -a $(DEVICE)
 
        # Format them
@@ -209,19 +198,27 @@ ifeq "$(BOOTLOADER)" "grub"
        sed -i $(MNThdd)/boot/grub/grub.cfg \
                -e "s/root=[A-Za-z0-9\/=-]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
 
+ifeq "$(BUILD_PLATFORM)" "x86"
        # Install GRUB
        grub-install --force --recheck --no-floppy --target=i386-pc \
                --root-directory=$(MNThdd) $(DEVICE)
+endif
+
+ifeq "$(EFI)" "1"
+       # Install GRUB for EFI
+       grub-install --target=$(GRUB_ARCH)-efi --removable --no-nvram \
+               --boot-directory=$(MNThdd)/boot --efi-directory=$(MNThdd)/boot/efi
+endif
 
        # restore orginal defaults
        mv -f $(MNThdd)/etc/default/grub.backup $(MNThdd)/etc/default/grub
        rm -f $(MNThdd)/etc/grub.d/11_linux_scon
-
-ifeq "$(EFI)" "1"
-       mkdir -pv $(MNThdd)/boot/efi/EFI/boot
-       cp -vf $(MNThdd)/boot/efi/EFI/ipfire/grub-efi/grub.efi \
-               $(MNThdd)/boot/efi/EFI/boot/boot$(EFI_ARCH).efi
 endif
+
+ifeq "$(BUILD_ARCH)" "armv5tel"
+       # 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