-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05b3bb0
commit bcb0ba7
Showing
14 changed files
with
18,134 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# | ||
# Copyright (C) 2013-2016 OpenWrt.org | ||
# Copyright (C) 2017 Yousong Zhou | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
include $(INCLUDE_DIR)/kernel.mk | ||
|
||
PKG_SOURCE_PROTO:=git | ||
PKG_SOURCE_URL=https://github.com/orangepi-xunlong/u-boot-orangepi | ||
PKG_SOURCE_DATE:=2017-09 | ||
PKG_SOURCE_VERSION:=6fe17fac388aad17490cf386578b7532975e567f | ||
PKG_MIRROR_HASH:=4345d99b0772eba496f24ede9e973d34b72b8239309a75f28acca4fd428bd59e | ||
|
||
include $(INCLUDE_DIR)/u-boot.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define U-Boot/Default | ||
BUILD_TARGET:=sunxi | ||
UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin | ||
UENV:=default | ||
HIDDEN:=1 | ||
endef | ||
|
||
define U-Boot/orangepi_zero3 | ||
BUILD_SUBTARGET:=cortexa53 | ||
NAME:=Xunlong Orange Pi Zero3 | ||
BUILD_DEVICES:=xunlong_orangepi-zero3 | ||
DEPENDS:=+PACKAGE_u-boot-orangepi_zero3:trusted-firmware-a-sunxi-h616 | ||
UENV:=h616 | ||
ATF:=h616 | ||
endef | ||
|
||
UBOOT_TARGETS := \ | ||
orangepi_zero3 | ||
|
||
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes | ||
|
||
UBOOT_MAKE_FLAGS += \ | ||
BL31=$(STAGING_DIR_IMAGE)/bl31_sunxi-$(ATF).bin SCP=/dev/null | ||
|
||
define Build/InstallDev | ||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE) | ||
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin | ||
mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ | ||
$(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr | ||
endef | ||
|
||
define Package/u-boot/install/default | ||
endef | ||
|
||
$(eval $(call BuildPackage/U-Boot)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
setenv fdt_high ffffffff | ||
setenv mmc_rootpart 2 | ||
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid | ||
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage | ||
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb | ||
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait | ||
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r | ||
run uenvcmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
setenv mmc_rootpart 2 | ||
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid | ||
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage | ||
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb | ||
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait | ||
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r | ||
run uenvcmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=22 | ||
start() { | ||
rm -rf /etc/rc.d/S22resize-rootfs | ||
#service resize-rootfs disable | ||
/usr/bin/resize-rootfs.sh | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../init.d/resize-rootfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
FDISK=$(which fdisk) || { echo "E: You must have fdisk" && exit 1; } | ||
LOSETUP=$(which losetup) || { echo "E: You must have losetup" && exit 1; } | ||
roottype=$(findmnt -n -o SOURCE / -o FSTYPE) | ||
case ${roottype} in | ||
overlay) | ||
FSCKEXT4=$(which fsck.ext4) || { echo "E: You must have fsck.ext4" && exit 1; } | ||
RESIZE2FS=$(which resize2fs) || { echo "E: You must have resize2fs" && exit 1; } | ||
rootsource=$(findmnt -n -o SOURCE /rom) # i.e. /dev/mmcblk0p2 | ||
rootdevice=${rootsource%p*} # i.e. /dev/mmcblk0 | ||
partitions=${rootsource##*p} | ||
|
||
# Resizing partitions | ||
lastsector=$(${FDISK} -l ${rootdevice} |grep "Disk ${rootdevice}" |awk '{print $7}') | ||
lastsector=$(( $lastsector - 1 )) | ||
startfrom=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $2}') | ||
partend=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $3}') | ||
[[ $lastsector -eq $partend ]] && exit 0 | ||
(echo d; echo $partitions; echo n; echo p; echo ; echo $startfrom; echo $lastsector ; echo w;) | fdisk $rootdevice | ||
# Start resizing filesystem | ||
LOOP="$(losetup -n -O NAME | sort | sed -n -e "1p")" | ||
ROOT="$(losetup -n -O BACK-FILE ${LOOP} | sed -e "s|^|/dev|")" | ||
OFFS="$(losetup -n -O OFFSET ${LOOP})" | ||
LOOP="$(losetup -f)" | ||
${LOSETUP} -o ${OFFS} ${LOOP} ${ROOT} | ||
${FSCKEXT4} -y ${LOOP} | ||
${RESIZE2FS} ${LOOP} | ||
reboot | ||
;; | ||
ext4) | ||
FSCKEXT4=$(which fsck.ext4) || { echo "E: You must have fsck.ext4" && exit 1; } | ||
RESIZE2FS=$(which resize2fs) || { echo "E: You must have resize2fs" && exit 1; } | ||
rootsource=$(findmnt -n -o SOURCE / | sed 's~\[.*\]~~') # i.e. /dev/mmcblk0p2 | ||
rootdevice=${rootsource%p*} # i.e. /dev/mmcblk0 | ||
partitions=${rootsource##*p} | ||
|
||
# Resizing partitions | ||
lastsector=$(${FDISK} -l ${rootdevice} |grep "Disk ${rootdevice}" |awk '{print $7}') | ||
lastsector=$(( $lastsector - 1 )) | ||
startfrom=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $2}') | ||
partend=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $3}') | ||
[[ $lastsector -eq $partend ]] && exit 0 | ||
(echo d; echo $partitions; echo n; echo p; echo ; echo $startfrom; echo $lastsector ; echo w;) | fdisk $rootdevice | ||
|
||
# Start resizing filesystem | ||
LOOP="$(losetup -f)" | ||
${LOSETUP} ${LOOP} ${rootsource} | ||
${FSCKEXT4} -y ${LOOP} | ||
${RESIZE2FS} ${LOOP} | ||
reboot | ||
;; | ||
esac | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -522,3 +522,4 @@ CONFIG_XZ_DEC_ARM=y | |
CONFIG_XZ_DEC_BCJ=y | ||
CONFIG_ZBOOT_ROM_BSS=0 | ||
CONFIG_ZBOOT_ROM_TEXT=0 | ||
CONFIG_MOTORCOMM_PHY=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.