diff --git a/.travis.yml b/.travis.yml index e76bfac..53770ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Makefile b/Makefile index 7886ff1..aa2b446 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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) @@ -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 @@ -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) diff --git a/lib/ubootenv/Makefile b/lib/ubootenv/Makefile new file mode 100644 index 0000000..a00bdfe --- /dev/null +++ b/lib/ubootenv/Makefile @@ -0,0 +1,14 @@ +# Copyright (c) 2018 Hunan ChenHan Information Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0 +# +# @author Ding Tao +# +# @date 3rd Dec, 2018 +# +# @brief This Makefile is use apt to install openssh + + +all: + ./install.sh $(BUILD_DIR) $(OUTPUT_DIR) + diff --git a/lib/ubootenv/install.sh b/lib/ubootenv/install.sh new file mode 100755 index 0000000..d24c8b9 --- /dev/null +++ b/lib/ubootenv/install.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# Copyright (c) 2018 Hunan ChenHan Information Technology Co., Ltd. +# +# SPDX-License-Identifier: GPL-3.0 +# +# @author Ding Tao +# +# @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 + diff --git a/scripts/gen_image.sh b/scripts/gen_image.sh index a040326..e556ce6 100755 --- a/scripts/gen_image.sh +++ b/scripts/gen_image.sh @@ -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} @@ -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 }