Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 217 additions & 28 deletions .github/scripts/test_sysupgrade.sh

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ ifeq ($(BR2_TARGET_ROOTFS_UBI),y)
ifneq ($(filter $(BR2_OPENIPC_SOC_VENDOR),"rockchip" "sigmastar"),)
@$(call PREPARE_REPACK,,,rootfs.ubi,16384,nand)
else ifneq ($(wildcard $(PWD)/br-ext-chip-$(subst ",,$(BR2_OPENIPC_SOC_VENDOR))/board/$(subst ",,$(BR2_OPENIPC_SOC_FAMILY))/nand-fit.its),)
# FIT NAND (board/<family>/nand-fit.its): the kernel lives in the `kernel` UBI
# volume, so the package carries what sysupgrade writes into each volume --
# fitImage and rootfs.ubifs -- and rootfs.ubi for a fresh install. Measured
# against the volume sizes in the board's ubinize-nand.cfg.
@$(call CHECK_SIZE,fitImage,4096)
@$(call CHECK_SIZE,rootfs.ubifs,32768)
@$(call CHECK_SIZE,rootfs.ubi,16384)
# FIT NAND (board/<family>/nand-fit.its): the kernel lives inside the UBIFS
# rootfs (/boot, see external.mk), so the package carries what sysupgrade
# writes -- rootfs.ubifs -- plus rootfs.ubi for a fresh install, and fitImage
# as the SoC witness sysupgrade reads beside a UBIFS rootfs. No volume bounds
# either image: sysupgrade sizes the volumes to them. rootfs.ubi is the whole
# UBI image a fresh install loads into RAM at 0x42000000 and writes from there,
# so it is held to the 24M the installer stages (openipc.org's 0x1800000),
# which still clears the relocated U-Boot at the top of a 64M part
# (hi3516ev200).
@$(call CHECK_SIZE,rootfs.ubi,24576)
@$(call REPACK_NAND_FIT)
else
@$(call PREPARE_REPACK,uImage,4096,rootfs.ubi,16384,nand)
Expand Down
5 changes: 3 additions & 2 deletions br-ext-chip-goke/board/gk7205v500/nand-fit.its
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/dts-v1/;

/*
* Kernel volume of the gk7205v500-family NAND image: the zImage and its DTB,
* Kernel of the gk7205v500-family NAND image: the zImage and its DTB,
* each hashed so U-Boot refuses a kernel that NAND has corrupted instead of
* booting it. Built by general/scripts/rootfs_script.sh (the "NAND FIT" step)
* from the kernel tree, before ubinize packs it into the `kernel` volume.
* from the kernel tree; external.mk puts it in the UBIFS rootfs as
* /boot/fitImage.
*
* No fdt load address: u-boot-xmedia relocates the DTB under bootm_size,
* inside the kernel's lowmem.
Expand Down
25 changes: 9 additions & 16 deletions br-ext-chip-goke/board/gk7205v500/ubinize-nand.cfg
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
# gk7205v500-family NAND: kernel (FIT) + rootfs (UBIFS) + rootfs_data.
# Boots with u-boot-xmedia's FIT NAND env: `ubi read ${baseaddr} kernel; bootm`
# and root=ubi0:rootfs. sysupgrade rewrites `kernel` and `rootfs` in place
# with ubiupdatevol, so their sizes are the ceiling for future images.
[kernel]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=kernel
vol_alignment=1
vol_size=4MiB
image=BINARIES_DIR/fitImage

# gk7205v500-family NAND: rootfs (UBIFS, the kernel inside as
# /boot/fitImage) + rootfs_data. u-boot-xmedia boots it with
# `ubifsmount ubi0:rootfs; ubifsload /boot/fitImage; bootm` and root=ubi0:rootfs.
#
# No vol_size: the rootfs volume is exactly as big as its image, and the
# overlay takes everything else. sysupgrade resizes both when it writes a new
# rootfs, so neither size is a limit a future image has to fit.
[rootfs]
mode=ubi
vol_id=1
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
vol_size=32MiB
image=BR2_ROOTFS_UBIFS_PATH

[rootfs_data]
mode=ubi
vol_id=2
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_alignment=1
Expand Down
55 changes: 55 additions & 0 deletions br-ext-chip-hisilicon/board/hi3516ev200/nand-fit.its
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/dts-v1/;

/*
* Kernel of the hi3516ev200-family NAND image (hi3516ev200, hi3516ev300,
* hi3518ev300): the zImage and its DTB, each hashed so U-Boot refuses a kernel
* that NAND has corrupted instead of booting it. Built by
* general/scripts/rootfs_script.sh (the "NAND FIT" step) from the kernel
* tree; external.mk puts it in the UBIFS rootfs as /boot/fitImage.
*
* Each model's kernel builds only its own <model>-demb.dtb, so the DTB name is
* a placeholder filled in per build, like the SoC name.
*
* Load and entry are CONFIG_HI_ZRELADDR. No fdt load address: u-boot-xmedia
* relocates the DTB under bootm_size, inside the kernel's lowmem.
*/
/ {
/* "OpenIPC <soc>": sysupgrade's SoC check reads it (fit_soc). @SOC@ is
filled in from OPENIPC_SOC_MODEL when the FIT is built. */
description = "OpenIPC @SOC@";
#address-cells = <1>;

images {
kernel {
description = "Linux";
data = /incbin/("zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x40008000>;
entry = <0x40008000>;
hash-1 { algo = "crc32"; };
hash-2 { algo = "sha1"; };
};

fdt {
description = "@DTB@";
data = /incbin/("@DTB@");
type = "flat_dt";
arch = "arm";
compression = "none";
hash-1 { algo = "crc32"; };
hash-2 { algo = "sha1"; };
};
};

configurations {
default = "conf-1";
conf-1 {
description = "Linux + @DTB@";
kernel = "kernel";
fdt = "fdt";
};
};
};
23 changes: 23 additions & 0 deletions br-ext-chip-hisilicon/board/hi3516ev200/ubinize-nand.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# hi3516ev200-family NAND (hi3516ev200, hi3516ev300, hi3518ev300): rootfs (UBIFS, the kernel inside as
# /boot/fitImage) + rootfs_data. u-boot-xmedia boots it with
# `ubifsmount ubi0:rootfs; ubifsload /boot/fitImage; bootm` and root=ubi0:rootfs.
#
# No vol_size: the rootfs volume is exactly as big as its image, and the
# overlay takes everything else. sysupgrade resizes both when it writes a new
# rootfs, so neither size is a limit a future image has to fit.
[rootfs]
mode=ubi
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_alignment=1
image=BR2_ROOTFS_UBIFS_PATH

[rootfs_data]
mode=ubi
vol_id=1
vol_type=dynamic
vol_name=rootfs_data
vol_alignment=1
vol_size=2MiB
vol_flags=autoresize
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/ubinize-nand.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/ubinize-nand.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_SQUASHFS=y
BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
BR2_OPENIPC_SOC_VENDOR="hisilicon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL)/scripts/ubifs/ubinize.cfg"
BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/ubinize-nand.cfg"
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000

# OpenIPC
Expand Down
26 changes: 26 additions & 0 deletions general/external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ OPENIPC_TOOLCHAIN := toolchain/toolchain.$(OPENIPC_KERNEL)
# by ~45KB in the size report rather than anything failing.
WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_TDLS CONFIG_IEEE80211R

# NAND boards with a FIT (board/<family>/nand-fit.its) carry their kernel inside
# the UBIFS rootfs rather than in a volume of its own: no flash is set aside
# for a kernel, and the rootfs volume is as big as its image. Exactly one
# kernel goes in, never two: /boot/fitImage (zImage + DTB, hashed) when the
# board builds a FIT, which these do, otherwise /boot/uImage (the NOR kernel,
# DTB appended). u-boot-xmedia boots either, trying the FIT first, so a board
# without a FIT -- or a U-Boot with UBIFS but no FIT, given a uImage build --
# needs nothing else.
#
# Copied into the UBIFS image's own copy of the target tree only, so the
# squashfs the NOR package ships stays as it was. The kernel exists by then:
# the uImage from the kernel build, the FIT from rootfs_script.sh, which runs
# before any filesystem is generated. Same include-order dependency as above:
# the hook list is expanded when the rule runs.
ifneq ($(wildcard $(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nand-fit.its),)
define OPENIPC_UBIFS_BOOT
mkdir -p $(TARGET_DIR)/boot
if [ -f $(BINARIES_DIR)/fitImage ]; then \
cp $(BINARIES_DIR)/fitImage $(TARGET_DIR)/boot/; \
else \
cp $(BINARIES_DIR)/uImage $(TARGET_DIR)/boot/; \
fi
endef
ROOTFS_UBIFS_PRE_GEN_HOOKS += OPENIPC_UBIFS_BOOT
endif

# linux.mk passes INSTALL_MOD_STRIP=1, which the kernel turns into
# `strip --strip-debug`: every module still ships its full .symtab/.strtab.
# Any other value is handed to strip as its options, and --strip-unneeded keeps
Expand Down
Loading
Loading