Initial commit

This commit is contained in:
domenico
2025-06-24 15:51:28 +02:00
commit 22031d9dab
6862 changed files with 1462554 additions and 0 deletions

View File

@@ -0,0 +1,130 @@
#
# Copyright (C) 2012-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-project.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
JFFS2_BLOCKSIZE = 128k
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
KERNEL_LOADADDR := 0x00008000
SIGNATURE:=$(shell printf "%.8s" $(SOURCE_DATE_EPOCH))
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' \
$(DEVICE_NAME).bootscript > $@-new.bootscript
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $@-new.bootscript $@-boot.scr
endef
define Build/boot-img
rm -f $@.boot
mkfs.fat -C $@.boot 16384
$(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
endef
define Build/boot-img-ext4
rm -fR $@.boot
mkdir -p $@.boot
$(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
endef
define Build/sdcard-img
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
c 32768 $@.boot \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
endef
define Build/sdcard-img-ext4
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
83 32768 $@.bootimg \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
endef
define Build/omnia-medkit-initramfs
$(TAR) -c -T /dev/null -f $@
rm -rf $(dir $(IMAGE_KERNEL))boot
mkdir -p $(dir $(IMAGE_KERNEL))boot/boot/
cp $(KDIR)/zImage-initramfs $(dir $(IMAGE_KERNEL))boot/boot/zImage
cp $(DTS_DIR)/$(DEVICE_DTS).dtb $(dir $(IMAGE_KERNEL))boot/boot/dtb
$(TAR) -rp --numeric-owner --owner=0 --group=0 --sort=name \
$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
--file=$@ -C $(dir $(IMAGE_KERNEL))boot/ .
endef
define Device/Default
PROFILES := Default
DEVICE_DTS := $(1)
BOARD_NAME = $$(DEVICE_DTS)
KERNEL_NAME := zImage
KERNEL := kernel-bin | append-dtb | uImage none
SUPPORTED_DEVICES = $$(DEVICE_DTS)
UBOOT :=
endef
DEVICE_VARS += UBOOT
define Device/UBI
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/UBI-factory
$(Device/UBI)
UBINIZE_OPTS := -E 5
IMAGES += factory.img
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
endef
define Device/NAND-128K
$(Device/UBI)
BLOCKSIZE := 128k
PAGESIZE := 2048
SUBPAGESIZE := 512
VID_HDR_OFFSET := 2048
endef
define Device/NAND-256K
$(Device/UBI)
BLOCKSIZE := 256k
PAGESIZE := 4096
endef
define Device/NAND-512K
$(Device/UBI)
BLOCKSIZE := 512k
PAGESIZE := 4096
endef
include cortex-a9.mk
include cortex-a53.mk
include cortex-a72.mk
$(eval $(call BuildImage))

View File

@@ -0,0 +1,27 @@
# Standard Boot-Script
# use only well-known variable names provided by U-Boot Distro boot
# This script assumes that there is a boot partition,
# and that the root partition is always the next one.
# Override DeviceTree for Clearfog Base
# removed once U-Boot is able to detect the board variant.
setenv fdtfile armada-388-clearfog-base.dtb
# rootfs is always on the next partition
setexpr openwrt_rootpart ${distro_bootpart} + 1
# figure out partition uuid to pass to the kernel as root=
part uuid ${devtype} ${devnum}:${openwrt_rootpart} uuid
# generate bootargs (rootfs)
setenv bootargs ${bootargs} root=PARTUUID=${uuid} rootfstype=auto rootwait
# add console= option to bootargs, if any
if test -n "${console}"; then
setenv bootargs ${bootargs} console=${console}
fi
echo "Booting Linux with ${bootargs}"
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdtfile}
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
bootz ${kernel_addr_r} - ${fdt_addr_r}

View File

@@ -0,0 +1,27 @@
# Standard Boot-Script
# use only well-known variable names provided by U-Boot Distro boot
# This script assumes that there is a boot partition,
# and that the root partition is always the next one.
# Override DeviceTree for Clearfog Pro
# removed once U-Boot has been updated to the new name.
setenv fdtfile armada-388-clearfog-pro.dtb
# rootfs is always on the next partition
setexpr openwrt_rootpart ${distro_bootpart} + 1
# figure out partition uuid to pass to the kernel as root=
part uuid ${devtype} ${devnum}:${openwrt_rootpart} uuid
# generate bootargs (rootfs)
setenv bootargs ${bootargs} root=PARTUUID=${uuid} rootfstype=auto rootwait
# add console= option to bootargs, if any
if test -n "${console}"; then
setenv bootargs ${bootargs} console=${console}
fi
echo "Booting Linux with ${bootargs}"
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdtfile}
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
bootz ${kernel_addr_r} - ${fdt_addr_r}

View File

@@ -0,0 +1,10 @@
setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait"
if test -n "${console}"; then
setenv bootargs "${bootargs} ${console}"
fi
load mmc 1:1 ${fdt_addr} armada-8040-mcbin.dtb
load mmc 1:1 ${kernel_addr} Image
booti ${kernel_addr} - ${fdt_addr}

View File

@@ -0,0 +1,16 @@
ifeq ($(SUBTARGET),cortexa53)
define Device/globalscale-espressobin
KERNEL_NAME := Image
KERNEL := kernel-bin
DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 kmod-usb-storage
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
DEVICE_DTS := armada-3720-espressobin
DTS_DIR := $(DTS_DIR)/marvell
SUPPORTED_DEVICES := globalscale,espressobin
endef
TARGET_DEVICES += globalscale-espressobin
endif

View File

@@ -0,0 +1,16 @@
ifeq ($(SUBTARGET),cortexa72)
define Device/armada-macchiatobin
KERNEL_NAME := Image
KERNEL := kernel-bin
DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
DEVICE_DTS := armada-8040-mcbin
DTS_DIR := $(DTS_DIR)/marvell
SUPPORTED_DEVICES := marvell,armada8040-mcbin
endef
TARGET_DEVICES += armada-macchiatobin
endif

View File

@@ -0,0 +1,174 @@
#
# Copyright (C) 2012-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-project.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
ifeq ($(SUBTARGET),cortexa9)
define Device/linksys
DEVICE_TITLE := Linksys $(1)
DEVICE_PACKAGES := kmod-mwlwifi wpad-mini swconfig
endef
define Device/armada-385-linksys
$(Device/NAND-128K)
$(Device/UBI-factory)
KERNEL_SIZE := 6144k
endef
define Device/linksys-wrt1200ac
$(call Device/linksys,WRT1200AC (Caiman))
$(Device/armada-385-linksys)
DEVICE_DTS := armada-385-linksys-caiman
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
endef
TARGET_DEVICES += linksys-wrt1200ac
define Device/linksys-wrt1900acv2
$(call Device/linksys,WRT1900ACv2 (Cobra))
$(Device/armada-385-linksys)
DEVICE_DTS := armada-385-linksys-cobra
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
endef
TARGET_DEVICES += linksys-wrt1900acv2
define Device/linksys-wrt3200acm
$(call Device/linksys,WRT3200ACM (Rango))
$(Device/armada-385-linksys)
DEVICE_DTS := armada-385-linksys-rango
DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
endef
TARGET_DEVICES += linksys-wrt3200acm
define Device/linksys-wrt1900acs
$(call Device/linksys,WRT1900ACS (Shelby))
$(Device/armada-385-linksys)
DEVICE_DTS := armada-385-linksys-shelby
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
endef
TARGET_DEVICES += linksys-wrt1900acs
define Device/linksys-wrt32x
$(call Device/linksys,WRT32X (Venom))
DEVICE_DTS := armada-385-linksys-venom
DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
$(Device/armada-385-linksys)
KERNEL_SIZE := 3072k
KERNEL := kernel-bin | append-dtb
endef
TARGET_DEVICES += linksys-wrt32x
define Device/linksys-wrt1900ac
$(call Device/linksys,WRT1900AC (Mamba))
DEVICE_DTS := armada-xp-linksys-mamba
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
$(Device/NAND-128K)
$(Device/UBI-factory)
KERNEL_SIZE := 3072k
endef
TARGET_DEVICES += linksys-wrt1900ac
define Device/openblocks-ax3-4
$(Device/UBI-factory)
DEVICE_DTS := armada-xp-openblocks-ax3-4
SUPPORTED_DEVICES := $(1)
BLOCKSIZE := 128k
PAGESIZE := 1
IMAGE/factory.img := append-kernel | pad-to $$(BLOCKSIZE) | append-ubi
DEVICE_TITLE := Plat'Home OpenBlocks AX3
endef
TARGET_DEVICES += openblocks-ax3-4
define Device/armada-385-db-ap
$(Device/NAND-256K)
$(Device/UBI-factory)
KERNEL_SIZE := 8192k
DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
endef
TARGET_DEVICES += armada-385-db-ap
define Device/marvell-nand
$(Device/NAND-512K)
DEVICE_TITLE := Marvell Armada $(1)
endef
define Device/armada-370-db
$(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
endef
TARGET_DEVICES += armada-370-db
define Device/armada-370-rd
$(call Device/marvell-nand,370 RD (RD-88F6710-A1))
endef
TARGET_DEVICES += armada-370-rd
define Device/armada-xp-db
$(call Device/marvell-nand,XP DB (DB-78460-BP))
endef
TARGET_DEVICES += armada-xp-db
define Device/armada-xp-gp
$(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
endef
TARGET_DEVICES += armada-xp-gp
define Device/armada-388-rd
DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
IMAGES := firmware.bin
IMAGE/firmware.bin := append-kernel | pad-to 256k | append-rootfs | pad-rootfs
endef
TARGET_DEVICES += armada-388-rd
define Device/armada-388-clearfog-pro
KERNEL_INSTALL := 1
KERNEL := kernel-bin
DEVICE_TITLE := SolidRun ClearFog Pro
DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
SUPPORTED_DEVICES := armada-388-clearfog-pro armada-388-clearfog
UBOOT := clearfog-u-boot-spl.kwb
endef
TARGET_DEVICES += armada-388-clearfog-pro
define Device/armada-388-clearfog-base
KERNEL_INSTALL := 1
KERNEL := kernel-bin
DEVICE_TITLE := SolidRun ClearFog Base
DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
IMAGES := sdcard.img.gz
IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
UBOOT := clearfog-u-boot-spl.kwb
endef
TARGET_DEVICES += armada-388-clearfog-base
define Device/globalscale-mirabox
$(Device/NAND-512K)
DEVICE_DTS := armada-370-mirabox
SUPPORTED_DEVICES := mirabox
DEVICE_TITLE := Globalscale Mirabox
endef
TARGET_DEVICES += globalscale-mirabox
define Device/turris-omnia
KERNEL_INSTALL := 1
KERNEL := kernel-bin
KERNEL_INITRAMFS := kernel-bin
DEVICE_TITLE := Turris Omnia
DEVICE_PACKAGES := \
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
wpad-mini kmod-ath9k kmod-ath10k ath10k-firmware-qca988x
IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz
IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata
IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
IMAGE_NAME = $$(2)
DEVICE_DTS := armada-385-turris-omnia
endef
TARGET_DEVICES += turris-omnia
endif

View File

@@ -0,0 +1,84 @@
#!/usr/bin/env bash
#
# Copyright (C) 2016 Josua Mayer
#
# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
usage() {
echo "$0 <outfile> [<bootloader> <type_partitionN> <sectors_partitionN> <img_partitionN>]?"
}
# always require first 2 or 3 arguments
# then in pairs up to 8 more for a total of up to 4 partitions
if [ $# -lt 1 ] || [ $# -gt 14 ] || [ $((($# - 1) % 3)) -ne 0 ]; then
if [ $# -lt 2 ] || [ $# -gt 15 ] || [ $((($# - 2) % 3)) -ne 0 ]; then
usage
exit 1
else
BOOTLOADER="$2"
fi
fi
set -e
# parameters
OUTFILE="$1"; shift
if [ -n "$BOOTLOADER" ]; then
shift
fi
# generate image file
printf "Creating $OUTFILE from /dev/zero: "
dd if=/dev/zero of="$OUTFILE" bs=512 count=1 >/dev/null
printf "Done\n"
while [ "$#" -ge 3 ]; do
ptgen_args="$ptgen_args -t $1 -p $(($2 / 2 + 256))"
parts="$parts$3 "
shift; shift; shift
done
head=16
sect=63
# create real partition table using fdisk
printf "Creating partition table: "
set `ptgen -o "$OUTFILE" -h $head -s $sect -l 1024 -S 0x$SIGNATURE $ptgen_args`
printf "Done\n"
# install bootloader
if [ -n "$BOOTLOADER" ]; then
printf "Writing bootloader: "
dd of="$OUTFILE" if="$BOOTLOADER" bs=512 seek=1 conv=notrunc 2>/dev/null
printf "Done\n"
fi
i=1
while [ "$#" -ge 2 ]; do
img="${parts%% *}"
parts="${parts#* }"
printf "Writing %s to partition %i: " "$img" $i
(
cat "$img"
# add padding to avoid leaving behind old overlay fs data
dd if=/dev/zero bs=128k count=1 2>/dev/null
) | dd of="$OUTFILE" bs=512 seek=$(($1 / 512)) conv=notrunc 2>/dev/null
printf "Done\n"
let i=i+1
shift; shift
done

View File

@@ -0,0 +1,10 @@
setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait"
if test -n "${console}"; then
setenv bootargs "${bootargs} ${console}"
fi
load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb
load mmc 0:1 ${kernel_addr} Image
booti ${kernel_addr} - ${fdt_addr}