From patchwork Thu Aug 17 00:15:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 110287 Delivered-To: patches@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp1489902obb; Wed, 16 Aug 2017 17:15:15 -0700 (PDT) X-Received: by 10.98.103.69 with SMTP id b66mr3309875pfc.171.1502928915561; Wed, 16 Aug 2017 17:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502928915; cv=none; d=google.com; s=arc-20160816; b=mfYBJTPXQZCQq51kFc1qQ/jlZzZUkj8joQIhWYcL/3gPQHBsSdUij7HefQHFdkhRye 2Gpr9Mz4xe87gR/rnxCyy6qV49jw9v2aj3fsWlH5QiM4+IFD9KEkHqKPYDbQemkiwQ6A JM3RVou72woTVUu+4J+sgjnrq1DPJoVRld3jznBIu6gBOT865eQWDDFPhJvKulDFjj5q ocmHQa1iIAm68n9fb5l/FhrAqNA21Nv5lpAnoIuXXXk55r3aCi4MsyjMDDGrF2y1jMl1 de1vUq3GwBCzxweljlrny/gvxlZbnx/75tzuOzYr9QFauktFxOnGVxb+aarvR3oXXYrH atOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Uxc83wBQ38Bk8yybRBA4TFZiddUadLz35tVORSARUhA=; b=a/QTjgcjHXFz4Mw929+0sCw/XVgNtlUunZ3bs+CEvM49yt4ylpo47DT6qeqEPiVzfD IzP7wssj5PHgVXh6TLZ4lMIgkaPI+vkYGklCeIP79Fz5jbGfTIpXSULXOmcLPNdYDRAP TOJFNq0AE4G0BufUgevMX9LXgSlVGM1Lin6FbFpDQrJpZICBE4BNsVioQcVagZICx4Ki 1t3h+bSFuxq5f0PuzALDL/iC0Hly1ewRZIQ3oL+VozEfPgdI/zElesag1fgd4+tSoBaK SqczqgTa2GNyyTQBpqK9WatKAimJrSPnEodRMBb7busZkhrdnsiykQ7hHpoGsSGr7NMz acWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e9h+yuq+; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com. [2607:f8b0:400e:c05::230]) by mx.google.com with ESMTPS id u3si1129156pgo.886.2017.08.16.17.15.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 17:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) client-ip=2607:f8b0:400e:c05::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e9h+yuq+; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::230 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x230.google.com with SMTP id i12so31167969pgr.3 for ; Wed, 16 Aug 2017 17:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uxc83wBQ38Bk8yybRBA4TFZiddUadLz35tVORSARUhA=; b=e9h+yuq+TEOyGhvwaLNIEw6LE88VZP6BQbFf/jpAxXbb0jeljI9hB2aV23jyLEZ+se R0xqdLbYVfJ5FNzZDHOULpDNdsFVvTSrLHOE2eUJugFoUkUh0DcebL6JzvkrB8WBKQEi Hb3yFYUb36oIb5fogSeLZpNpmvkcZ7S7gtwpo= 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; bh=Uxc83wBQ38Bk8yybRBA4TFZiddUadLz35tVORSARUhA=; b=dNWC5WmckJfVgNVAkJwwV6v9OMZEmYX8Yb6U54bxP1B1ZLIrmK9DEQB7TG8bo2WJDO U60YcKmVRdX3tWhrQbWMdZBCxw9ZWbIXhOcm6HNs5hCYHjBVOnrd+ooAtUGHVfSbuA0H +7a4I6p/oMH81yq9Pk8lPmjjJjEhoLojkN91AM650i8Gv+rFHcfleqyduCFXtDjh4ag9 MgPYiJ1g+u1e39iwhq59EIflFg13/IijC4xyClMFhnKvsScvwIijXRMZ+x3+NDFKKxGd LH0ptwFpfPC92jsC2BoS5F0ajXyZgdZKkIDGiftQhOyiOt5U6uejl3QxIKNTynq5UnnY 8shA== X-Gm-Message-State: AHYfb5hPQuhfi0kvTZLxjBRFAftH2ya8ovlGUIK4FSJpo13G2N/B75rk kIu2xUKZ8bB/488zyV8= X-Received: by 10.99.98.68 with SMTP id w65mr3355941pgb.268.1502928915256; Wed, 16 Aug 2017 17:15:15 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id w66sm4113539pfi.63.2017.08.16.17.15.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Aug 2017 17:15:14 -0700 (PDT) From: John Stultz To: Haojian Zhuang Cc: Mark Salyzyn Subject: [PATCH 2/2] generate_ptable.sh Use dd conv=sparse Date: Wed, 16 Aug 2017 17:15:11 -0700 Message-Id: <1502928911-3220-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502928911-3220-1-git-send-email-john.stultz@linaro.org> References: <1502928911-3220-1-git-send-email-john.stultz@linaro.org> From: Mark Salyzyn When constructing the image, by using sparse we do not place too much stress on the /tmp/ filesystem. Test: manual, ensure all images compare before and after Bug: 38446744 Change-Id: I72593e2a5176b7a8f0373ed54d2e626220373307 --- l-loader/generate_ptable.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/l-loader/generate_ptable.sh b/l-loader/generate_ptable.sh index 80254f8..779700f 100755 --- a/l-loader/generate_ptable.sh +++ b/l-loader/generate_ptable.sh @@ -28,13 +28,13 @@ echo ${BK_PTABLE_LBA} # get the partition table case ${PTABLE} in tiny) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} + dd if=/dev/zero of=${TEMP_FILE} conv=sparse bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} sgdisk -U -R -v ${TEMP_FILE} sgdisk -n 1:2048:4095 -t 1:0700 -u 1:F9F21F01-A8D4-5F0E-9746-594869AEC3E4 -c 1:"vrl" -p ${TEMP_FILE} sgdisk -n 2:4096:6143 -t 2:0700 -u 2:F9F21F02-A8D4-5F04-9746-594869AEC3E4 -c 2:"vrl_backup" -p ${TEMP_FILE} ;; aosp*) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} + dd if=/dev/zero of=${TEMP_FILE} conv=sparse bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} sgdisk -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} #[1: vrl: 1M-2M] sgdisk -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} @@ -58,7 +58,7 @@ case ${PTABLE} in sgdisk -n -E -t 10:8300 -u 10:064111F6-463B-4CE1-876B-13F3684CE164 -c 10:"userdata" -p ${TEMP_FILE} ;; linux*) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} + dd if=/dev/zero of=${TEMP_FILE} conv=sparse bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} sgdisk -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} #[1: vrl: 1M-2M] sgdisk -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} @@ -80,7 +80,7 @@ case ${PTABLE} in sgdisk -n -E -t 9:8300 -u 9:FC56E345-2E8E-49AE-B2F8-5B9D263FE377 -c 9:"system" ${TEMP_FILE} ;; swap*) - dd if=/dev/zero of=${TEMP_FILE} bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} + dd if=/dev/zero of=${TEMP_FILE} conv=sparse bs=${SECTOR_SIZE} count=${SECTOR_NUMBER} sgdisk -U 2CB85345-6A91-4043-8203-723F0D28FBE8 -v ${TEMP_FILE} #[1: vrl: 1M-2M] sgdisk -n 1:0:+1M -t 1:0700 -u 1:496847AB-56A1-4CD5-A1AD-47F4ACF055C9 -c 1:"vrl" ${TEMP_FILE} @@ -106,7 +106,7 @@ case ${PTABLE} in esac # get the main and the backup parts of the partition table -dd if=${TEMP_FILE} of=prm_ptable.img bs=${SECTOR_SIZE} count=34 -dd if=${TEMP_FILE} of=sec_ptable.img skip=${BK_PTABLE_LBA} bs=${SECTOR_SIZE} count=33 +dd if=${TEMP_FILE} of=prm_ptable.img conv=sparse bs=${SECTOR_SIZE} count=34 +dd if=${TEMP_FILE} of=sec_ptable.img conv=sparse skip=${BK_PTABLE_LBA} bs=${SECTOR_SIZE} count=33 rm -f ${TEMP_FILE}