-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ER: general purpose GS/OS installer script interpreter for Linux #31
Comments
This is on my todo list. As is making it not even require Linux to do it! I want this on my Mac! (I realize I may need to modify some stuff to handle resource forks and ProDOS filetypes in a couple of different ways for different other tools you might use these things with.) REALLY wish we could get some standardization on that! |
Yeah, I didn't really mean Linux, I just meant as a standalone tool as opposed to an integrated part of the A2SERVER installer. I doubt there's anything in there that makes it Linux-specific in a way that wouldn't run on a Mac, except possibly a couple of BSD vs GNUisms in tools like date and touch. Rewriting in Python (as I did for cppo) would be one way of addressing. |
Your use of Apparently 10.3 was "the most connectable" OS X release for Macs. I No objection to rewriting the installer in Python, though I'm not In fact, I note this should already be possible with the adouble Speaking of AppleVolumes.default options, an IRC log snippet I don't
I'm not 100% sure I agree with Tony on that based on my reading of Joseph On Mon, Oct 26, 2015 at 06:35:13AM -0700, IvanExpert wrote:
|
I think there's actually more than one use of GNU sed syntax that isn't available in BSD sed. OS X 10.3 still offered AFP over AppleTalk, just like Netatalk and Classic Mac OS does, on Ethernet and Wi-Fi (but NOT LocalTalk, which is not supported in any version of OS X). 10.4 supported AFP over AppleTalk client connections but would only serve files over TCP; 10.5 retained an AppleTalk stack for printing only; 10.6 excised AppleTalk completely. ea:ad I'm pretty sure I put in because because several of my tools (e.g. afpsync and cppo -ad) are dependent on having the netatalk AD method of storing files. The guidance for casefold was from accrued wisdom in comp.sys.apple2. I can't remember what happens if you don't use it, but the issue is that ProDOS doesn't support lowercase at all, and GS/OS is case insensitive. Thus if GS/OS copies something with a lowercase name to Netatalk, and it doesn't get converted to uppercase by casefold, ProDOS won't be able to access it, which means some parts of GS/OS can't either (e.g. START.GS.OS I think). You can probably get away with not using casefold if you're only ever using ProDOS 8, because then you'll never have occasion to copy a lowercase filename onto the volume; or if you're using GS/OS but not network boot, no casefold is probably fine (even desirable). This is one major behavior break between Netatalk and native AppleShare server; with a native AppleShare server, you get truly case insensitive behavior even on a shared ProDOS volume. GS/OS can do this with Netatalk by using the GSFILES volume, which doesn't have casefold, but I don't think the OS will run without all of its names converted to uppercase. Anything you want to know about resource fork files I'm happy to explain. As for the resource fork, it's absolutely a resource fork, it's just a GS/OS rather than a Mac resource fork (when not split into component files on a foreign volume). When a ProDOS volume file has a fork, it's called an extended file. Mac OS won't know what to do with it, but GS/OS will. (ProDOS 8 won't even know what it is, however.) Both GS/OS and classic Mac OS with the ProDOS File System or File Exchange 2.x extensions will show an extended file on an ProDOS or AFP volume as a single file, just like Mac OS does. ProDOS 8 will too but will just yield I/O errors if you try to access it. There are Apple tech docs explaining the installer script format, the ProDOS extended file format, and more related stuff. See: http://www.1000bit.it/support/manuali/apple/technotes/tn.0.html |
All the more reason to turn it into something that runs more places.
Good to know. This is probably why 10.2 and 10.3 were described as It crosses my mind that we could possibly get point to point AFP over
I figured as much. And ea:ad is the fallback if your FS doesn't have
I'm game for that. If we need something from 2.2.5 for security or
Is that true for all versions of ProDOS? After all, if you specify Ideally, I'd like to restore the case-retentive features of GS/OS
My understanding is that ProDOS 8 cannot see any "extended" files I figure it might use the Mac type/creator space and just include a Joseph |
I can read regexes in my sleep, but if you wanna make it more legible and yield the same result, I have no objection.
I'd like to see that too, but considering that the Workstation Card apparently required a coprocessor, and the IIc lacks decent hardware handshaking (from what I understand), and most of all there currently doesn't exist a ProDOS 8 AppleShare client that could talk to the IIc's serial port rather than the Workstation Card, I'd say you have a pretty heavy lift there.
Sure, using the OS X format is well worth investigating, and less clumsy to work with. What I don't know is whether the ._ format supports the same 741 byte header format that ea:ad does; if not, several tools would have to be carefully adapted.
All ProDOS 8, and I think GS System Software before GS/OS 5, behaves the same. It converts them to uppercase before it makes any request for the file on the disk. Netatalk will try to go get whatever it's requesting, so if the file has a lowercase name in Linux, it can't find it.
Sure, I agree. The only way I could think of to do this would be to either to have Netatalk, if it fails to find a file, try it again in all caps before returning a file not found.
Correct, ProDOS 8 can't. Netatalk writes a 741-byte file header in .AppleDouble, followed by any resource fork data if there is one. The 741-byte file header contains all the file metdata including the ProDOS file type. It is a standard AppleDouble header in which Netatalk also writes some custom data into fields available for that. I found an email I wrote years ago that semi-documents it, and includes references. There's a specific format for indicating a ProDOS file typeand aux type written into the Mac file type field (even though AppleDouble defines fields for ProDOS types, Netatalk doesn't use it). Here's that email describing the .AppleDouble file: AppleDouble v2 reference: Netatalk CNID backend reference: It's possible to safely manipulate a file in the .AppleDouble folder of a directory to change the ProDOS Type and AuxType. A2SERVER's afptype tool does this. This makes it possible to introduce Apple II files from scratch on the Linux side, such as the required netboot configuration files. File metainfo (and resource fork, if any) is stored in the corresponding file in .AppleDouble. I traced through these files in a hex editor against Apple's ADv2 spec and found they conform nicely. In the file, nine specific AFP data fields are defined, and then there are four netatalk fields for the CNID database info (device, inode, db-stamp, and CNID). You can see all this presented neatly by running 'apple_dump' (one of the included netatalk utillities) on a file inside .AppleDouble. One notable thing in netatalk's AppleDouble implementation is that even though Apple defines a field defined specifically for ProDOS file access, type, and auxtype, it's empty. Instead, Netatalk uses the convention Apple uses in their ProDOS File System and PC Exchange extensions for Mac OS: ProDOS type and auxtype are stored in the Macintosh File Type as 'pXYY' where X is Type and YY is AuxType (big-endian), while creator is always 'pdos'. In principle, this makes it possible to see the type with 'ad ls -l' (in the files folder, not inside .AppleDouble) though since the Mac file types display as characters, it's not very helpful. It should also be possible to change them using the 'achfile' except that utility actually writes the type and creator in the wrong place! It's apparently out of date; perhaps it is for AppleDouble v1. The eight bytes for type/creator appear to be pretty consistently at offset $28D in the AppleDouble file, but rather than relying on that, you can actually figure it out by scanning the entry headers at the beginning of the file, looking for the one with type 9 (which corresponds to Finder Info), and then getting the offset from the bytes which immediately follow; this is what afptype does. As for the database, AFP refers to files by ID, so netatalk keeps the CNID database to map ID's to files. Each entry in the CNID database stores the device and inode of the data fork and the corresponding AppleDouble file, so when AFP asks for file 25 or whatever, the database can say "oh that's this file". If you bring in a file from elsewhere (that is, in the shell, via SMB, etc), there's not going to be a corresponding .AppleDouble file and the database won't know about it either, so you can run 'sudo dbd -r ' and it will solve both of those problems by adding an entry and creating the .AppleDouble file as needed. A2SERVER's "afpsync" utility is a front-end to this. So you need to run that first so you can have a .AppleDouble file to manipulate (it will have zeroes where the type/creator field goes initially). The only catch as far as a "bare Debian" install goes is that for dbd to work, there needs to be a /.AppleDesktop/.volinfo file, which is automatically generated the first time a user with write access logs in. Actually, it seems that .AppleDesktop is created on the first login, and then .volinfo is created on the second login (weird, I know, but I tried it a few times -- this was ProDOS 8 login, not GS/OS). .volinfo is a straightforward text file describing the volume properties which appears to be generated mostly from what's in AppleVolumes.default. afpsync will create .volinfo on demand, since Netatalk won't. |
On Wed, Oct 28, 2015 at 05:00:58AM -0700, IvanExpert wrote:
My understanding is that the workstation card had to do a fair bit of Whatever speed VSDRIVE operates at should be possible for the //c to Option #2 I can see for the //c would involve something like an AVR. AND, it'd be a solution that could be relatively easily adapted to Even if the Uthernet functionality couldn't be folded in, I'd be kind Thinking out loud.
I'm betting that 741 byte header is just AppleDouble metadata. I find http://forensicswiki.org/wiki/AppleDouble_header_file but the
Seems to be the same file as [this one][appledouble_pdf] I found
Followed by entry headers:
]appledouble_pdf]: http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf Hmm,
That looks awfully similar to what's described in the PDF. But not shrug I dunno. That file was written by afptype. I may need to
A flag for case insensitive globbing perhaps? This is somewhat Option #2 is for A2SHARED to be on a case-retentive-but-insensitive
I thought it might be done that way, but the AppleDouble docs say I really wonder if nobody but Apple (or nobody including Apple) is
It seemed like you ran afpsync before afptype in your scripts, I'd It also seemed that the first time I tried to open a .shk file, Joseph |
@IvanExpert it seems you recently asked me if you'd sent me some info on the installer scripts. You hadn't. Could you please post it here or send it to me and I can figure out the best way to post it is? Thanks. |
http://www.1000bit.it/support/manuali/apple/technotes/iigs/tn.iigs.064.htm |
Thanks, I'll have a look. Partly unrelated: I've just committed patches to ProDOS 8 (everywhere it lives in the NetBoot files) for the year table. I can't test the //e boot block because I don't have a //e with a workstation card or a //e card and an early Mac LC. Can you verify I basically didn't screw it up? :) If I didn't, I'll add it to the change log. |
Not immediately, but yes. Bear in mind that a IIe Card in an LC actually loads its Boot Blocks from local software on the Mac, so it doesn't precisely simulate the card. Year table is a good idea, but I'm a little anxious about it, only because then at this point we're no longer providing standard operating system software, which is one of my strong design goals. Is the year table change something widely understood and accepted? Is it documented? I don't even know specifically what it does, or what its consequences are and I've never used it before in any context. My strong preference would be to make this be an opt-in install option, rather than something everyone silently gets, so that those of us who'd rather have vanilla Apple provided OS can get it. Thinking we need a working document that articulates design goals. Being able to install an Apple-standard OS is one of them for me.
|
There's this: http://www.techtalkz.com/apple/435946-prodos-patch.html Perhaps not the best documentation I've found, but it did lead me to Of course you can't run the program on the netboot files because they Patching the splash screen date was not necessary. My thought there There's this, shared by Eric Rucker in response to me asking for http://mirrors.apple2.org.za/ground.icaen.uiowa.edu/MiscInfo/Prodos/p8date.patch Of course the table patched in 6.0.3 was done at compile time. |
Ok, so I've done a little research on this to figure out what the most appropriate A2SERVER behavior should be, and here's what appears to me to be the case. The year tables are ONLY relevant to users of a Thunderclock (or compatible) card on ProDOS 8, not GS/OS. That's the only card ProDOS provides a driver for, and it doesn't return year information, only day of week and date, so the lookup table is what ProDOS uses to determine the year based on that combo. In a leap year, the year/date combo would correspond to a day later in Mar-Dec, so leap years are entered twice, adjacently; this means that only six years may be represented in the table, or five if the range incorporates two leap years. If the range starts in a year before a leap year, the second leap year is broken in Mar-Dec, because there isn't an additional byte to represent it twice. The program CLOCK.PATCH on GS/OS SystemTools2 will calcluate the year table and patch PRODOS. For A2SERVER's purposes, patching the year table in the (net)boot blocks is only of benefit to real IIe users with both a Workstation Card and a Thunderclock (or compatible) card, and possibly users of the IIe Card for Mac, since that can emulate both. (I'm not aware of any software-only emulator that emulates the Workstation Card.) Other clock cards, including the IIgs clock, provide the year, and patch ProDOS with their own driver, so the year table is irrelevant for those. So, this is probably not life and death, and there's probably little point to even GS/OS 6.0.2 and 6.0.3 having a patched P8 file. With that said, there's also obviously no reason not perform the patch, so I'm going to revert the behavior to as you had it, Joseph, which is have it happen automatically without prompting. However, I'm going to port the CLOCK.PATCH program logic into the script, so it can calculate based on the current date, especially since the 6.0.2/6.0.3 year table is wrong for 2016 Mar-Dec. Of greater mystery is the 9-byte range at offset $26 (38) in ProDOS 2.0.3, which has also been changed in GS/OS 6.0.2, and again differently in 6.0.3. This appears to have been done by the authors of those -- it's not documented by Apple as far as I can tell, unlike the year table -- but I don't know what it does. 2.0.3/6.0.1: (1993-1998) 6.0.2: (2013-2018, with broken leap year (2016 Mar-Dec -> 2011) 6.0.3: (2013-2018, with broken leap year (2016 Mar-Dec -> 2011) |
If memory serves, I looked at this. If memory serves, you'll find When ProDOS is built, the current date for the splash is written in I set it to match 6.0.3 in my build when patching the year tables Patching the date on the splash screen affects nothing, it's just Joseph On Fri, Jan 08, 2016 at 05:14:00AM -0800, IvanExpert wrote:
|
I just checked it and I see what you mean! Ok, cool. Thanks for explaining. So I think, in the end, that a2server-setup should silently patch P8 and the boot blocks, as you had it; there's no actual reason to leave it as it ships, and I'm not sure how many people will even see it anyway. My inclination is to implement the logic of CLOCK.PATCH in the script so that a) it will be accurate even if it's run in 2019, and b) it fixes the broken 2016 leap year. (That kind of bothers me.) Do you agree? And, if so, is it preferable to you that the script also update the date on the splash screen, or should I leave it as it is (02-Aug-15)? |
If 6.0.3 is broken, then yeah, patch it. You can update the year or Joseph On Fri, Jan 08, 2016 at 06:10:25AM -0800, IvanExpert wrote:
|
Interestingly, I just discovered that "p8" on "Disk 7", while it contains ProDOS 2.0.3, has a splash screen stamp of 02-Apr-93, unlike the 06-May-03 that's in GS/OS 6.0.1 and Apple II System 4.0.2. |
That's what I was saying. :) Joseph
|
This may not be a neat Python tool by then, but breaking the install script tool out of the netboot script is slated for 2.0.0. |
In other words, break out the guts of what's already in a2server-5-netboot for general purposes.
The text was updated successfully, but these errors were encountered: