From patchwork Mon Nov 22 10:55:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Mioso X-Patchwork-Id: 1558047 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=UUlpetuv; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=fdTcOopZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyQn106YKz9sS8 for ; Mon, 22 Nov 2021 22:59:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=39LZ0HMxRzmLltON/XYbrCRGFVWpgastkwp9NZC9vis=; b=UUlpetuv2nKKfc 6+aWK7iWAZZ9938h9jg5MBRs1Yi/ZSb0jbrqyRWY3OYEXbo1a7RfE40/6adVDzzO1WYQmUFG46sAP 40I6lRDaTzjjAO67Rpm/EH1Dwc+uhZcBNbiKb+Byw9TcOoiUlEBL1+V8FezZjVRfUtK/stABOLaAU P5x56hVCUU6u/7aS9gH+hytK4Fo9ymlQTYN6wItoyTVgS/IRy01at26Y0cKn7lq76OwdEFEKk/Tqw dKBGPCUSt5uWWtQZBjwcI0YAzuBQx/lReen5vZDynRIEsnbnYsKqutTUxgjudZXTA29ZXW3ykByY1 gt3+qEtdsejYgy/hiBtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp7uL-00GBSG-U6; Mon, 22 Nov 2021 11:54:50 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp6zV-00FwI6-4b for openwrt-devel@lists.openwrt.org; Mon, 22 Nov 2021 10:56:06 +0000 Received: by mail-ed1-x536.google.com with SMTP id e3so74916339edu.4 for ; Mon, 22 Nov 2021 02:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IeoqkDQWGZJvXXXQO2ZymWjmyZXr+D+lA8sRuAzFWic=; b=fdTcOopZgvNlP2o6ic4fstx2a2tRo87Wuv8ca5NzGQW++eA7hFmStW+BxZYU1bb2bu c+Jn+0Cl5FtQVpzxMNKevDONbkTfZ/uieiIUFC3BzuUBmyE3TcUW2XZedQYHNeIUrpOl K6yhzWraCJ4ihgqJmL3Sgw+fSR8fdBVfM9XPmQbwN1wIW5ONoxZ6ddVkgcnkvVe2ugJL hmf0ZYAK3E5ASUaV38F5ipjCX82kB0H2ZTzFdncRClhFvjKLYFJMX1pDalSLpYgQUxTi 3PLxvFIxfOOHAsDHNxFjHmNSrfUwZXWO0JG1cRSHi7iH0/Ch98aJpfhbqigMD2aZ0FN0 Ze7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IeoqkDQWGZJvXXXQO2ZymWjmyZXr+D+lA8sRuAzFWic=; b=OlRrcDKeJT0BM523c92QiafLNuZs7TGSfTxUzdmnOGHzNfT7u7DXg7mNHoMwP17J2p I3dKCowH2jum+1rEyh/Xq+w+ICpMsgGwtvw6aLHSUOUhZBjglumBQqtF5dMABqG3N4Hh douDpqnEiAAO0iOzCVvyPQgCT6GfuwvV7NnZXv7979A9PmY33P1Hb5pVs8/bmJMrtT8Z A1TXwyTOKSZRzkNFIiznykCPwrrA4yx6M2XOwa9/jnrAMRRPA7b9804jqV8aljLED2as t+f4itS1ZLfoinfcYpy4CTiHkU3v1Zxl4f8ETa4BlkzcsiWKMsQ9hFQzU8jE75WUSkEm fzSQ== X-Gm-Message-State: AOAM530NTiRRRUY5YplMgDLk9elNEUQQMR7YF6+YlSMTC3wx1F3/8U5d cqhREaBMd+pUwWDywHDmmTzVyBZJ6zE= X-Google-Smtp-Source: ABdhPJwD2AjcXBoqbD20lL3sw2hPlgW+xeBZBO5mvHTIJbsFT2k0LLZPZe1/6m8ArU9sGE+pNZ1IfQ== X-Received: by 2002:a05:6402:2930:: with SMTP id ee48mr65445502edb.295.1637578562434; Mon, 22 Nov 2021 02:56:02 -0800 (PST) Received: from localhost.localdomain (h17-ipv4-77-240-224.mynet.it. [77.240.224.17]) by smtp.gmail.com with ESMTPSA id t20sm3838127edv.81.2021.11.22.02.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 02:56:02 -0800 (PST) From: Enrico Mioso To: OpenWrt Development List Cc: Enrico Mioso , Christian Lamparter , David Bauer Subject: [PATCH] FritzBox-4040-UBOOT: Allow for easier devices recovery Date: Mon, 22 Nov 2021 11:55:30 +0100 Message-Id: <20211122105530.1964-1-mrkiko.rs@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211122_025605_250651_F303BC46 X-CRM114-Status: GOOD ( 14.42 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When flashing a broken kernel, or an image where failsafe mode is no more accessible, recoverying these devices can become needlessly painful. Allow for easier recovery by unconditionally trying to ge [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:536 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mrkiko.rs[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org When flashing a broken kernel, or an image where failsafe mode is no more accessible, recoverying these devices can become needlessly painful. Allow for easier recovery by unconditionally trying to get an initramfs image over TFTP once before booting, thereby giving the user a chance to sysupgrade to a working image. Signed-off-by: Enrico Mioso CC: Christian Lamparter CC: David Bauer --- Reasons for this patch: 1 - There are situations where it can be nice to recover a device without the AVM Recovery tool. In some cases the tool won't even be an option (as far as I know, it exists only for Windows, or am I wrong?). 2 - Since the effort of creating a second-stage bootloader for these devices has been carried out (thanks a lot for this!), I think it makes sense to allow for things to be more friendly to developers and users. Side effects: When nandboot fails, there will be TWO tftp requests with no delay between them, then the sleep will kick in. Possible "improvements": Implementing a push-button method may be preferred. Still, I have no easy way to attach an UART to the device right now. Moreover, being able to do this "more" remotely would be a vaulable feature to me. Enrico include/configs/fritz1200.h | 2 +- include/configs/fritz3000.h | 2 +- include/configs/fritz4040.h | 2 +- include/configs/fritz7530.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/configs/fritz1200.h b/include/configs/fritz1200.h index 90d5186..16152a3 100644 --- a/include/configs/fritz1200.h +++ b/include/configs/fritz1200.h @@ -23,7 +23,7 @@ "mtdparts=" MTDPARTS_DEFAULT "\0" \ "nandboot=ubi part ubi && ubi read 0x85000000 kernel && bootm\0" \ "tftpboot=tftpboot && bootm; sleep 5; run tftpboot\0" \ - "fritzboot=run nandboot || run tftpboot;\0" \ + "fritzboot=tftpboot && bootm; run nandboot || run tftpboot;\0" \ #undef V_PROMPT #define V_PROMPT "(" CONFIG_MODEL ") # " diff --git a/include/configs/fritz3000.h b/include/configs/fritz3000.h index e383ffb..3440550 100644 --- a/include/configs/fritz3000.h +++ b/include/configs/fritz3000.h @@ -23,7 +23,7 @@ "mtdparts=" MTDPARTS_DEFAULT "\0" \ "nandboot=ubi part ubi && ubi read 0x85000000 kernel && bootm\0" \ "tftpboot=tftpboot && bootm; sleep 5; run tftpboot\0" \ - "fritzboot=run nandboot || run tftpboot;\0" \ + "fritzboot=tftpboot && bootm; run nandboot || run tftpboot;\0" \ #undef V_PROMPT #define V_PROMPT "(" CONFIG_MODEL ") # " diff --git a/include/configs/fritz4040.h b/include/configs/fritz4040.h index 060afb0..582edfd 100644 --- a/include/configs/fritz4040.h +++ b/include/configs/fritz4040.h @@ -23,7 +23,7 @@ "mtdparts=" MTDPARTS_DEFAULT "\0" \ "nandboot=nboot firmware && bootm\0" \ "tftpboot=tftpsrv && bootm; sleep 5; run tftpboot\0" \ - "fritzboot=run nandboot || run tftpboot;\0" \ + "fritzboot=tftpboot && bootm; run nandboot || run tftpboot;\0" \ #undef V_PROMPT #define V_PROMPT "(" CONFIG_MODEL ") # " diff --git a/include/configs/fritz7530.h b/include/configs/fritz7530.h index b07ecfc..caecd5d 100644 --- a/include/configs/fritz7530.h +++ b/include/configs/fritz7530.h @@ -23,7 +23,7 @@ "mtdparts=" MTDPARTS_DEFAULT "\0" \ "nandboot=ubi part ubi && ubi read 0x85000000 kernel && bootm\0" \ "tftpboot=tftpboot && bootm; sleep 5; run tftpboot\0" \ - "fritzboot=run nandboot || run tftpboot;\0" \ + "fritzboot=tftpboot && bootm; run nandboot || run tftpboot;\0" \ #undef V_PROMPT #define V_PROMPT "(" CONFIG_MODEL ") # "