From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 945DAC4338F for ; Thu, 19 Aug 2021 03:51:33 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 200EF610CB for ; Thu, 19 Aug 2021 03:51:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 200EF610CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2B4568325E; Thu, 19 Aug 2021 05:48:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FIgfCvHj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 587C383151; Thu, 19 Aug 2021 05:46:56 +0200 (CEST) Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0805C8314F for ; Thu, 19 Aug 2021 05:46:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x236.google.com with SMTP id p2so3824553oif.1 for ; Wed, 18 Aug 2021 20:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xdZfGBmWSDwzwWB7N6I1dvS0IqZp8RzmTwP5hJW1LWU=; b=FIgfCvHjOuLCuDWCtV8Ea+J+BmCWsZzrodRXOPG+P6UsOCf3NuBvC1FgPOFtFUJ30+ CLwDGlZpoz3OHM0OkwDkwf9QzuxpldTt+ZLQmRYdtG5ZSXVDV0yvr1qySljmn40wWl5R 5m5b+ORIeAoCfjOuRTQocWKjKdvQqwEM1ni64= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xdZfGBmWSDwzwWB7N6I1dvS0IqZp8RzmTwP5hJW1LWU=; b=fQc7g1i6wId8Ee/63RaznFMQSJ4dgaQRGu5dLpNsy4FD7ctG3IarTAYrHRwl5x8VhW 1uzJ4zx5lKnSrEMuQ+QwoW/88A/fvpK7pZ/ye1PldRxA0jmdHuozaGMeMiki4Ua2FGyg +Qid6WgJPf8gZze8b7zEyYi1cp5pPZ3KhLzJiGZWXFtfO6+LjKjuXFt6pqgIHxqsjh6G 8SEzoMnme6siLktdbh9GrO9jnXSTxKYzb2/+p9XbtfImlNjbNZAWHqM7PhIMIaPqzRkX L20rDeAP+nIw3V2CsJ50lyCvokgsXc1muw3jyTK+uPmqpbwmuIKu49izBL8rzME0yqiq iuXg== X-Gm-Message-State: AOAM531h/peLlLmwXlvm0epq4P3KXWeI+NZlrTKiDspYuEKP0XsGRGRk szxty2vkH63MfuP/N2OXVqIjZ2ui0Gxpvw== X-Google-Smtp-Source: ABdhPJzS0i10dF+Wpp6aWwc8uj3ei7YwGq+pukXGwqBTBCCZFNlyj47DPz8JyBZwQhcH97SaEym2Xg== X-Received: by 2002:a05:6808:1490:: with SMTP id e16mr1182296oiw.91.1629344797284; Wed, 18 Aug 2021 20:46:37 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id q3sm370025ooa.13.2021.08.18.20.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 20:46:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Steffen Jaeckel , Michal Simek , Tom Rini , Dennis Gilmore , Daniel Schwierzeck , Lukas Auer , Simon Glass Subject: [PATCH 23/28] bootmethod: Add tests for bootmethod and bootflow Date: Wed, 18 Aug 2021 21:45:56 -0600 Message-Id: <20210818214547.23.I936bf6fe715bd1feac569478aded46ab75579148@changeid> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog In-Reply-To: <20210819034601.1618773-1-sjg@chromium.org> References: <20210819034601.1618773-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Add a set of combined tests for these two commands. Expand the sandbox console-recording limit so that these can work. These tests rely on a filesystem script which is not yet added to the Python tests. It is included here as a shell script. Signed-off-by: Simon Glass --- MAINTAINERS | 1 + configs/sandbox_defconfig | 2 +- include/test/suites.h | 2 + test/Makefile | 1 + test/boot/Makefile | 5 + test/boot/bootmethod.c | 271 ++++++++++++++++++++++++++++++++++++++ test/cmd_ut.c | 4 + try.sh | 131 ++++++++++++++++++ 8 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 test/boot/Makefile create mode 100644 test/boot/bootmethod.c create mode 100755 try.sh diff --git a/MAINTAINERS b/MAINTAINERS index 367193358b7..2f74f7dbb19 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -639,6 +639,7 @@ F: cmd/bootflow.c F: cmd/bootmethod.c F: include/bootmethod.h F: include/distro.h +F: test/boot/bootmethod.c BTRFS M: Marek Behun diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 952d430304c..31a8d6a1d90 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -26,7 +26,7 @@ CONFIG_AUTOBOOT_NEVER_TIMEOUT=y CONFIG_AUTOBOOT_STOP_STR_ENABLE=y CONFIG_AUTOBOOT_STOP_STR_CRYPT="$5$rounds=640000$HrpE65IkB8CM5nCL$BKT3QdF98Bo8fJpTr9tjZLZQyzqPASBY20xuK5Rent9" CONFIG_CONSOLE_RECORD=y -CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 +CONFIG_CONSOLE_RECORD_OUT_SIZE=0x2000 CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_LOG=y CONFIG_DISPLAY_BOARDINFO_LATE=y diff --git a/include/test/suites.h b/include/test/suites.h index d35cd83a4eb..c36aa568e78 100644 --- a/include/test/suites.h +++ b/include/test/suites.h @@ -29,6 +29,8 @@ int cmd_ut_category(const char *name, const char *prefix, int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +int do_ut_bootmethod(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]); int do_ut_bloblist(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); int do_ut_common(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); diff --git a/test/Makefile b/test/Makefile index b3b2902e2e7..abd605a4351 100644 --- a/test/Makefile +++ b/test/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_UT_TIME) += time_ut.o obj-y += ut.o ifeq ($(CONFIG_SPL_BUILD),) +obj-$(CONFIG_UNIT_TEST) += boot/ obj-$(CONFIG_UNIT_TEST) += common/ obj-$(CONFIG_UNIT_TEST) += lib/ obj-y += log/ diff --git a/test/boot/Makefile b/test/boot/Makefile new file mode 100644 index 00000000000..bb1599b9c0d --- /dev/null +++ b/test/boot/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2021 Google LLC + +obj-$(CONFIG_BOOTMETHOD) += bootmethod.o diff --git a/test/boot/bootmethod.c b/test/boot/bootmethod.c new file mode 100644 index 00000000000..4467625c0fd --- /dev/null +++ b/test/boot/bootmethod.c @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021 Google LLC + * Written by Simon Glass + */ + +#include +#include +#include +#include +#include + +/* Declare a new bootmethod test */ +#define BOOTMETHOD_TEST(_name, _flags) \ + UNIT_TEST(_name, _flags, bootmethod_test) + +/* Check 'bootmethod list' command */ +static int bootmethod_test_cmd_list(struct unit_test_state *uts) +{ + int probed; + + console_record_reset_enable(); + for (probed = 0; probed < 2; probed++) { + int probe_ch = probed ? '+' : ' '; + + ut_assertok(run_command(probed ? "bootmethod list -p" : + "bootmethod list", 0)); + ut_assert_nextline("Seq Probed Status Uclass Name"); + ut_assert_nextlinen("---"); + ut_assert_nextline("%3x [ %c ] %6s %-8s %s", 0, probe_ch, "OK", + "mmc", "mmc2.bootmethod"); + ut_assert_nextline("%3x [ %c ] %6s %-8s %s", 1, probe_ch, "OK", + "mmc", "mmc1.bootmethod"); + ut_assert_nextline("%3x [ %c ] %6s %-8s %s", 2, probe_ch, "OK", + "mmc", "mmc0.bootmethod"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(3 devices)"); + ut_assert_console_end(); + } + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_list, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootmethod select' and 'info' commands */ +static int bootmethod_test_cmd_select(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_asserteq(1, run_command("bootmethod info", 0)); + ut_assert_nextlinen("Please use"); + ut_assert_console_end(); + + ut_assertok(run_command("bootmethod select 0", 0)); + ut_assert_console_end(); + + ut_assertok(run_command("bootmethod info", 0)); + ut_assert_nextline("Name: mmc2.bootmethod"); + ut_assert_nextline("Uclass: mmc"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_select, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow scan/list' commands */ +static int bootmethod_test_cmd_bootflow(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootmethod select 2", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow scan -l", 0)); + ut_assert_nextline("Scanning for bootflows in bootmethod 'mmc0.bootmethod'"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(21 bootflows, 1 valid)"); + ut_assert_console_end(); + + ut_assertok(run_command("bootflow list", 0)); + ut_assert_nextline("Showing bootflows for bootmethod 'mmc0.bootmethod'"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(1 bootflow, 1 valid)"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow scan/list' commands using all bootmethods */ +static int bootmethod_test_cmd_bootflow_glob(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootflow scan -l", 0)); + ut_assert_nextline("Scanning for bootflows in all bootmethods"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline("Scanning bootmethod 'mmc2.bootmethod':"); + ut_assert_nextline("Scanning bootmethod 'mmc1.bootmethod':"); + ut_assert_nextline("Scanning bootmethod 'mmc0.bootmethod':"); + ut_assert_nextline(" 0 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_nextline("No more bootmethods"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(1 bootflow, 1 valid)"); + ut_assert_console_end(); + + ut_assertok(run_command("bootflow list", 0)); + ut_assert_nextline("Showing all bootflows"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(1 bootflow, 1 valid)"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow_glob, + UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow scan -e' */ +static int bootmethod_test_cmd_bootflow_scan_e(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootflow scan -ale", 0)); + ut_assert_nextline("Scanning for bootflows in all bootmethods"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline("Scanning bootmethod 'mmc2.bootmethod':"); + ut_assert_nextline(" 0 distro-boot media mmc 0 mmc2.bootmethod.part_1 "); + ut_assert_nextline(" ** No partition found, err=-93"); + ut_assert_nextline(" 1 distro-boot media mmc 0 mmc2.bootmethod.part_2 "); + + ut_assert_skip_to_line("Scanning bootmethod 'mmc1.bootmethod':"); + ut_assert_skip_to_line("Scanning bootmethod 'mmc0.bootmethod':"); + ut_assert_nextline(" 28 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_nextline(" 29 distro-boot media mmc 0 mmc0.bootmethod.part_2 "); + ut_assert_skip_to_line(" 3b distro-boot media mmc 0 mmc0.bootmethod.part_14 "); + ut_assert_nextline(" ** No partition found, err=-2"); + ut_assert_nextline("No more bootmethods"); + ut_assert_nextlinen("---"); + ut_assert_nextline("(60 bootflows, 1 valid)"); + ut_assert_console_end(); + + ut_assertok(run_command("bootflow list", 0)); + ut_assert_nextline("Showing all bootflows"); + ut_assert_nextline("Seq Type State Uclass Part Name Filename"); + ut_assert_nextlinen("---"); + ut_assert_nextline(" 0 distro-boot media mmc 0 mmc2.bootmethod.part_1 "); + ut_assert_skip_to_line(" 28 distro-boot loaded mmc 1 mmc0.bootmethod.part_1 extlinux/extlinux.conf"); + ut_assert_skip_to_line(" 3b distro-boot media mmc 0 mmc0.bootmethod.part_14 "); + ut_assert_nextlinen("---"); + ut_assert_nextline("(60 bootflows, 1 valid)"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow_scan_e, + UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow info' */ +static int bootmethod_test_cmd_bootflow_info(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootmethod select 2", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow scan", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow select 0", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow info", 0)); + ut_assert_nextline("Name: mmc0.bootmethod.part_1"); + ut_assert_nextline("Device: mmc0.bootmethod"); + ut_assert_nextline("Block dev: mmc0.blk"); + ut_assert_nextline("Sequence: 0"); + ut_assert_nextline("Type: distro-boot"); + ut_assert_nextline("State: loaded"); + ut_assert_nextline("Partition: 1"); + ut_assert_nextline("Subdir: (none)"); + ut_assert_nextline("Filename: extlinux/extlinux.conf"); + ut_assert_nextlinen("Buffer: "); + ut_assert_nextline("Size: 237 (567 bytes)"); + ut_assert_nextline("Error: 0"); + ut_assert_console_end(); + + ut_assertok(run_command("bootflow info -d", 0)); + ut_assert_nextline("Name: mmc0.bootmethod.part_1"); + ut_assert_skip_to_line("Error: 0"); + ut_assert_nextline("Contents:"); + ut_assert_nextline("%s", ""); + ut_assert_nextline("# extlinux.conf generated by appliance-creator"); + ut_assert_skip_to_line("initrd /initramfs-5.3.7-301.fc31.armv7hl.img"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow_info, + UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow scan -b' to boot the first available bootmethod */ +static int bootmethod_test_cmd_bootflow_scan_boot(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootflow scan -b", 0)); + ut_assert_nextline("** Booting bootflow 'mmc0.bootmethod.part_1'"); + ut_assert_nextline("Ignoring unknown command: ui"); + + /* + * We expect it to get through to boot although sandbox always returns + * -EFAULT as it cannot actually boot the kernel + */ + ut_assert_skip_to_line("sandbox: continuing, as we cannot run Linux"); + ut_assert_nextline("Boot failed (err=-14)"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow_scan_boot, + UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check 'bootflow boot' to boot a selected bootflow */ +static int bootmethod_test_cmd_bootflow_boot(struct unit_test_state *uts) +{ + console_record_reset_enable(); + ut_assertok(run_command("bootmethod select 2", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow scan", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow select 0", 0)); + ut_assert_console_end(); + ut_assertok(run_command("bootflow boot", 0)); + ut_assert_nextline("** Booting bootflow 'mmc0.bootmethod.part_1'"); + ut_assert_nextline("Ignoring unknown command: ui"); + + /* + * We expect it to get through to boot although sandbox always returns + * -EFAULT as it cannot actually boot the kernel + */ + ut_assert_skip_to_line("sandbox: continuing, as we cannot run Linux"); + ut_assert_nextline("Boot failed (err=-14)"); + ut_assert_console_end(); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_cmd_bootflow_boot, + UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +/* Check we can get a bootmethod */ +static int bootmethod_test_get(struct unit_test_state *uts) +{ + struct bootmethod_iter iter; + struct bootflow bflow; + + ut_assertok(bootmethod_scan_first_bootflow(&iter, 0, &bflow)); + + return 0; +} +BOOTMETHOD_TEST(bootmethod_test_get, UT_TESTF_DM | UT_TESTF_SCAN_FDT); + +int do_ut_bootmethod(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct unit_test *tests = UNIT_TEST_SUITE_START(bootmethod_test); + const int n_ents = UNIT_TEST_SUITE_COUNT(bootmethod_test); + + return cmd_ut_category("bootmethod", "bootmethod_test_", + tests, n_ents, argc, argv); +} diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 90b260f72d6..c71f5575a04 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -28,6 +28,10 @@ int cmd_ut_category(const char *name, const char *prefix, static struct cmd_tbl cmd_ut_sub[] = { U_BOOT_CMD_MKENT(all, CONFIG_SYS_MAXARGS, 1, do_ut_all, "", ""), +#ifdef CONFIG_BOOTMETHOD + U_BOOT_CMD_MKENT(bootmethod, CONFIG_SYS_MAXARGS, 1, do_ut_bootmethod, + "", ""), +#endif U_BOOT_CMD_MKENT(common, CONFIG_SYS_MAXARGS, 1, do_ut_common, "", ""), #if defined(CONFIG_UT_DM) U_BOOT_CMD_MKENT(dm, CONFIG_SYS_MAXARGS, 1, do_ut_dm, "", ""), diff --git a/try.sh b/try.sh new file mode 100755 index 00000000000..14519c3144c --- /dev/null +++ b/try.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +set -e + +file=mmc.img +mnt=/mnt/x +fat=/mnt/y +dstdir=$fat/extlinux + +vmlinux=vmlinuz-5.3.7-301.fc31.armv7hl +initrd=initramfs-5.3.7-301.fc31.armv7hl.img +dtb=dtb-5.3.7-301.fc31.armv7hl/sandbox.dtb + +old() { + mkfs.vfat $file + sudo mount -o loop $file $mnt + #sudo cp /tmp/b/efi-x86_payload64/u-boot-payload.efi /mnt/x + #sudo cp /tmp/efi64/startup.nsh $mnt + #sudo cp /tmp/efi64/vmlinuz $mnt + echo >>/tmp/extlinux.conf <