mlord's upgrader, ported to cygwin

Posted by: image

mlord's upgrader, ported to cygwin - 25/09/2003 18:14

download the attached file. the dll is way too big, so you need to extract cygwin1.dll from here. its in /usr/bin. for some reason, cygwin wont recognize the current directory as part of the $path, so you're gonna have to do the following at the command prompt before it works:

set path=%path%;.

ported this really quick to mess with v3alpha3. still had to use the old emplode to recreate my database.
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 25/09/2003 19:43

For those who are wonderin', this is an ethernet UPGRADER for applying .upgrade files to an empeg very quickly and without wiiping out Hijack in the process.. no serial cables required to switch between v2-final and v3-alpha (and back again..).

Cheers
Posted by: image

Re: mlord's upgrader, ported to cygwin - 25/09/2003 19:58

old thread here, though it seems to be including a number of tangents.


This version is pretty simple to use, but not 100% complete.

--> requires Hijack v328 or newer.
--> you should manually "pause" your player first, or put it in stand-by mode.
--> after "upgrader" completes, you must manually reboot your player.
--> after the reboot, you should run emptool or emplode to rebuild the database


mark, can't you just modify the program to send a SITE command to the ftp daemon to make sure the player is off before uploading the upgrade? i.e.:

make_ftp_cmd(cmd, ftp_user, ftp_passwd, "-Y \"site button top.L"", empeg_host, "/dev/null");

though i'm not sure what the effects would be if the player was off already
Posted by: Daria

Re: mlord's upgrader, ported to cygwin - 25/09/2003 20:41

I have a port to MacOS; I should also post it.
Posted by: Daria

mlord's upgrader, ported to MacOS - 25/09/2003 20:52

Diff in a moment, I need to fetch pristine source to diff against.
Posted by: Daria

Re: mlord's upgrader, ported to MacOS - 25/09/2003 20:55

Simple diff.

--- upgrader/upgrader.c Sat Apr 5 09:56:20 2003
+++ upgrader.c Fri Sep 19 15:10:39 2003
@@ -12,7 +12,12 @@
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
+#ifdef linux
#include <linux/types.h>
+#else
+typedef unsigned int __u32;
+typedef unsigned char __u8;
+#endif

//
// Chunk ID definitions from "defines.h", part of a GPL'd UpgradeSplitter package by [email protected]
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 07:40

Hey image, send me any diffs you needed to get upgrader.c to build for cygwin, and I'll incorporate them into the next release.

Thanks
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 10:29

can't you just modify the program to send a SITE command to the ftp daemon to make sure the player is off before uploading the upgrade?


Yup. Except the command is "site button=top.L".

Version 0.3 attached -- I used this to apply the v3alpha3 .upgrade without any problems. It also does the auto reboot at the end.

Cheers
Posted by: Mataglap

Re: mlord's upgrader, ported to cygwin - 26/09/2003 16:51

This compiles with no changes under a fresh cygwin install (needed an excuse to get it on the new harddrive anyway), there is a cast warning on line 399, though.

And of course the strip command doesn't work 'cause there's a ".exe" added, but that's not a problem.

Experimentation later.

--Nathan

Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:00

Okay thanks.

I'll turn on -Wall in the next version and fix all of the trivial warnings and stuff.

Cheers
Posted by: Mataglap

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:08

Oh, well since you're interested:

$ gcc -O -Wall upgrader.c -o upgraderWall
upgrader.c: In function `process_chunk':
upgrader.c:139: warning: implicit declaration of function `strcmp'
upgrader.c:220: warning: unused variable `count'
upgrader.c: In function `main':
upgrader.c:363: warning: implicit declaration of function `exit'
upgrader.c:399: warning: comparison of distinct pointer types lacks a cast
upgrader.c:407: warning: unsigned int format, different type arg (arg 4)
upgrader.c:432: warning: implicit declaration of function `strcat'
upgrader.c:434: warning: implicit declaration of function `system'
upgrader.c:446: warning: unsigned int format, different type arg (arg 4)
upgrader.c:458: warning: unsigned int format, different type arg (arg 4)
upgrader.c:351: warning: unused variable `crc'
upgrader.c:355: warning: unused variable `p'

--Nathan
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:11

Yeah, I already captured all of those.

Newest version attached.

Cheers
Posted by: Mataglap

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:25

$ make
gcc -Wall -O upgrader.c -o upgrader && strip upgrader
upgrader.c: In function `main':
upgrader.c:445: warning: long unsigned int format, different type arg (arg 4)
upgrader.c:457: warning: long unsigned int format, different type arg (arg 4)

--Nathan
Posted by: Mataglap

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:30

I'll post a cygwin compile of v0.4 or newer either later tonight or tomorrow for everyone who doesn't want to bother with installing cygwin itself.

(Thanks Mark!)

--Nathan
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:40

Mmm.. odd, no such warning with Linux. No big deal, I'll just add some casting to the next version to eliminate it.

Cheers
Posted by: tman

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:46

Different GCC version probably. I tried to compile this with MinGW so you don't need to have the huge Cygwin library but can't because of mmap. Could add code to use the native Win32 equivalent but don't have time at the moment but if anybody else wants to I'll tell them how to do it.
Posted by: mlord

Re: mlord's upgrader, ported to cygwin - 26/09/2003 17:52

Well, I suppose the simple mmap() could be replaced with an fstat() malloc() read() sequence instead..

Cheers
Posted by: Mataglap

Re: mlord's upgrader, ported to cygwin - 26/09/2003 18:10

The current gcc for cygwin is: gcc version 3.3.1 (cygming special)

--Nathan
Posted by: Mataglap

v.04 (Re: mlord's upgrader, ported to cygwin) - 27/09/2003 10:51

Here's updater v0.4, compiled for cygwin. I used it about a dozen times to flip back and forth between 2.00final and 3.00alpha3, with no problems.

--Nathan
Posted by: siberia37

v.04 (Re: mlord's upgrader, ported to cygwin) - 01/10/2003 22:43

Try as I might this doesn't work for me. The upgrader flips the player into standy and then skips by everything else really fast. I even tried downloading cygwin in it's entirety and still no luck. It's probably some weird path problem but I have no idea what it could be. What exactly is the upgrader doing when it's doing the pumping partitions? The script does make the zImage file BTW but doesn't get past that.
Posted by: image

v.04 (Re: mlord's upgrader, ported to cygwin) - 02/10/2003 00:01

try this. its everything u need, even findempeg. just use the up.bat script. there are quirks tho. since you're not in a cygwin bash shell, /dev/null isn't avaliable, so you wont auto-standby nor reboot. i probably can change it to ^Z but i'm lazy. also, findempeg has trouble when you have two empegs. modify the up.bat to accept a serial# if thats the case. put latest cygwin1.dll in the unzipped folder.
Posted by: image

v.04 (Re: mlord's upgrader, ported to cygwin) - 02/10/2003 00:02

didn't seem to upload the attachment. here it is again
Posted by: siberia37

v.04 (Re: mlord's upgrader, ported to cygwin) - 02/10/2003 07:10

Thanks I'll try it again.. I was running from the cygwin bash shell when trying it last time btw, but it could be it wasn't working right. I'll let you how it works out know thanks!
Posted by: image

v.04 (Re: mlord's upgrader, ported to cygwin) - 02/10/2003 08:57

thinking about it, you most likely didnt have the ncftput (sp?) package downloaded.
Posted by: siberia37

v.04 (Re: mlord's upgrader, ported to cygwin) - 02/10/2003 12:09

I had ncftpput, downloaded about three different version of it.. at least one of which was compiled with cygwin, same thing with gunzip. Very weird.
Posted by: Daria

mlord's upgrader, ported to MacOS, works now - 24/12/2003 13:07

Here's the revised diff
Posted by: Daria

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 13:09

And the revised binary
Posted by: mlord

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 14:07

Hi

Your diffs don't apply cleanly to my current souce -- could you post the entire upgrader.c file that you have now, please.

Thanks
Posted by: Daria

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 14:26

Absolutely
Posted by: mlord

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 15:49

Okay, here is upgrader.c version 0.6 -- my latest with your latest sync'd in.

Cheers
Posted by: Mataglap

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 16:01

Just a FYI:

bash-2.05b$ gcc -Wall -o upgrader_0.6.exe ./193910-upgrader_0.6.c
193910-upgrader_0.6.c: In function `main':
193910-upgrader_0.6.c:466: warning: long unsigned int format, different type arg (arg 4)

A current cygwin install using:
bash-2.05b$ gcc --version
gcc (GCC) 3.3.1 (cygming special)

--Nathan
Posted by: Mataglap

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 16:02

And here's the binary.

--Nathan
Posted by: mlord

Re: mlord's upgrader, ported to MacOS, works now - 24/12/2003 16:04

Ah.. cygwin must be using unsigned int instead of the more correct (?) unsigned long type for "off_t" (part of the struct returned by stat(2)).

I'll add a cast to the printf to eliminate the warning for v0.7 (someday).

Thanks
Posted by: jdandrea

Re: mlord's upgrader, ported to cygwin - 17/01/2004 12:58

Did you ever post the upgrader as ported to MacOS (X, I presume)? Inquiring minds ...

Ahh, I see it now - I missed the "Attachment" link tucked away on the left.
Posted by: jdandrea

Re: mlord's upgrader, ported to cygwin - 17/01/2004 13:58

OK - trying updater now on MacOS X (with Hijack, gunzip and ncftpput at the ready). When I try to apply a certain 3.0 alpha I get this:

Error, size mismatch: 3334488576 vs 0

Clues, anyone?
Posted by: jdandrea

Re: mlord's upgrader, ported to cygwin - 17/01/2004 14:05

Recompiled it. For some reason fstat() wasn't returning anything useful. Working now.
Posted by: Daria

Re: mlord's upgrader, ported to cygwin - 17/01/2004 15:22

You probably had the wrong binary, the first one I posted was useless
Posted by: jdandrea

Re: mlord's upgrader, ported to cygwin - 17/01/2004 16:20

No problem at all. Looks like all is well now.

I wasn't getting any playlists in 3.0a5, and going back to 3.0a3 wasn't helping 'cause I still couldn't make it into jEmplode to do the rebuild. I went back to 2.0, then forward to 3.0a5 and the playlists were there <!>.

Of course now, hindsight's 20/15, so I'm running the command line rebuild database in jemplode v51 (which is probably what I should have run in the first place <LOL>).
Posted by: Daria

Re: mlord's upgrader, ported to cygwin - 17/01/2004 18:22

Oh. Hm. I wonder if 3.0a5 can deal with the old (2.0) databases directly.

I guess I should steal a player binary off my spare player.
Posted by: jdandrea

Re: mlord's upgrader, ported to cygwin - 17/01/2004 18:43

Yeah, it seemed odd to me, actually. But that's how it went down. Meanwhile, I'm back on 2.0 after all - I've got some more CDs to upload. Holiday backlog ... yule gotta love it <groan>.