aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2019-03-28 18:07:05 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2019-04-06 16:31:10 +0200
commit910eb994eb6db33998cf1877f6a258ae49f9a67a (patch)
tree7bbba38449421b85eb0252b513ea19485ca9eac0
parent78a3c5198500ca3f21c1b47af3d977b6ed0e62f0 (diff)
downloadupstream-910eb994eb6db33998cf1877f6a258ae49f9a67a.tar.gz
upstream-910eb994eb6db33998cf1877f6a258ae49f9a67a.tar.bz2
upstream-910eb994eb6db33998cf1877f6a258ae49f9a67a.zip
mvebu: make bootfs size for sdcard image configurable
Let's take this oportunity to implement boot-part and rootfs-part feature flags. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
-rw-r--r--config/Config-images.in2
-rw-r--r--target/linux/mvebu/Makefile2
-rw-r--r--target/linux/mvebu/image/Makefile16
3 files changed, 8 insertions, 12 deletions
diff --git a/config/Config-images.in b/config/Config-images.in
index 6610601d55..9daaf74915 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -272,7 +272,7 @@ menu "Target Images"
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
- depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml
+ depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml
default 256
help
Select the root filesystem partition size.
diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index ee76c0b776..a920f6db7d 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
BOARD:=mvebu
BOARDNAME:=Marvell EBU Armada
-FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk
+FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part
SUBTARGETS:=cortexa9 cortexa53 cortexa72
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index be01623e86..88790777d9 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -19,12 +19,6 @@ define Build/dtb
$(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
endef
-# SD-Card Images:
-# these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
-# MBR: 2048 sectors
-# Partition 1: 32768 sectors
-# Partition 2: 98304 sectors (configurable)
-
define Build/boot-scr
rm -f $@-boot.scr
sed -e 's#@ROOT@#$(SIGNATURE)#g' \
@@ -34,7 +28,7 @@ endef
define Build/boot-img
rm -f $@.boot
- mkfs.fat -C $@.boot 16384
+ mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
$(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::$(dts).dtb;)
mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_NAME)
-mcopy -i $@.boot $@-boot.scr ::boot.scr
@@ -46,26 +40,28 @@ define Build/boot-img-ext4
$(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
- make_ext4fs -J -l 16384K $@.bootimg $@.boot
+ make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
endef
define Build/sdcard-img
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+ BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
- c 32768 $@.boot \
+ c $$BOOTFS_SIZE $@.boot \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
endef
define Build/sdcard-img-ext4
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+ BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
- 83 32768 $@.bootimg \
+ 83 $$BOOTFS_SIZE $@.bootimg \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
endef