From patchwork Sat May 13 19:56:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 762068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wQHhl6BhBz9s9Y for ; Sun, 14 May 2017 05:58:31 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HVl6UFpb"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cJFYVoCcgKkFraor3goE8tFysnumKFGiTGMLM3s54vw=; b=HVl6UFpbqihvrB8enk+P8LOI+O J5+gBB8Hd0to9HnLeSoXOH1/P27xs1CR+KTDEnMiTwXEsZbVpgEL7m5D/u69EinfnHKr4LzRgUWl9 48G9uW4Cr6kBPv1crd4G/K2+wHqfua+wNw5vR2z/Aan0DRSkTeKliEsHcUFGEuwQqyttkBM3/GyC5 rSyS0w5H+lnrJrV04RiMQRNkdCCBwT23CtuiH5q8wQb37SWMTo4PqL4EjBlUXgRA4P3hmkQKonI6r zos0g6Oq1sphkxEGiiAR07CQmtPb6txYAkrPPn/9lAw8eVz6BVFDmC53gY6tsanvT7xQhg4BZnSHU Sg8BFVCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d9dBF-00056G-Sd; Sat, 13 May 2017 19:58:21 +0000 Received: from chaos.universe-factory.net ([2a02:2918:505:100::22]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d9dAd-0003rP-Ez for lede-dev@lists.infradead.org; Sat, 13 May 2017 19:57:48 +0000 Received: from localhost.localdomain (unknown [IPv6:fd1b:c28a:2fd6::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by chaos.universe-factory.net (Postfix) with ESMTPSA id 697CB186C98 for ; Sat, 13 May 2017 21:56:56 +0200 (CEST) From: Matthias Schiffer To: lede-dev@lists.infradead.org Date: Sat, 13 May 2017 21:56:39 +0200 Message-Id: <66c3327f7df0b6e8d2b173fdbf452f2312d14f7b.1494704975.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170513_125744_721031_D4260289 X-CRM114-Status: UNSURE ( 6.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH v2 09/19] fstools: snapshot: handle jffs2 conversion using upgraded X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We can reuse the kill_remaining and run_ramfs facilities of the stage2 run by upgraded. Signed-off-by: Matthias Schiffer --- package/system/fstools/Makefile | 2 +- package/system/fstools/files/snapshot | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 759ea65978..db234aeecf 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fstools -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot index baf24f1e3e..a495e34345 100644 --- a/package/system/fstools/files/snapshot +++ b/package/system/fstools/files/snapshot @@ -64,14 +64,16 @@ do_convert_jffs2() { do_convert() { . /lib/functions.sh . /lib/upgrade/common.sh - ubus call system upgrade - touch /tmp/sysupgrade + cd /overlay/upper tar czf /tmp/snapshot.tar.gz * - kill_remaining TERM - sleep 3 - kill_remaining KILL - run_ramfs '. /sbin/snapshot; do_convert_jffs2' + + install_bin /sbin/upgraded + ubus call system sysupgrade "{ + \"prefix\": \"$RAM_ROOT\", + \"path\": \"\", + \"command\": \". /sbin/snapshot; do_convert_jffs2\" + }" } [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {