From patchwork Fri Oct 5 09:58:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 979444 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42RSZv503fz9s4s for ; Fri, 5 Oct 2018 21:44:07 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3F414C21ECF; Fri, 5 Oct 2018 11:43:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4C9FFC21EE0; Fri, 5 Oct 2018 11:42:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7DD5EC21E0B; Fri, 5 Oct 2018 09:58:40 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id 27442C21C2C for ; Fri, 5 Oct 2018 09:58:40 +0000 (UTC) Received: from [79.233.197.3] ([79.233.197.3]) by web-mail.gmx.net (3c-app-gmx-bs19.server.lan [172.19.170.71]) (via HTTP); Fri, 5 Oct 2018 11:58:39 +0200 MIME-Version: 1.0 Message-ID: From: "Frank Wunderlich" To: u-boot@lists.denx.de Date: Fri, 5 Oct 2018 11:58:39 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:bGBhwZ8QiEwuAEWyQGvBagB6WTua9aUqL/JHfsJpQv9ptNajoWTxIEVHWGBb5fVF7OrcB BYfcO3oiecVLJMg5Y5NTls80gl2ZibhcmBFF/DDFEwWeF1v/JIkNcARLvv4XMGniOvHmoIsnYqk4 hxjKfu8JEjlMSnpLtnHzFY5CHNlkjj0W++rIfPC4QGoIANfUcBbvOKUMAOp+BWEmd5suWAuUVMxY PX9jfuQBKX2idPfIvzMeT3ecqFD/uhEbFkiLYX920vl+upG6YTc6FFdH+62jg3C6ci68a26wFkrR DQ= X-UI-Out-Filterresults: notjunk:1; V01:K0:XHL+2VOZg0I=:YSc11tN72QuPE05j9BysVF BqvaMhJxsyRn/TDq4nUz8jOQXaJFTdtQTJ4HPKUCDEJrLjjtzt6xDPY+nGeqgyEKi57t6g50Q pNny80eM8jKfaY4OxE4Q6Hp1+xMcJ1nrNzukDdmDtn+KSPU1sqTvI6Z8Zy96bmjuzWB+r9as8 WZlkxuRR6EB0H/74Ky7IzkgkYf443GSK/i2/gTIzMITc4+MON650glLHV1+Nbym7eeO25eGT6 RnjyQSlQItIJNPw++/sCUP6SeubSJYhIVQVRozdHznhR4siE9Z0fLcA+POz7etOjTskuHu5dA FdWWiWsLus4aRmHuhX2ooZjcEsI2uBMjPcI828Aj+Zi/sGG5rNezKxP8xVp5RHhafMc+KcrSl 7UwJGWXIv/FmMJrO96teVwdupSOAMZYXgnori04qaRTPZyCatubLRTuwMXCyXrtHEGlBLmN8H 2ew78ge9c8rBj/Y3KGC8oAY/6sU5mJtFnpXfNmwqv0YxabqKvsx9 X-Mailman-Approved-At: Fri, 05 Oct 2018 11:42:56 +0000 Subject: [U-Boot] [PATCH] add default-option to bootmenu X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From 6304b2ee2d2e9be47672d3559fee8d879b7328ff Mon Sep 17 00:00:00 2001 From: Frank Wunderlich Date: Fri, 5 Oct 2018 11:41:59 +0200 Subject: [PATCH] add default-option to bootmenu with this patch the selected Entry in bootmenu can be set by environment-var bootmenu_default= Signed-off-by: Frank Wunderlich Signed-off-by: Frank Wunderlich ---  cmd/bootmenu.c   |   5 +++++  files/u-boot.bin | Bin 278424 -> 278480 bytes  uEnv.txt         |   2 ++  3 files changed, 7 insertions(+) diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 21f353ffd3..979ac4a638 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -253,6 +253,7 @@ static struct bootmenu_data *bootmenu_create(int delay)           int len;         char *sep; +       char *default_str;         struct bootmenu_entry *entry;           menu = malloc(sizeof(struct bootmenu_data)); @@ -263,6 +264,10 @@ static struct bootmenu_data *bootmenu_create(int delay)         menu->active = 0;         menu->first = NULL;   +       default_str = env_get("bootmenu_default"); +       if (default_str) +               menu->active = (int)simple_strtol(default_str, NULL, 10); +         while ((option = bootmenu_getoption(i))) {                 sep = strchr(option, '=');                 if (!sep) {