From patchwork Sun Oct 13 21:21:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1175894 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="egTuGnN4"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rvl83pHQz9s7T for ; Mon, 14 Oct 2019 08:21:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2448585E8D; Sun, 13 Oct 2019 21:21:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id At4JtDsTM89I; Sun, 13 Oct 2019 21:21:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 83E7185DFC; Sun, 13 Oct 2019 21:21:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id ABE3A1BF326 for ; Sun, 13 Oct 2019 21:21:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A82342151F for ; Sun, 13 Oct 2019 21:21:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TR70YJysvD2M for ; Sun, 13 Oct 2019 21:21:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by silver.osuosl.org (Postfix) with ESMTPS id 790A3203FA for ; Sun, 13 Oct 2019 21:21:34 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id p14so17368232wro.4 for ; Sun, 13 Oct 2019 14:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nAbf020cKJIanWxdzInsVREmdho1u5PFw/x/avpEMpM=; b=egTuGnN4gmx5UcQgfvFmnbbjmTEGlPWv3lgr4PedGCbzngSBKSp0plB3Dr9g7qqKKL TIzkiCy1zdurkHaCMskJOhSFERg4qBdnhTHZW0mMLNgS3fAicfU97ehWMOKuJLK/mKtZ LXfRW9n2sxau5p9hfgRO+Y9Z+UDZgRJv0B0frIpzuaPSSxbywsZpWeciuQy+7ONT+fnE rxAg4MA63KF59WI5WGSoIKvVWxD974a8eykfPXwihrZEnAMIcHF9AzlYv2aIJpG/xUeF mTgeXGxQb9Fre1ZT9paiVmw73kL10wY+wZ3DNN0nnan7ow0Y1PWwOeza616rGLQPmCk3 T/HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nAbf020cKJIanWxdzInsVREmdho1u5PFw/x/avpEMpM=; b=kpRtYXJ7eSgCvDziQ4ijHVCdtLAoXsr2+LVYmUnbjXgOPtseWi1weji4NYAycPemf/ IgzeTN4qI+CP90njl1G6LqKev8ExT1ir7Ucev6hHA8/3M7czaOmamDdEagnQJcfWWFh/ yt2OMIGdbe+CraVuQ7sG0PSMb6dPIJN/MbUpDg8L3fqrcqAttfYqO8KvVWH3JOUzVZJB dFPcAzKsrw0fm1AWSQ3JNv68HWXYCJViMOgj+SYiP0+sq91oRWVX2RnvC2e11juyBNhn 2tGKbq3Z0+LmIPk1WFvmtass8ujNZIV5uM45UM+/lCsZnET/lTkUWCXRzywj/wpPNUdc +gkw== X-Gm-Message-State: APjAAAUFnXRplSge6lvGmTVNhXHg62QI+nheEzMYI6weOs4/+Ink7Iem rOAMjj9UpW8PQcguCucpA4WrEPjO X-Google-Smtp-Source: APXvYqxsQ9cLN3WCXL36RfXhF1dRhc+54UCsm2zTiNkySQbiP1SxlhliZY7afz5B5HADNbOZnshyFA== X-Received: by 2002:a05:6000:1283:: with SMTP id f3mr21620311wrx.370.1571001692469; Sun, 13 Oct 2019 14:21:32 -0700 (PDT) Received: from localhost.localdomain ([37.162.78.159]) by smtp.gmail.com with ESMTPSA id c4sm17072494wru.31.2019.10.13.14.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2019 14:21:32 -0700 (PDT) From: Angelo Compagnucci X-Google-Original-From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sun, 13 Oct 2019 23:21:28 +0200 Message-Id: <20191013212128.28763-1-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH] configs/licheepi_zero: support both standard and dock variant X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In order to support both the standard and the dock variant, a different dtb must be choosen, else some of the board hardware doesn't work as expected (like the RGB led). This patch configures both the genimage.cfg and the boot.scr with the correct dtb version before assembling the image. Signed-off-by: Angelo Compagnucci --- board/licheepi/genimage.cfg | 1 - board/licheepi/genimage.sh | 51 +++++++++++++++++++++++++++++++++ board/licheepi/readme.txt | 6 ++++ configs/licheepi_zero_defconfig | 6 ++-- 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100755 board/licheepi/genimage.sh diff --git a/board/licheepi/genimage.cfg b/board/licheepi/genimage.cfg index 0d8540f2a0..4faed4de3e 100644 --- a/board/licheepi/genimage.cfg +++ b/board/licheepi/genimage.cfg @@ -2,7 +2,6 @@ image boot.vfat { vfat { files = { "zImage", - "sun8i-v3s-licheepi-zero-dock.dtb", "sun8i-v3s-licheepi-zero.dtb", "boot.scr" } diff --git a/board/licheepi/genimage.sh b/board/licheepi/genimage.sh new file mode 100755 index 0000000000..37a43c87a6 --- /dev/null +++ b/board/licheepi/genimage.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +die() { + cat <&2 +Error: $@ + +Usage: ${0} -c GENIMAGE_CONFIG_FILE +EOF + exit 1 +} + +echo $@ + +# Parse arguments and put into argument list of the script +opts="$(getopt -n "${0##*/}" -o c:d: -- "$@")" || exit $? +eval set -- "$opts" + +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" +GENIMAGE_CFG_TMP="${BUILD_DIR}/genimage.cfg" + +while true ; do + case "$1" in + -c) + GENIMAGE_CFG="${2}"; + shift 2 ;; + -d) + DTB_CFG="${2}"; + shift 2 ;; + --) # Discard all non-option parameters + shift 1; + break ;; + *) + die "unknown option '${1}'" ;; + esac +done + +[ -n "${GENIMAGE_CFG}" ] || die "Missing argument" +[ -n "${DTB_CFG}" ] || die "Missing argument" + +cp "${GENIMAGE_CFG}" "${GENIMAGE_CFG_TMP}" +sed -i "s/sun8i-v3s-licheepi-zero/${DTB_CFG}/g" "${GENIMAGE_CFG_TMP}" +sed -i "s/sun8i-v3s-licheepi-zero/${DTB_CFG}/g" "${BINARIES_DIR}/boot.scr" + +rm -rf "${GENIMAGE_TMP}" + +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG_TMP}" diff --git a/board/licheepi/readme.txt b/board/licheepi/readme.txt index 6b8bf94b45..b687849c37 100644 --- a/board/licheepi/readme.txt +++ b/board/licheepi/readme.txt @@ -12,6 +12,12 @@ Configure Buildroot $ make licheepi_zero_defconfig +Build the dock variant +----------------------- + +In order to have a working dock variant of the board, you need to change +BR2_LINUX_KERNEL_INTREE_DTS_NAME to sun8i-v3s-licheepi-zero-dock. + Build the rootfs ---------------- diff --git a/configs/licheepi_zero_defconfig b/configs/licheepi_zero_defconfig index 8bb21292ca..467aab852f 100644 --- a/configs/licheepi_zero_defconfig +++ b/configs/licheepi_zero_defconfig @@ -11,8 +11,8 @@ BR2_TARGET_GENERIC_HOSTNAME="licheepi-zero" BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the LicheePi Zero" BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y -BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/licheepi/genimage.cfg" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/licheepi/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/licheepi/genimage.cfg -d $(BR2_LINUX_KERNEL_INTREE_DTS_NAME)" # Kernel BR2_LINUX_KERNEL=y @@ -20,7 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.3.5" BR2_LINUX_KERNEL_DEFCONFIG="sunxi" BR2_LINUX_KERNEL_DTS_SUPPORT=y -BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-v3s-licheepi-zero sun8i-v3s-licheepi-zero-dock" +BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-v3s-licheepi-zero" BR2_PACKAGE_LINUX_FIRMWARE=y BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y