Initial commit
This commit is contained in:
116
target/linux/mvebu/image/Makefile
Normal file
116
target/linux/mvebu/image/Makefile
Normal file
@@ -0,0 +1,116 @@
|
||||
#
|
||||
# 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/boot-scr
|
||||
rm -f $@-boot.scr
|
||||
sed \
|
||||
-e 's#@ROOT@#$(SIGNATURE)#g' \
|
||||
-e 's#@DTB@#$(firstword $(DEVICE_DTS))#g' \
|
||||
$(BOOT_SCRIPT).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 $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
|
||||
$(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(KDIR)/image-$(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) $(KDIR)/image-$(dts).dtb $@.boot/$(dts).dtb;)
|
||||
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
|
||||
-$(CP) $@-boot.scr $@.boot/boot.scr
|
||||
make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
|
||||
endef
|
||||
|
||||
define Build/sdcard-img
|
||||
SIGNATURE="$(SIGNATURE)" \
|
||||
./gen_mvebu_sdcard_img.sh $@ \
|
||||
$(if $(UBOOT),$(STAGING_DIR_IMAGE)/$(UBOOT)) \
|
||||
c $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
|
||||
83 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS)
|
||||
endef
|
||||
|
||||
define Build/sdcard-img-ext4
|
||||
SIGNATURE="$(SIGNATURE)" \
|
||||
./gen_mvebu_sdcard_img.sh $@ \
|
||||
$(if $(UBOOT),$(STAGING_DIR_IMAGE)/$(UBOOT)) \
|
||||
83 $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.bootimg \
|
||||
83 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(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 $(KDIR)/image-$(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
|
||||
BOARD_NAME = $$(DEVICE_DTS)
|
||||
KERNEL_NAME := zImage
|
||||
KERNEL := kernel-bin | append-dtb | uImage none
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
|
||||
UBINIZE_OPTS := -E 5
|
||||
UBOOT :=
|
||||
BOOT_SCRIPT :=
|
||||
endef
|
||||
DEVICE_VARS += BOOT_SCRIPT UBOOT
|
||||
|
||||
define Device/Default-arm64
|
||||
BOOT_SCRIPT := generic-arm64
|
||||
DTS_DIR := $(DTS_DIR)/marvell
|
||||
IMAGES := sdcard.img.gz
|
||||
IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
||||
KERNEL_NAME := Image
|
||||
KERNEL := kernel-bin
|
||||
endef
|
||||
|
||||
define Device/NAND-128K
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
SUBPAGESIZE := 512
|
||||
VID_HDR_OFFSET := 2048
|
||||
endef
|
||||
|
||||
define Device/NAND-256K
|
||||
BLOCKSIZE := 256k
|
||||
PAGESIZE := 4096
|
||||
endef
|
||||
|
||||
define Device/NAND-512K
|
||||
BLOCKSIZE := 512k
|
||||
PAGESIZE := 4096
|
||||
endef
|
||||
|
||||
include cortex-a9.mk
|
||||
include cortex-a53.mk
|
||||
include cortex-a72.mk
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
23
target/linux/mvebu/image/clearfog.bootscript
Normal file
23
target/linux/mvebu/image/clearfog.bootscript
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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.
|
||||
|
||||
# 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} @DTB@.dtb
|
||||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
|
||||
bootz ${kernel_addr_r} - ${fdt_addr_r}
|
||||
42
target/linux/mvebu/image/cortex-a53.mk
Normal file
42
target/linux/mvebu/image/cortex-a53.mk
Normal file
@@ -0,0 +1,42 @@
|
||||
ifeq ($(SUBTARGET),cortexa53)
|
||||
|
||||
define Device/globalscale_espressobin
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
|
||||
DEVICE_DTS := armada-3720-espressobin
|
||||
BOOT_SCRIPT := espressobin
|
||||
endef
|
||||
TARGET_DEVICES += globalscale_espressobin
|
||||
|
||||
define Device/globalscale_espressobin-emmc
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := ESPRESSObin eMMC (Marvell Armada 3700 Community Board)
|
||||
DEVICE_DTS := armada-3720-espressobin-emmc
|
||||
BOOT_SCRIPT := espressobin
|
||||
endef
|
||||
TARGET_DEVICES += globalscale_espressobin-emmc
|
||||
|
||||
define Device/globalscale_espressobin-v7
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := ESPRESSObin V7 (Marvell Armada 3700 Community Board)
|
||||
DEVICE_DTS := armada-3720-espressobin-v7
|
||||
BOOT_SCRIPT := espressobin
|
||||
endef
|
||||
TARGET_DEVICES += globalscale_espressobin-v7
|
||||
|
||||
define Device/globalscale_espressobin-v7-emmc
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := ESPRESSObin V7 eMMC (Marvell Armada 3700 Community Board)
|
||||
DEVICE_DTS := armada-3720-espressobin-v7-emmc
|
||||
BOOT_SCRIPT := espressobin
|
||||
endef
|
||||
TARGET_DEVICES += globalscale_espressobin-v7-emmc
|
||||
|
||||
define Device/marvell_armada-3720-db
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := Marvell Armada 3720 Development Board DB-88F3720-DDR3
|
||||
DEVICE_DTS := armada-3720-db
|
||||
endef
|
||||
TARGET_DEVICES += marvell_armada-3720-db
|
||||
|
||||
endif
|
||||
28
target/linux/mvebu/image/cortex-a72.mk
Normal file
28
target/linux/mvebu/image/cortex-a72.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
ifeq ($(SUBTARGET),cortexa72)
|
||||
|
||||
define Device/marvell_macchiatobin
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
|
||||
DEVICE_PACKAGES += kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
|
||||
DEVICE_DTS := armada-8040-mcbin
|
||||
SUPPORTED_DEVICES := marvell,armada8040-mcbin
|
||||
endef
|
||||
TARGET_DEVICES += marvell_macchiatobin
|
||||
|
||||
define Device/marvell_armada8040-db
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := Marvell Armada 8040 DB board
|
||||
DEVICE_DTS := armada-8040-db
|
||||
IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += marvell_armada8040-db
|
||||
|
||||
define Device/marvell_armada7040-db
|
||||
$(call Device/Default-arm64)
|
||||
DEVICE_TITLE := Marvell Armada 7040 DB board
|
||||
DEVICE_DTS := armada-7040-db
|
||||
IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += marvell_armada7040-db
|
||||
|
||||
endif
|
||||
187
target/linux/mvebu/image/cortex-a9.mk
Normal file
187
target/linux/mvebu/image/cortex-a9.mk
Normal file
@@ -0,0 +1,187 @@
|
||||
#
|
||||
# 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/NAND-128K)
|
||||
DEVICE_TITLE := Linksys $(1)
|
||||
DEVICE_PACKAGES := kmod-mwlwifi swconfig wpad-basic
|
||||
IMAGES += factory.img
|
||||
KERNEL_SIZE := 6144k
|
||||
endef
|
||||
|
||||
define Device/linksys_wrt1200ac
|
||||
$(call Device/linksys,WRT1200AC (Caiman))
|
||||
DEVICE_DTS := armada-385-linksys-caiman
|
||||
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
|
||||
SUPPORTED_DEVICES := armada-385-linksys-caiman linksys,caiman
|
||||
endef
|
||||
TARGET_DEVICES += linksys_wrt1200ac
|
||||
|
||||
define Device/linksys_wrt1900acv2
|
||||
$(call Device/linksys,WRT1900ACv2 (Cobra))
|
||||
DEVICE_DTS := armada-385-linksys-cobra
|
||||
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
|
||||
SUPPORTED_DEVICES := armada-385-linksys-cobra linksys,cobra
|
||||
endef
|
||||
TARGET_DEVICES += linksys_wrt1900acv2
|
||||
|
||||
define Device/linksys_wrt3200acm
|
||||
$(call Device/linksys,WRT3200ACM (Rango))
|
||||
DEVICE_DTS := armada-385-linksys-rango
|
||||
DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
|
||||
SUPPORTED_DEVICES := armada-385-linksys-rango linksys,rango
|
||||
endef
|
||||
TARGET_DEVICES += linksys_wrt3200acm
|
||||
|
||||
define Device/linksys_wrt1900acs
|
||||
$(call Device/linksys,WRT1900ACS (Shelby))
|
||||
DEVICE_DTS := armada-385-linksys-shelby
|
||||
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
|
||||
SUPPORTED_DEVICES := armada-385-linksys-shelby linksys,shelby
|
||||
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
|
||||
KERNEL_SIZE := 3072k
|
||||
KERNEL := kernel-bin | append-dtb
|
||||
SUPPORTED_DEVICES := armada-385-linksys-venom linksys,venom
|
||||
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
|
||||
KERNEL_SIZE := 3072k
|
||||
SUPPORTED_DEVICES := armada-xp-linksys-mamba linksys,mamba
|
||||
endef
|
||||
TARGET_DEVICES += linksys_wrt1900ac
|
||||
|
||||
define Device/plathome_openblocks-ax3-4
|
||||
DEVICE_DTS := armada-xp-openblocks-ax3-4
|
||||
SUPPORTED_DEVICES += openblocks-ax3-4
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 1
|
||||
IMAGES += factory.img
|
||||
IMAGE/factory.img := append-kernel | pad-to $$(BLOCKSIZE) | append-ubi
|
||||
DEVICE_TITLE := Plat'Home OpenBlocks AX3
|
||||
endef
|
||||
TARGET_DEVICES += plathome_openblocks-ax3-4
|
||||
|
||||
define Device/marvell_a385-db-ap
|
||||
$(Device/NAND-256K)
|
||||
DEVICE_DTS := armada-385-db-ap
|
||||
IMAGES += factory.img
|
||||
KERNEL_SIZE := 8192k
|
||||
DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
|
||||
SUPPORTED_DEVICES += armada-385-db-ap
|
||||
endef
|
||||
TARGET_DEVICES += marvell_a385-db-ap
|
||||
|
||||
define Device/marvell_a370-db
|
||||
$(Device/NAND-512K)
|
||||
DEVICE_TITLE := Marvell Armada 370 DB (DB-88F6710-BP-DDR3)
|
||||
DEVICE_DTS := armada-370-db
|
||||
SUPPORTED_DEVICES += armada-370-db
|
||||
endef
|
||||
TARGET_DEVICES += marvell_a370-db
|
||||
|
||||
define Device/marvell_a370-rd
|
||||
$(Device/NAND-512K)
|
||||
DEVICE_TITLE := Marvell Armada 370 RD (RD-88F6710-A1)
|
||||
DEVICE_DTS := armada-370-rd
|
||||
SUPPORTED_DEVICES += armada-370-rd
|
||||
endef
|
||||
TARGET_DEVICES += marvell_a370-rd
|
||||
|
||||
define Device/marvell_axp-db
|
||||
$(Device/NAND-512K)
|
||||
DEVICE_TITLE := Marvell Armada XP DB (DB-78460-BP)
|
||||
DEVICE_DTS := armada-xp-db
|
||||
SUPPORTED_DEVICES += armada-xp-db
|
||||
endef
|
||||
TARGET_DEVICES += marvell_axp-db
|
||||
|
||||
define Device/marvell_axp-gp
|
||||
$(Device/NAND-512K)
|
||||
DEVICE_TITLE := Marvell Armada XP GP (DB-MV784MP-GP)
|
||||
DEVICE_DTS := armada-xp-gp
|
||||
SUPPORTED_DEVICES += armada-xp-gp
|
||||
endef
|
||||
TARGET_DEVICES += marvell_axp-gp
|
||||
|
||||
define Device/marvell_a388-rd
|
||||
DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
|
||||
DEVICE_DTS := armada-388-rd
|
||||
IMAGES := firmware.bin
|
||||
IMAGE/firmware.bin := append-kernel | pad-to 256k | append-rootfs | pad-rootfs
|
||||
SUPPORTED_DEVICES := armada-388-rd marvell,a385-rd
|
||||
endef
|
||||
TARGET_DEVICES += marvell_a388-rd
|
||||
|
||||
define Device/solidrun_clearfog-pro-a1
|
||||
KERNEL_INSTALL := 1
|
||||
KERNEL := kernel-bin
|
||||
DEVICE_TITLE := SolidRun ClearFog Pro
|
||||
DEVICE_PACKAGES := mkf2fs e2fsprogs partx-utils swconfig
|
||||
IMAGES := sdcard.img.gz
|
||||
IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
||||
DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
|
||||
SUPPORTED_DEVICES += armada-388-clearfog armada-388-clearfog-pro
|
||||
UBOOT := clearfog-u-boot-spl.kwb
|
||||
BOOT_SCRIPT := clearfog
|
||||
endef
|
||||
TARGET_DEVICES += solidrun_clearfog-pro-a1
|
||||
|
||||
define Device/solidrun_clearfog-base-a1
|
||||
KERNEL_INSTALL := 1
|
||||
KERNEL := kernel-bin
|
||||
DEVICE_TITLE := SolidRun ClearFog Base
|
||||
DEVICE_PACKAGES := mkf2fs e2fsprogs partx-utils
|
||||
IMAGES := sdcard.img.gz
|
||||
IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
|
||||
DEVICE_DTS := armada-388-clearfog-base armada-388-clearfog-pro
|
||||
SUPPORTED_DEVICES += armada-388-clearfog-base
|
||||
UBOOT := clearfog-u-boot-spl.kwb
|
||||
BOOT_SCRIPT := clearfog
|
||||
endef
|
||||
TARGET_DEVICES += solidrun_clearfog-base-a1
|
||||
|
||||
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/cznic_turris-omnia
|
||||
KERNEL_INSTALL := 1
|
||||
KERNEL := kernel-bin
|
||||
DEVICE_DTS := armada-385-turris-omnia
|
||||
KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
|
||||
DEVICE_TITLE := Turris Omnia
|
||||
DEVICE_PACKAGES := \
|
||||
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
|
||||
wpad-basic kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
|
||||
partx-utils kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
|
||||
IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz
|
||||
IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
|
||||
IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
|
||||
IMAGE_NAME = $$(2)
|
||||
SUPPORTED_DEVICES += armada-385-turris-omnia
|
||||
BOOT_SCRIPT := turris-omnia
|
||||
endef
|
||||
TARGET_DEVICES += cznic_turris-omnia
|
||||
|
||||
endif
|
||||
34
target/linux/mvebu/image/espressobin.bootscript
Normal file
34
target/linux/mvebu/image/espressobin.bootscript
Normal file
@@ -0,0 +1,34 @@
|
||||
# Bootscript for Globalscale ESPRESSOBin Board
|
||||
|
||||
# Set distro variables if necessary for compability with downstream firmware
|
||||
if test -z "${kernel_addr_r}"; then
|
||||
setenv kernel_addr_r 0x7000000
|
||||
fi
|
||||
|
||||
if test -z "${fdt_add_r}"; then
|
||||
setenv fdt_addr_r 0x6f00000
|
||||
fi
|
||||
|
||||
if test -z "${devtype}"; then
|
||||
setenv devtype mmc
|
||||
fi
|
||||
|
||||
if test -z "${devnum}"; then
|
||||
if mmc dev 0; then
|
||||
setenv devnum 0
|
||||
elif mmc dev 1; then
|
||||
setenv devnum 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# figure out partition uuid to pass to the kernel as root=
|
||||
part uuid ${devtype} ${devnum}:2 uuid
|
||||
|
||||
setenv console "console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000"
|
||||
setenv bootargs "root=PARTUUID=${uuid} rw rootwait ${console}"
|
||||
|
||||
echo "Booting Linux from ${devtype} ${devnum} with args: ${bootargs}"
|
||||
load ${devtype} ${devnum}:1 ${fdt_addr_r} @DTB@.dtb
|
||||
load ${devtype} ${devnum}:1 ${kernel_addr_r} Image
|
||||
|
||||
booti ${kernel_addr_r} - ${fdt_addr_r}
|
||||
84
target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
Executable file
84
target/linux/mvebu/image/gen_mvebu_sdcard_img.sh
Executable 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> <size_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 * 1024 + 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
|
||||
16
target/linux/mvebu/image/generic-arm64.bootscript
Normal file
16
target/linux/mvebu/image/generic-arm64.bootscript
Normal file
@@ -0,0 +1,16 @@
|
||||
setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait"
|
||||
|
||||
if test -n "${console}"; then
|
||||
setenv bootargs "${bootargs} ${console}"
|
||||
fi
|
||||
|
||||
if mmc dev 0; then
|
||||
setenv mmcdev 0
|
||||
elif mmc dev 1; then
|
||||
setenv mmcdev 1
|
||||
fi
|
||||
|
||||
load mmc ${mmcdev}:1 ${fdt_addr} @DTB@.dtb
|
||||
load mmc ${mmcdev}:1 ${kernel_addr} Image
|
||||
|
||||
booti ${kernel_addr} - ${fdt_addr}
|
||||
17
target/linux/mvebu/image/turris-omnia.bootscript
Normal file
17
target/linux/mvebu/image/turris-omnia.bootscript
Normal file
@@ -0,0 +1,17 @@
|
||||
# Determine root device
|
||||
setexpr rootpart ${distro_bootpart} + 1
|
||||
if test ${devtype} = mmc -a ${devnum} = 0; then
|
||||
setenv rootdev /dev/mmcblk0p${rootpart}
|
||||
elif test ${devtype} = scsi -a ${devnum} = 0; then
|
||||
setenv rootdev /dev/sda${rootpart}
|
||||
else
|
||||
# New U-Boot only
|
||||
part uuid ${devtype} ${devnum}:${rootpart} uuid
|
||||
setenv rootdev PARTUUID=${uuid}
|
||||
fi
|
||||
setenv bootargs earlyprintk console=ttyS0,115200 root=${rootdev} rootfstype=auto rootwait
|
||||
|
||||
# Load and boot
|
||||
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} @DTB@.dtb
|
||||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
|
||||
bootz ${kernel_addr_r} - ${fdt_addr_r}
|
||||
Reference in New Issue
Block a user