<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>please also backport this to 19.07, since the variables for ath79 are still wrong there.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Despite, maybe have a look at my annotations below, at least one of them might require a fix…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Best<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Adrian<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Adrian Schmutzler [mailto:mail@adrianschmutzler.de] <br><b>Sent:</b> Mittwoch, 11. September 2019 12:56<br><b>To:</b> 'Rafał Miłecki' <zajec5@gmail.com>; openwrt-devel@lists.openwrt.org<br><b>Cc:</b> 'Rafał Miłecki' <rafal@milecki.pl>; 'Jonas Gorski' <jonas.gorski@gmail.com>; 'Jo-Philipp Wich' <jo@mein.io>; 'John Crispin' <john@phrozen.org><br><b>Subject:</b> RE: [OpenWrt-Devel] [PATCH 3/3] treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p><span style='font-family:"Calibri",sans-serif'>Hi,</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>when looking at the merged patch (unfortunately only then), I found some "issues" (see below):</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> -----Original Message-----</span> <br><span style='font-family:"Calibri",sans-serif'>> From: openwrt-devel [<a href="mailto:openwrt-devel-bounces@lists.openwrt.org">mailto:openwrt-devel-bounces@lists.openwrt.org</a>] On Behalf Of Rafal Milecki</span> <br><span style='font-family:"Calibri",sans-serif'>> Sent: Freitag, 6. September 2019 07:11</span> <br><span style='font-family:"Calibri",sans-serif'>> To: <a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a></span> <br><span style='font-family:"Calibri",sans-serif'>> Cc: Rafał Miłecki <<a href="mailto:rafal@milecki.pl">rafal@milecki.pl</a>>; Jonas Gorski <<a href="mailto:jonas.gorski@gmail.com">jonas.gorski@gmail.com</a>>; Jo-Philipp Wich <<a href="mailto:jo@mein.io">jo@mein.io</a>>; John Crispin</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> <<a href="mailto:john@phrozen.org">john@phrozen.org</a>></span> <br><span style='font-family:"Calibri",sans-serif'>> Subject: [OpenWrt-Devel] [PATCH 3/3] treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> From: Rafał Miłecki <<a href="mailto:rafal@milecki.pl">rafal@milecki.pl</a>></span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> Now that $UPGRADE_BACKUP is set conditionally there is no need to check</span> <br><span style='font-family:"Calibri",sans-serif'>> the $UPGRADE_OPT_SAVE_CONFIG anymore. All conditions can be simplified.</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> Signed-off-by: Rafał Miłecki <<a href="mailto:rafal@milecki.pl">rafal@milecki.pl</a>></span> <br><span style='font-family:"Calibri",sans-serif'>> ---</span> <br><span style='font-family:"Calibri",sans-serif'>> package/base-files/files/lib/upgrade/common.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> package/base-files/files/lib/upgrade/do_stage2 | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> package/base-files/files/sbin/sysupgrade | 1 -</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ar71xx/base-files/lib/upgrade/dir825.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 4 ++--</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ath25/base-files/lib/upgrade/platform.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ath79/base-files/lib/upgrade/platform.sh | 4 ++--</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/imx6/base-files/lib/upgrade/platform.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ipq40xx/base-files/lib/upgrade/platform.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> target/linux/ixp4xx/base-files/lib/upgrade/platform.sh | 2 +-</span> <br><span style='font-family:"Calibri",sans-serif'>> 12 files changed, 13 insertions(+), 14 deletions(-)</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> index 8e7866f698..0d3162d4fc 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/package/base-files/files/lib/upgrade/common.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/package/base-files/files/lib/upgrade/common.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -220,7 +220,7 @@ indicate_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> # $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m</span> <br><span style='font-family:"Calibri",sans-serif'>> default_do_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> sync</span> <br><span style='font-family:"Calibri",sans-serif'>> - if [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> + if [ -n "$UPGRADE_BACKUP" ]; then</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Any reason why this is "-n" and not "-f" as below?</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-</span> <br><span style='font-family:"Calibri",sans-serif'>> image}"</span> <br><span style='font-family:"Calibri",sans-serif'>> else</span> <br><span style='font-family:"Calibri",sans-serif'>> get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/package/base-files/files/lib/upgrade/do_stage2 b/package/base-files/files/lib/upgrade/do_stage2</span> <br><span style='font-family:"Calibri",sans-serif'>> index 0e6cc1bfc3..0e32445743 100755</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/package/base-files/files/lib/upgrade/do_stage2</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/package/base-files/files/lib/upgrade/do_stage2</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -11,7 +11,7 @@ else</span> <br><span style='font-family:"Calibri",sans-serif'>> default_do_upgrade "$IMAGE"</span> <br><span style='font-family:"Calibri",sans-serif'>> fi</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> -if [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then</span> <br><span style='font-family:"Calibri",sans-serif'>> +if [ -n "$UPGRADE_BACKUP" ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Here I'm not so sure about "-f" vs. "-n" ...</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> platform_copy_config</span> <br><span style='font-family:"Calibri",sans-serif'>> fi</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade</span> <br><span style='font-family:"Calibri",sans-serif'>> index f18143bff4..935d08048e 100755</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/package/base-files/files/sbin/sysupgrade</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/package/base-files/files/sbin/sysupgrade</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -371,7 +371,6 @@ else</span> <br><span style='font-family:"Calibri",sans-serif'>> $backup_attr</span> <br><span style='font-family:"Calibri",sans-serif'>> \"command\": $(json_string "$COMMAND"),</span> <br><span style='font-family:"Calibri",sans-serif'>> \"options\": {</span> <br><span style='font-family:"Calibri",sans-serif'>> - \"save_config\": $SAVE_CONFIG,</span> <br><span style='font-family:"Calibri",sans-serif'>> \"save_partitions\": $SAVE_PARTITIONS</span> <br><span style='font-family:"Calibri",sans-serif'>> }</span> <br><span style='font-family:"Calibri",sans-serif'>> }"</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index c694c2e6f2..e991a06b7a 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -75,7 +75,7 @@ dir825b_do_upgrade_combined() {</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> if [ -n "$fw_mtd" ] && [ ${fw_blocks:-0} -gt 0 ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> sync</span> <br><span style='font-family:"Calibri",sans-serif'>> dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 8536d4ba4a..f43bdcea7f 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -159,7 +159,7 @@ platform_do_upgrade_openmesh()</span> <br><span style='font-family:"Calibri",sans-serif'>> local cfg_size= kernel_size= rootfs_size=</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> cfg_size=$(dd if="$img_path" bs=2 skip=35 count=4 2>/dev/null)</span> <br><span style='font-family:"Calibri",sans-serif'>> kernel_size=$(dd if="$img_path" bs=2 skip=71 count=4 2>/dev/null)</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 726163291d..86e7b6386b 100755</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -65,7 +65,7 @@ platform_do_upgrade_combined() {</span> <br><span style='font-family:"Calibri",sans-serif'>> then</span> <br><span style='font-family:"Calibri",sans-serif'>> local rootfspart=$(platform_find_rootfspart "$partitions" "$kernelpart")</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> if [ "$PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD" -ne 1 ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -164,7 +164,7 @@ platform_do_upgrade_compex() {</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> if [ -n "$fw_mtd" ] && [ ${fw_blocks:-0} -gt 0 ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUPs"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUPs"</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Is there a reason for the trailing "s" here or is this a typo: ="-j $UPGRADE_BACKUPs" ?</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> sync</span> <br><span style='font-family:"Calibri",sans-serif'>> dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ath25/base-files/lib/upgrade/platform.sh b/target/linux/ath25/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 0dde103605..778bbf5a39 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ath25/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ath25/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -67,7 +67,7 @@ platform_do_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> [ ${erase_size:-0} -gt 0 ];</span> <br><span style='font-family:"Calibri",sans-serif'>> then</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \</span> <br><span style='font-family:"Calibri",sans-serif'>> dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ath79/base-files/lib/upgrade/platform.sh b/target/linux/ath79/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index f7e62143e7..f4fca06384 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ath79/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ath79/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -14,7 +14,7 @@ redboot_fis_do_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> if [ "$magic" = "4349" ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> local kern_length=0x$(dd if="$sysup_file" bs=2 skip=1 count=4 2>/dev/null)</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j</span> <br><span style='font-family:"Calibri",sans-serif'>> $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> dd if="$sysup_file" bs=64k skip=1 2>/dev/null | \</span> <br><span style='font-family:"Calibri",sans-serif'>> mtd -r $append -F$kern_part:$kern_length:0x80060000,rootfs write - $kern_part:rootfs</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> @@ -22,7 +22,7 @@ redboot_fis_do_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> local board_dir=$(tar tf $sysup_file | grep -m 1 '^sysupgrade-.*/$')</span> <br><span style='font-family:"Calibri",sans-serif'>> local kern_length=$(tar xf $sysup_file ${board_dir}kernel -O | wc -c)</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j</span> <br><span style='font-family:"Calibri",sans-serif'>> $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> tar xf $sysup_file ${board_dir}kernel ${board_dir}root -O | \</span> <br><span style='font-family:"Calibri",sans-serif'>> mtd -r $append -F$kern_part:$kern_length:0x80060000,rootfs write - $kern_part:rootfs</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh b/target/linux/imx6/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 9414b18710..a090cc080b 100755</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/imx6/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -75,7 +75,7 @@ platform_pre_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> case "$board" in</span> <br><span style='font-family:"Calibri",sans-serif'>> apalis*)</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 0 ] && {</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -z "$UPGRADE_BACKUP" ] && {</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Really "-z" or "! -f"?</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> jffs2reset -y</span> <br><span style='font-family:"Calibri",sans-serif'>> umount /overlay</span> <br><span style='font-family:"Calibri",sans-serif'>> }</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index e313562017..8e02186eb8 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -74,7 +74,7 @@ platform_do_upgrade_openmesh() {</span> <br><span style='font-family:"Calibri",sans-serif'>> #</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> # take care of restoring a saved config</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}"</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>"-f" here, too?</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> mtd -q erase inactive</span> <br><span style='font-family:"Calibri",sans-serif'>> tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 6b9858beb0..c12508c437 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -37,7 +37,7 @@ zyxel_do_upgrade() {</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> tar Oxf $tar_file ${board_dir}/kernel | mtd write - kernel</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> - if [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ]; then</span> <br><span style='font-family:"Calibri",sans-serif'>> + if [ -n "$UPGRADE_BACKUP" ]; then</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>"-f" here, too?</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Sorry for being late with this.</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Best</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>Adrian</span> <o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs</span> <br><span style='font-family:"Calibri",sans-serif'>> else</span> <br><span style='font-family:"Calibri",sans-serif'>> tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs</span> <br><span style='font-family:"Calibri",sans-serif'>> diff --git a/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh b/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh</span><o:p></o:p></p><p><span style='font-family:"Calibri",sans-serif'>> index 557f43ce6f..f83aa430cf 100644</span> <br><span style='font-family:"Calibri",sans-serif'>> --- a/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> +++ b/target/linux/ixp4xx/base-files/lib/upgrade/platform.sh</span> <br><span style='font-family:"Calibri",sans-serif'>> @@ -68,7 +68,7 @@ platform_do_upgrade_combined() {</span> <br><span style='font-family:"Calibri",sans-serif'>> [ ${erase_size:-0} -gt 0 ];</span> <br><span style='font-family:"Calibri",sans-serif'>> then</span> <br><span style='font-family:"Calibri",sans-serif'>> local append=""</span> <br><span style='font-family:"Calibri",sans-serif'>> - [ -f "$UPGRADE_BACKUP" -a "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> + [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> # write the kernel</span> <br><span style='font-family:"Calibri",sans-serif'>> dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | \</span> <br><span style='font-family:"Calibri",sans-serif'>> --</span> <br><span style='font-family:"Calibri",sans-serif'>> 2.21.0</span> <br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> </span><br><span style='font-family:"Calibri",sans-serif'>> _______________________________________________</span> <br><span style='font-family:"Calibri",sans-serif'>> openwrt-devel mailing list</span> <br><span style='font-family:"Calibri",sans-serif'>> <a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a></span> <br><span style='font-family:"Calibri",sans-serif'>> <a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a></span> <o:p></o:p></p></div></div></body></html>