Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-10-10 16:44:59 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-10-10 16:47:23 +0300
commit6af516520f949979686adc4399926d3fe3dc0441 (patch)
tree70487d51693c4f45b1d9839ee9294b10520384d8 /WorkerForm.cs
parent115c6a445c519103eb7aaeb09930f104d94228fc (diff)
Reduced size of original games, fixes, cleanup
Diffstat (limited to 'WorkerForm.cs')
-rw-r--r--WorkerForm.cs48
1 files changed, 33 insertions, 15 deletions
diff --git a/WorkerForm.cs b/WorkerForm.cs
index 69697dc1..5d789604 100644
--- a/WorkerForm.cs
+++ b/WorkerForm.cs
@@ -190,7 +190,8 @@ namespace com.clusterrr.hakchi_gui
if (!File.Exists(ubootPath)) throw new FileNotFoundException(ubootPath + " not found");
fel.Fes1Bin = File.ReadAllBytes(fes1Path);
fel.UBootBin = File.ReadAllBytes(ubootPath);
- fel.Open(vid, pid);
+ if (!fel.Open(vid, pid))
+ throw new FelException("Can't open device");
SetStatus(Resources.UploadingFes1);
fel.InitDram(true);
TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
@@ -774,6 +775,7 @@ namespace com.clusterrr.hakchi_gui
string gamesPath = NesMiniApplication.GamesCloverPath;
const string rootFsPath = "/var/lib/hakchi/rootfs";
const string installPath = "/var/lib/hakchi";
+ const string squashFsPath = "/var/lib/hakchi/squashfs";
int progress = 0;
int maxProgress = 400;
if (Games == null || Games.Count == 0)
@@ -854,6 +856,15 @@ namespace com.clusterrr.hakchi_gui
}
SetStatus(Resources.UploadingOriginalGames);
+ var squashFsMount = clovershell.ExecuteSimple($"mount | grep {squashFsPath}", 30000, false);
+ if (string.IsNullOrEmpty(squashFsMount))
+ {
+ clovershell.ExecuteSimple($"mkdir -p {squashFsPath} && mount /dev/mapper/root-crypt {squashFsPath}", 30000, true);
+ MessageBoxFromThread(this, "Seems like your are using old version of custom kernel. " +
+ "Please install latest version using \"Kernel->Flash custom kernel\" menu to make original games work.",
+ Resources.CustomKernel, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, false);
+ }
+
startProgress = progress;
foreach (var originalCode in originalGames.Keys)
{
@@ -862,23 +873,30 @@ namespace com.clusterrr.hakchi_gui
{
case MainForm.ConsoleType.NES:
case MainForm.ConsoleType.Famicom:
- originalSyncCode = $"mkdir -p \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"rsync -ac \"{gamesPath}/{originalCode}/\" \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"sed -i -e 's/\\/usr\\/bin\\/clover-kachikachi/\\/bin\\/clover-kachikachi-wr/g' \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/{originalCode}.desktop\"";
+ originalSyncCode =
+ $"src=\"{squashFsPath}{gamesPath}/{originalCode}\" && " +
+ $"dst=\"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
+ $"mkdir -p \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}.png\" \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}_small.png\" \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}.nes\" \"$dst\" && " +
+ $"ln -s \"$src/autoplay/\" \"$dst/autoplay\" && " +
+ $"ln -s \"$src/pixelart/\" \"$dst/pixelart\" && " +
+ $"cp \"$src/{originalCode}.desktop\" \"$dst/{originalCode}.desktop\" && " +
+ $"sed -i -e 's/\\/usr\\/bin\\/clover-kachikachi/\\/bin\\/clover-kachikachi-wr/g' \"$dst/{originalCode}.desktop\"";
break;
case MainForm.ConsoleType.SNES:
case MainForm.ConsoleType.SuperFamicom:
- originalSyncCode = $"mkdir -p \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"rsync -ac \"{gamesPath}/{originalCode}/\" \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"sed -i -e 's/\\/usr\\/bin\\/clover-canoe-shvc/\\/bin\\/clover-canoe-shvc-wr/g' \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/{originalCode}.desktop\"";
- /*
- // With compression but very slow
- originalSyncCode = $"mkdir -p \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"rsync -ac \"{gamesPath}/{originalCode}/\" \"/tmp/{originalCode}/\" && " +
- $"gzip \"/tmp/{originalCode}/{originalCode}.sfrom\" && " +
- $"rsync -ac \"/tmp/{originalCode}/\" \"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
- $"rm -rf \"/tmp/{originalCode}/\"";
- */
+ originalSyncCode =
+ $"src=\"{squashFsPath}{gamesPath}/{originalCode}\" && " +
+ $"dst=\"{rootFsPath}{gamesPath}/{originalGames[originalCode]}/{originalCode}/\" && " +
+ $"mkdir -p \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}.png\" \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}_small.png\" \"$dst\" && " +
+ $"ln -s \"$src/{originalCode}.sfrom\" \"$dst\" && " +
+ $"ln -s \"$src/autoplay/\" \"$dst/autoplay\" && " +
+ $"cp \"$src/{originalCode}.desktop\" \"$dst/{originalCode}.desktop\" && " +
+ $"sed -i -e 's/\\/usr\\/bin\\/clover-canoe-shvc/\\/bin\\/clover-canoe-shvc-wr/g' \"$dst/{originalCode}.desktop\"";
break;
}
clovershell.ExecuteSimple(originalSyncCode, 30000, true);