Skip to content
Open
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
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ language: c

addons:
apt:
sources:
- sourceline: 'ppa:team-gcc-arm-embedded/ppa'
packages:
- make
- gcc-arm-embedded
- qemu-user-static

script:
- sudo make image
- sudo make

20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# Define sub directory name of build and download
BUILD_DIR_NAME := build
DL_DIR_NAME := dl
OUTPUT_DIR_NAME := output

# Top directory, build directory and download directory
export TOP_DIR := $(shell pwd)
Expand All @@ -34,6 +35,10 @@ export DL_DIR := $(shell mkdir -p $(TOP_DIR)/$(DL_DIR_NAME) && \
cd $(TOP_DIR)/$(DL_DIR_NAME) && \
pwd)

export OUTPUT_DIR := $(shell mkdir -p $(BUILD_DIR)/$(OUTPUT_DIR_NAME) && \
cd $(BUILD_DIR)/$(OUTPUT_DIR_NAME) && \
pwd)

# Clean targets
export CLEAN_TARGETS := $(BUILD_DIR)

Expand All @@ -46,10 +51,7 @@ export DISTCLEAN_TARGETS := $(DOWNLOAD_DIR)
##############################################################################


all: button

button:
@$(MAKE) -C package/hw_button
all: image

.PHONY: help install image clean distclean

Expand All @@ -62,15 +64,15 @@ help:
@echo " clean - Clean build file, but leave download files"
@echo " distclean - Clean all build process generated files"

install:
echo

IMAGE_DIR_NAME := image
IMAGE_DIR := ${BUILD_DIR}/${IMAGE_DIR_NAME}

image:
image: ubootenv
$(TOP_DIR)/scripts/gen_image.sh $(TOP_DIR) $(DL_DIR) $(BUILD_DIR) \
$(IMAGE_DIR)
$(OUTPUT_DIR) $(IMAGE_DIR)

ubootenv:
$(MAKE) -C lib/ubootenv

clean:
-rm -rf $(CLEAN_TARGETS)
Expand Down
14 changes: 14 additions & 0 deletions lib/ubootenv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2018 Hunan ChenHan Information Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0
#
# @author Ding Tao <miyatsu@qq.com>
#
# @date 3rd Dec, 2018
#
# @brief This Makefile is use apt to install openssh


all:
./install.sh $(BUILD_DIR) $(OUTPUT_DIR)

52 changes: 52 additions & 0 deletions lib/ubootenv/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

# Copyright (c) 2018 Hunan ChenHan Information Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0
#
# @author Ding Tao <miyatsu@qq.com>
#
# @date 3rd Dec, 2018
#
# @brief This shell script will install openssh via apt and modify some
# configurations like allow password login.

BUILD_DIR=$1
OUTPUT_DIR=$2

# Get the u-boot code
if [ -e ${BUILD_DIR}/u-boot ]
then
rm -rf ${BUILD_DIR}/u-boot
fi
git clone --depth=50 -b u-boot-2018.03-armada-18.09 \
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell \
${BUILD_DIR}/u-boot
if [ $? -ne 0 ]
then
echo "'git clone' exit none zero!"
exit 1
fi

export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64

# Cd to source code and compile it
cd ${BUILD_DIR}/u-boot
make mvebu_espressobin-88f3720_defconfig
make env

# Move shared library to rootfs
if [ ! -e ${BUILD_DIR}/u-boot/tools/env/lib.a ]
then
echo "'make' exit none zero!"
exit 1
fi

if [ ! -d ${OUTPUT_DIR}/usr/local/lib ]
then
mkdir -p ${OUTPUT_DIR}/usr/local/lib
fi
cp ${BUILD_DIR}/u-boot/tools/env/lib.a \
${OUTPUT_DIR}/usr/local/lib/libubootenv.a

6 changes: 5 additions & 1 deletion scripts/gen_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ISO_NAME=ubuntu-18.04.1-server-arm64.iso
TOP_DIR=${1}
DL_DIR=${2}
BUILD_DIR=${3}
IMAGE_DIR=${4}
OUTPUT_DIR=${4}
IMAGE_DIR=${5}

ISO_URL=${DOWNLOAD_URL}/${RELEASE_VERSION}/release/${ISO_NAME}

Expand Down Expand Up @@ -63,6 +64,9 @@ build_alter() {
}

build_append() {
# Append output/* files
cp -R ${OUTPUT_DIR}/* ${BUILD_DIR}/rootfs

# Append etc files
cp -R ${TOP_DIR}/etc/* ${BUILD_DIR}/rootfs/etc
}
Expand Down