From patchwork Sun May 22 20:27:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Senior X-Patchwork-Id: 624975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rCYFL5kgRz9s9c for ; Mon, 23 May 2016 06:29:58 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4Zyw-0002Hc-Pp; Sun, 22 May 2016 20:28:14 +0000 Received: from mail.tdb.com ([64.184.245.180]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4Zyu-0002Fk-B9 for lede-dev@lists.infradead.org; Sun, 22 May 2016 20:28:13 +0000 Received: (qmail 4504 invoked from network); 22 May 2016 13:27:51 -0700 Received: from unknown (HELO husum.klickitat.com) (192.168.80.4) by 192.168.80.10 with SMTP; 22 May 2016 13:27:51 -0700 Received: from russell by husum.klickitat.com with local (Exim 4.80) (envelope-from ) id 1b4ZyX-0001N5-6g; Sun, 22 May 2016 13:27:49 -0700 From: Russell Senior To: lede-dev@lists.infradead.org Date: Sun, 22 May 2016 13:27:49 -0700 Message-ID: <87fut94z3u.fsf@husum.klickitat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160522_132812_594067_A6DA7E10 X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 2/2] x86: fix sysupgrade to work on mmcblk X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Reworks block device detection slightly and accomodates the different partition naming scheme, e.g. mmcblk0p1 vs sda1 Signed-off-by: Russell Senior --- target/linux/x86/base-files/lib/upgrade/platform.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 29eac77..04508b7 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -17,11 +17,14 @@ platform_export_bootpart() { PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02) uuid="${disk#PARTUUID=}" uuid="${uuid%-02}" - for disk in /dev/*; do - [ -b "$disk" ] || continue + for disk in $(find /dev -type b); do set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "') if [ "$4$3$2$1" = "$uuid" ]; then - export BOOTPART="${disk}1" + if echo $disk | grep -q mmc - ; then + export BOOTPART="${disk}p1 + else + export BOOTPART="${disk}1" + fi return 0 fi done