<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Windows Mail 17.5.9600.22013">
<style type="text/css"><!--html { font-family: "Color Emoji", "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; }--></style><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst,
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style>
</head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;">
<div>Changed…</div>
<div><br>
</div>
<div>#!/bin/sh</div>
<div><br>
</div>
<div>if (! grep -q /dev/sda1 /proc/mounts); then<br>
echo "No install media mounted; couldn't find /dev/sda in /proc/mounts"<br>
exit 1;<br>
fi</div>
<div><br>
</div>
<div>echo</div>
<div><br>
</div>
<div>echo "This process will completely restore your E3's NAND."<br>
echo This will try and restore The Amstrad firmware on the device. Are you<br>
echo -n "sure you wish to continue? [y/N]: "</div>
<div><br>
</div>
<div>read i</div>
<div><br>
</div>
<div>if [ ! "x$i" = "xy" -a ! "x$i" = "xY" ]; then<br>
echo<br>
echo Aborting.<br>
exit 1<br>
fi</div>
<div><br>
</div>
<div>echo<br>
echo Starting restore.. This might take a while...</div>
<div><br>
</div>
<div>perhaps_write_flash()<br>
{<br>
p=${1?} erase=${2?}<br>
f=/media/sda1/e3-nand.$p<br>
dev=/dev/mtd$p</div>
<div><br>
</div>
<div> test -e $f || return</div>
<div><br>
</div>
<div> echo found $f<br>
echo erasing $erase on $dev<br>
flash_erase $dev 0 $erase<br>
echo writing flash<br>
nandwrite -on $dev $f<br>
}</div>
<div><br>
</div>
<div> perhaps_write_flash 0 224<br>
perhaps_write_flash 1 16<br>
perhaps_write_flash 2 16<br>
perhaps_write_flash 3 16<br>
perhaps_write_flash 4 1728<br>
perhaps_write_flash 5 48</div>
<div><br>
</div>
<div><br>
echo "Finished restoring the Amstrad E3 Firmware,"<br>
echo "Type Reboot or unplug E3 to see if the Amstrad E3 Splash Screen"<br>
echo "comes up (Fingers Crossed) If not just reinstall E3 Linux with the"<br>
echo "pbltool with the -n in the line to stop Handshaking otherwise it will"<br>
echo "not find PBL V4.9 Build:1311 bootloader."<br>
</div>
<div data-signatureblock="true">
<div><br>
</div>
<div>Spanner..<br>
<br>
http://amstrad-e3-hacking.freeforums.net</div>
<div><br>
</div>
</div>
<div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;">
<div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style="line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;"><b>From:</b> <a href="mailto:ralph@inputplus.co.uk" target="_parent">Ralph
Corderoy</a><br>
<b>Sent:</b> Wednesday, 24 April 2019 12:48<br>
<b>To:</b> <a href="mailto:e3-hacking@earth.li" target="_parent">Discussion of the Amstrad E3 emailer hardware/software</a></font></div>
</div>
<div><br>
</div>
<div dir="">
<div id="readingPaneBodyContent">Hi Nick,<br>
<br>
> is this right…??<br>
><br>
> perhaps_write_flash()<br>
> {<br>
> p=${1?} erase=${2?}<br>
> f=/media/sda1/e3-nand-backup.$p<br>
> dev=/dev/mtd$p<br>
><br>
> test -e $f || return<br>
><br>
> echo found $f<br>
> echo erasing $erase on $dev<br>
> flash_erase $dev 0 $erase<br>
> echo writing flash<br>
> nandwrite -on $dev $f<br>
> }<br>
<br>
That bit is.<br>
<br>
> perhaps_write_flash 0 224<br>
> perhaps_write_flash 0 16<br>
> perhaps_write_flash 0 16<br>
> perhaps_write_flash 0 16<br>
> perhaps_write_flash 0 1728<br>
> perhaps_write_flash 0 48<br>
<br>
The function takes two parameters, in $1 and $2 at the start.<br>
The first parameter, copied into p, is the partition number,<br>
and so it needs to go 0, 1, ...<br>
<br>
perhaps_write_flash 0 224<br>
perhaps_write_flash 1 16<br>
perhaps_write_flash 2 16<br>
perhaps_write_flash 3 16<br>
perhaps_write_flash 4 1728<br>
perhaps_write_flash 5 48<br>
<br>
I also think you might want to remove the `-backup' in f's definition<br>
near the start because your script said they were called e3-nand.0, etc.<br>
<br>
What you've given here replaces the six blocks of if...then...fi lines<br>
in your original script, leaving the bit before and after.<br>
<br>
-- <br>
Cheers, Ralph.<br>
<br>
_______________________________________________<br>
e3-hacking mailing list<br>
e3-hacking@earth.li<br>
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.earth.li%2Fmailman%2Flistinfo%2Fe3-hacking&data=02%7C01%7C%7Cd86c48c82c0c4d94d32908d6c8aac186%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636917033045425120&sdata=qKwBVIsPGXyAvKUyZ4ZUvSBdDRTSXlZxAiB2ZAr72iY%3D&reserved=0<br>
</div>
</div>
</div>
</body>
</html>