diff --git a/docs/ivanx/README.md b/docs/ivanx/README.md deleted file mode 100644 index a93ccfe..0000000 --- a/docs/ivanx/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Ivan Drucker's A2CLOUD setup - -A2CLOUD grew up alongside A2SERVER, yet it ends up being substantially -different in many ways. Eseentially, it looks like Ivan wrote most of the -HTML for A2SERVER first, but had to rewrite the scripts a few times to be more -legible and robust. - -A2CLOUD, by contrast, had a wordpress blog category turned into a user guide. -The HTML was more "proper" by modern standards (and HTML5-based rather than -HTML 3.2), but the scripts seem to be older and less refined. This can be -likely attributed to A2SERVER requiring more debugging and therefore more -effort to flesh out quickly bodged scripts into readable, debuggable pieces. - -There's less documentation here to archive than there is the original A2CLOUD -setup that began this repository, but having it helps inform some design -decisions. So it's included here for completeness. diff --git a/docs/ivanx/index.md b/docs/ivanx/index.md deleted file mode 100644 index d0c4e49..0000000 --- a/docs/ivanx/index.md +++ /dev/null @@ -1,1600 +0,0 @@ -# [A2CLOUD][1] - - - -* [love and hate mail: ivan@ivanx.com](mailto:ivan@ivanx.com) - - -## Table of Contents - -* [A2CLOUD: intro][2] -* [A2CLOUD: what you need][3] -* [A2CLOUD: prepare your Pi][4] -* [A2CLOUD: go headless (optional)][5] -* [A2CLOUD: install the software][6] -* [A2CLOUD: attach your cables][7] -* [A2CLOUD: make your boot disk][8] -* [A2CLOUD: use virtual drives!][9] -* [A2CLOUD: log in from your Apple II][10] -* [A2CLOUD: make a floppy or image][11] -* [A2CLOUD: learn some Unix][12] -* [A2CLOUD: “insert” a disk image][13] -* [A2CLOUD: connect with other people][14] -* [A2CLOUD: browse & download][15] -* [A2CLOUD: use disk images][16] -* [A2CLOUD: expand archives][17] -* [A2CLOUD: transfer files][18] -* [A2CLOUD: increase serial port speed][19] -* [A2CLOUD: emulate an Apple II][20] -* [A2CLOUD: Apple II Pi][21] -* [A2CLOUD: release history and notes][22] -* [A2CLOUD: other stuff][23] - - - -# A2CLOUD: intro - -Hello, and welcome to A2CLOUD! It provides any Apple II — even a IIc — with -internet access, mass storage, and floppy disk transfer, via a [Raspberry -Pi][24], a tiny silent $35 computer. You can also use A2CLOUD with other Linux -computers or virtual machines; [click here][25] for details. - -This web page is the user guide; just read the posts in order. The table of -contents is over on the right. You might want to start with the intro video -below. (For other ways to use your Raspberry Pi with your Apple II, check -out [A2SERVER][26], and [Apple II Pi][27], both part of [Raspple II][28].) - -*5-May-15: A2CLOUD 1.8.1 is available, featuring compatibility with every -Raspberry Pi including Raspberry Pi 2 Model B and Raspberry Pi 1 Model A+, and -non-Pi users now get the GSport emulator. If you already have A2CLOUD -installed, type `a2cloud-update` to update, or start over with the [Raspple -II][28] easy installation method (or upgrade Raspple II with `a2cloud-update -os`). The complete version history is [here][22].* - -[![YouTube: A2CLOUD setup part 1: intro and demo][v_img01]][video01] - -[v_img01]: http://img.youtube.com/vi/kYkOxe4mjHg/0.jpg -[video01]: http://www.youtube.com/watch?v=kYkOxe4mjHg - -This entry was posted on July 14, 2013 by [ivanx][29] - - - -# A2CLOUD: what you need - -To use A2CLOUD, you need various things. Here’s a video to show you what -goes where, followed by your shopping list. (Don’t pay much attention to -2:00 through 6:00, as it’s now much simpler to set up A2CLOUD than when -I made the video.) - -[![YouTube: A2CLOUD setup part 2: configure your Raspberry Pi][v_img02]][video02] - -[v_img02]: http://img.youtube.com/vi/saIdvQNgm3c/0.jpg -[video02]: http://www.youtube.com/watch?v=saIdvQNgm3c - - -Places to purchase are linked: - -* for virtual drives, any Apple II model with Applesoft - -* for internet, an Apple IIc, IIgs, or 128K Apple IIe enhanced (though Apple - II Plus and unenhanced IIe [might work][30]) - -* any Raspberry Pi, B/B+ models recommended -  ([buy direct from distributor][31], or at Amazon: [Pi 2 model B][32], - [Pi 1 model B+][33], [Pi 1 model B][34], [Pi 1 model A+][35]) - -* a [4 GB or larger SD card][36] ([8 GB or larger][37] recommended) -* a [good power supply][38] with a micro-USB plug that provides at least 1A of - current - -* an [ethernet cable][39] attached to your router, or a - [Wi-Fi adapter][40] (more complex) - -* a [null modem Apple II serial cable][41] (or: [roll your own][42]) - -* a [USB-to-serial adapter][43] - -* a [Super Serial Card][44], if you have an Apple IIe (see note below) - - -If you want simultaneous virtual drives and internet access from your -Apple II: - -* another [null modem Apple II serial cable][41] (or: [roll your own][42]) - -* another [USB-to-serial adapter][43] - -* another [Super Serial Card][44], if you have an Apple IIe (see note below) - - -Optional items: - -* an [SD card reader][45] to prepare the SD card, if your computer doesn’t - have one - -* a [USB keyboard][46] and possibly [mouse][47] (or: you can - [control the Pi from another computer][5]) - -* a [*powered* USB hub][48] (if you don’t have a free port for a USB-to-serial - adapter) - -* an [Apple II Pi card][49], or another [Super Serial Card][44] with a - [Raspberry Pi Console cable][50], if you want to use [Apple II Pi][21] - - -If you have a straight-through serial cable rather than a null modem serial -cable, and you are using a IIgs or IIc (no Super Serial Card), you can use a -[DE-9 (aka DB-9) male-to-female null modem adapter][51]. - -If you have a Super Serial Card, its jumper block needs to point towards -“Modem” if you have a null modem cable, or “Terminal” if you have a -straight-through cable. (Or, if you are using it with a Raspberry Pi console -cable, that acts as a null modem cable, so reverse the jumper positions -described here.) - -(A note about the USB-to-serial adapter: there are lots of different brands -and models of these. The only ones I have ever tested, including the TRENDnet -model linked above, are those based on the Prolific PL2303 chipset. Other -models based on other chipsets such as FTDI may also work; I just haven’t -tried them.) - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: prepare your Pi - -### Starting Fresh - -If you have never used your Pi, you will need to prepare your SD card. -Download [Raspple II][28] (a distribution of the Raspbian operating system -with Apple II goodies preinstalled), and expand the .zip file. Copy all of its -files to a 4 GB or larger SD card (8 GB or larger recommended). Then put the -SD card in your Pi, and attach power. The operating system will automatically -install, which will take about 20 minutes. If you don’t have a screen attached -to your Pi, you’ll know when it’s done when the ACT/OK lamp on the Raspberry -Pi board stops flickering. - -(If you are starting over with the same SD card, or want to ensure the card is -formatted correctly, you can use the official [SD Formatter][51]  utility — -carefully! — before copying the files.)   - -### If you’re already up and running, or want to customize the installation - -You can also install A2CLOUD from the Raspbian command line. Type: - -~~~ bash -wget appleii.ivanx.com/a2cloud/setup; source setup -~~~ - -If you want all the features, answer “Y” to the questions. Then be patient, as -it takes a little while to install. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: go headless (optional) - -For basic A2CLOUD use, I recommend going headless with your Raspberry Pi — -that is, using it without a screen and keyboard. This will keep your USB ports -free and reduce clutter, plus make it feel more like an Apple II -peripheral. It’s pretty doable because you can always display your Pi’s screen -on a newer computer on your network, and you can even log into its command -line from your Apple II. - -With that said, you may want a screen and keyboard attached if you want to use -[Apple II Pi][21], or you just feel more comfortable using it that way. So if -you’re not ready to go headless, you can skip the rest of this post. - - -### Log in to the Pi’s command line: - -If you’re gonna go headless, then you’ll need to take a few steps so that you -can control your Pi from another computer, which could be an Apple II, as I’ll -explain in a few posts. But you can also use a current-day computer on your -network. - -On a Mac, open Terminal (in the Utilities folder of the Applications folder), -and at the prompt, type `ssh pi@raspberrypi.local` to connect. If you have -Windows, you can install [Bonjour Print Services][52], and then use -[PuTTY][53] to connect to the address “raspberrypi.local”. - -If that doesn’t work, try updating A2CLOUD by typing `a2cloud-setup`. If it -still doesn’t work, or you don’t want to install Bonjour Print Services for -Windows, you will need to find your Pi’s IP address and use that instead. If -you have a Mac, you can use [Pi Finder][54] to help with this; if you have -Windows, you can use [Advanced IP Scanner][55]. - -The username is “pi” and the password is “apple2″ (or instead “raspberry” if -you installed a fresh copy of Raspbian, rather than Raspple II). You should -arrive at the Linux prompt. - - -### Remotely Access the Raspbian desktop - -You can access the Raspbian graphical desktop by using remote desktop -software. Use the Remote Desktop Connection application included with -Microsoft Windows, or its [Mac version][56], to connect to your Raspberry Pi -by putting in “raspberrypi.local”, or your Pi’s IP address. (If you would -prefer to use a VNC client, [configure tightvncserver][57]. You could also use -RDP or VNC clients for other platforms, like iOS and Android.) - - -### Get a consistent IP Address - -If “raspberrypi.local” doesn’t work for you for some reason, and you don’t -want to have to use Pi Finder or Advanced IP Scanner every time you want to -log into your Pi, I suggest you create a DHCP reservation in your router. This -will make your router give your Pi the same IP address every time. Every -router’s configuration screen is a little different, but they all require the -same things: the 12-digit MAC (ethernet hardware) address, and the IP address -that should be assigned to it. - -Pi Finder and Advanced IP Scanner give you this info. Alternatively, from your -Pi, type `ip addr` and you’ll find the MAC address as six pairs of digits -separated by colons, in a line that starts with “link”, and the IP address as -four numbers separated by periods immediately after the word “inet”. If you -need help creating DHCP reservations on your particular router, check the -manual, or Google for it. - -If your router can’t provide a DHCP reservation, you can alternatively -configure your Pi to have a static IP address (which is permanently set, -rather than asking your router for it) via the method discussed [here][58]. - -  -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: install the software - -If you used the [Raspple II][28] installation method, you’ve already installed -the A2CLOUD software, and can skip the rest of this post. - -If you don’t have A2CLOUD installed yet — because, for example, you installed -vanilla NOOBS or Raspbian, rather than Raspple II — log in to your Pi, and at -the Linux prompt type: - -~~~ bash -wget ivanx.com/a2cloud/setup; source setup -~~~ - -A2CLOUD is confirmed to work on Debian 7 (“Wheezy”), all releases of Raspbian, -and possibly earlier versions of both. It is believed to work on other Debian -derivatives, such as Ubuntu 14.04 LTS. (A2CLOUD does not yet fully work on -Debian 8 or Ubuntu 15.04, or other distributions that use systemd.) - -Follow the prompts; I suggest you answer “yes” to all of them, and everything -on these pages will assume that you have. When you are asked to specify the -size of your virtual disk (in KB), keep in mind that the larger it is, the -slower it will be; hopefully this will change in the future. - -When it’s done, the A2CLOUD installer will ask you to reboot your Pi. Do so, -and wait about two minutes for it to complete. (If you’ve got a screen -attached, wait until it shows you the login prompt; you don’t actually need to -log in.) - -You’ve now got your Raspberry Pi providing virtual drives and internet access -for your Apple II! - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: attach your cables - -Figure out which of the following scenarios applies to you, and attach your -USB-to-serial adapter(s) according to the options you see. - -If you are using a Raspberry Pi with four USB ports, then use the pair of USB -ports next to the Ethernet port, not the ones in the corner. - -If you are using a Raspberry Pi model A or A+, consider its one USB port to be -the “lower” port in the instructions below. If you have a USB hub attached to -it, then port 2 on that hub is the “upper” port, and port 3 on that hub is the -“lower” port. Since the physical ports these correspond to may vary by hub, -you may need to try different ports to figure out which is which. - -You’ll see mentioned below the “lowest-numbered” or “highest-numbered” port in -a USB hub, which isn’t necessarily obvious. If you have a USB hub, try the -leftmost or topmost port, and if that doesn’t work, try the rightmost or -bottommost port. If you want to definitively know, see the note at the end. - -If you have an Apple IIe, then “printer port” or “modem port” means a Super -Serial Card in slot 1 or 2, respectively. - - -### You have one USB-to-serial adapter, and want to use it for virtual drives - -You can use: - -* the lower USB port - -* any port in a hub on the lower USB port if it is the only USB-to-serial - adapter in the hub - -* the lowest-numbered port on a hub with multiple USB-to-serial adapters - - -Connect the adapter to a serial cable attached to to your Apple II modem port. - - -### You have one USB-to-serial adapter, and want to use it for internet - -You can use: - -* the upper USB port - -* any port in a hub on the upper USB port if it is the only USB-to-serial - adapter in the hub - -* the highest-numbered port on a hub with multiple USB-to-serial adapters - - -Connect the adapter to a serial cable attached to to your Apple II printer -port. - - -### You have two USB-to-serial adapters - -Do both of the above. - - -### How to figure out the lowest or highest numbered port on your USB hub - -You can attach two USB-to-serial adapters to a USB hub attached to either USB -port on the Pi. A2CLOUD tells them apart based on their being attached to a -lower numbered port for virtual drives, and a higher numbered port for -internet. - -I did it this way so you can simply try the ports at either end of the USB hub -and see if you get the results you expect. But If you want to know the actual -port number, detach all of your USB-to-serial adapters, then plug in one -adapter. Then type `ls /dev/ttyUSBlower_hub*` and see what it shows you. The -number at the end is your USB port number. You can then move the adapter to a -different port and repeat until you figure out which one is the lowest and -which one is the highest. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: make your boot disk - -You’re almost ready to use virtual drives, courtesy of David Schmidt’s -[VSDRIVE][59], which is included with [ADTPro][60]. You can also use ADTPro -itself to transfer disk images to actual disks, and vice versa. - -To access the virtual drives, you need to boot from the A2CLOUD disk. To get -that, you need ADTPro to transfer it to an Apple II floppy. If you’ve already -got ADTPro on an Apple II disk, boot it (choose Serial if prompted), and skip -the video and the paragraph which follows it. Or, if you’ve got some other -means of turning disk image files into floppies, you can download the -[140K A2CLOUD boot disk][61] or the [800K A2CLOUD boot disk][62], and skip the -rest of this post. - -If you don’t have ADTPro on an Apple II disk already, you need to get it -running on your Apple II via a process called bootstrapping. Here’s a video to -show you how to do that, or you can read the instructions below it. - -[![YouTube: A2CLOUD setup part 3: making your boot floppy][v_img03]][video03] - -[v_img03]: http://img.youtube.com/vi/iOKIQNF8sZY/0.jpg -[video03]: http://www.youtube.com/watch?v=iOKIQNF8sZY - - -First, turn on your Apple II and press ctrl-RESET before DOS or ProDOS can -load. Next, if you have a screen, keyboard, and mouse attached to your Pi, -type `startx.` Otherwise, log in with Remote Desktop Connection (as described -in [A2CLOUD: go headless][5]) from another computer. Once you see the -desktop, double-click ADTPro Server, and when the ADTPro server window -appears, choose Bootstrapping->ProDOS->SpeediBoot and follow the -instructions which pop up. When you get to the “LOADING MLI” phase on your -Apple II, nothing may appear to happen for several minutes; just be patient -and it will eventually kick in. (You can alternatively choose -VSDRIVE+SpeediBoot to immediately gain access to the virtual drives, but as -soon as you reboot, you’ll need to bootstrap again. It’s much more convenient -to have a boot floppy.) - -Once you’ve ADTPro running, put in a blank floppy disk and type F to format it -(unless you know it’s already formatted). You can use any volume name. When -it’s done, type R to receive, and then enter (in all caps) A2CLOUD.DSK for a -5.25″ drive or A2CLOUD.PO for a 3.5″ drive. The A2CLOUD disk will be copied -from your Pi to your Apple II. (You can use ADTPro to transfer any other disk -images to or from your Pi at any time.) - -If you bootstrapped, once you’ve got your A2CLOUD disk, you can leave the -ADTPro server window open, or reboot your Pi. If you close the window, or quit -the Raspbian desktop without rebooting, ADTPro server will no longer be -running; you can type `adtpro-start` at a prompt to get it going again, or -reboot, or disconnect and then reconnect the USB-to-serial adapter on the -lower USB port. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: use virtual drives! - -Ok, almost there. Fire up your A2CLOUD floppy, and at the welcome screen, type -V. (If you are at an Applesoft prompt, you can instead type `-VSDRIVE`.) - -Once you’ve done this, you can access your blank virtual disk on slot 2 drive -1, and the 800K version of the A2CLOUD disk on slot 2 drive 2. Check it out -by typing `CAT,S2,D2`. After specifying the slot and drive, they will stick -for subsequent [ProDOS commands][63] (that’s a quick list; here’s a -[full manual][64]). You will no longer have access to slot 6. To regain -access to slot 6, do a full reset of your Apple II and boot any ProDOS disk as -usual. - -You can also run VSDRIVE from a ProDOS 8 program launcher (e.g. the `BYE` -command). Nothing will appear to happen, but your virtual drives will become -available. (If you don’t see VSDRIVE when you’re not in BASIC.SYSTEM, update -ADTPro by typing `a2cloud-update`.)` ` - -If you need access to both slot 6 and the virtual drives at the same time, you -can, after booting, type: - -~~~ --VSDRIVE.LOW -~~~ - -However, this version of the driver for the virtual disks is easily -overwritten by other software, especially if you exit BASIC.SYSTEM. However, -ProDOS Filer works ok, so it is included on the A2CLOUD disk if you need to -transfer files from slot 6 to a virtual drive. Just type `-FILER` to use it. -Note that if you’re transferring from the A2CLOUD floppy disk to the virtual -A2CLOUD disk (in S2,D2 by default), you’ll first need to rename the volume of -your boot floppy to something like A2CLOUD.DISK, so Filer can tell it apart -from the volume named A2CLOUD in the virtual drive. - -If you think Filer sucks, because it does, you can instead use ADTPro to -transfer your entire 5.25″ disk to a new disk image on your Pi that you can -use with VSDRIVE, or experiment with other copy programs. - -You can also change the virtual drives to use different images, which I’ll -explain in a later post. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: log in from your Apple II - -If you’re happy enough controlling your Pi with a screen or keyboard attached, -or by logging into it from another computer, then you don’t really need to -read any of this post. But it’s *more fun* to log into it from your Apple II. -You try it. - -To do that, you’ll need terminal communications software which supports VT-100 -emulation. The A2CLOUD installer provides both [ProTERM][65] and Z-Link for -IIc, IIgs, and enhanced IIe; GS/OS users can also download and use -[Spectrum][66] for color and graphic text. Apple II Plus and unenhanced IIe -users have some options too. - -Once you’ve connected with your terminal program — specifics are below — press -return a couple of times, and you should see the Raspberry Pi login prompt. -Log in with username `pi` and password `apple2` (or `raspberry`, if you -installed standard Raspbian). You should be taken to the Linux prompt. If you -quit your terminal program, and then run it later, you’ll be right where you -left off — you won’t have to log in again unless you restart your Pi. - -Then you can download files and transfer them into your disk images or to your -Apple II, and do other stuff on the internet. More on how in a future post. -(Once you’ve got one of the below terminal programs working, you may also want -to try out a [faster serial port rate][19] than the default 4800 baud.) - -Once you get comfortable with logging in, you might want -multiple terminal screens you can switch freely between. To do this, -type `screen`. Then, whenever you need a new screen, type ctrl-A followed by -C. You can go back to a previous screen with ctrl-A followed by P, or forward -to the next screen by typing ctrl-A followed by N.  To close a screen, -type `exit` or ctrl-A followed by K. When you close the last screen, Screen -quits. All Screen commands start with ctrl-A; for a full list of commands, -type ctrl-A followed by a question mark. A well-written, easy-to-follow guide -on how to get the most out of Screen is [here][67]. - -  -### ProTERM - -ProTERM is a robust and recommended terminal program, but it does not fit on -the 140K A2CLOUD disk, and it needs to stay in the drive (or virtual drive) -while being used. You’ll find it on the 800K disk, or the S2,D2 virtual drive. -When ProTERM runs, select the “Null Modem (CTS/RTS)” driver and the -IIgs/IIc/IIc+ printer port, or a Super Serial Card in slot 1. (Note that if -you use your own copy of ProTERM, the IIc/IIc+ printer port is not listed, so -for that machine you’d need to use the copy that A2CLOUD provides; thanks to -Hugh Hood for this patch.) For printer, select No Printer In System. When -you’re ready to connect, choose Parameters from the Online menu, choose 4800 -baud and VT-100 emulation, hide the status bar, and select Line Status: -Online. (Thanks to Tony Diaz and Intrec Software for making ProTERM free to -the community.) - -  -### Spectrum - -[Spectrum][66], for the Apple IIgs, is not provided on the A2CLOUD disk, -[but is freely available for download][68]. From the Settings menu, choose -Port and select the printer port at 4800 baud. Then in the Settings menu, -choose Online Display and select VT-100 (monochrome text), or ANSI (color and -graphic text, though slower). Then from the Show menu, choose Online Display. -If you are using ANSI, type `term color` after logging in, or `term -d color` -if you don’t want to do it every time. You can also type `term mono` if you -want to switch it back for use with other terminal programs. When you’re done, -type Apple-W to “close” the display. (Thanks to Ewen Wannop for making -Spectrum free to the community.) - - -### Z-Link - -Z-Link is provided on both the 5.25″ and 3.5″ versions of the A2CLOUD disk. -While not quite as capable as ProTERM, it is able to fit on a 5.25″ disk and -is self-contained in memory without needing further disk access. When you -first run Z-Link, you need to configure it by pressing openApple-W and -choosing 4800 baud, slot 1. Then press openApple-T until VT-100 emulation is -enabled. Finally, press open-apple-S and type the file name `Z.LINK.CONFIG` to -save the configuration and have it be loaded whenever you run Z.LINK. - -If you want to run Z-Link from a virtual drive, you need to first copy -Z.LINK.CONFIG from your floppy, because otherwise it will go online -immediately using slot 2, which makes the virtual drive stop working. Boot -your A2CLOUD disk and set it up as above. Then, at the Applesoft prompt, -type `-VSDRIVE.LOW` followed by `-FILER`. Once in Filer, rename the volume of -your A2CLOUD floppy to A2CLOUD.DISK, then copy /A2CLOUD.DISK/Z.LINK.CONFIG to -/A2CLOUD/Z.LINK.CONFIG. - - -### Apple II Plus and unenhanced IIe - -If you have an Apple II Plus or unehnanced IIe, there have been reports -of success with using [Kermit 3.87][69], or DCOM 3.3, -for terminal access to your Raspberry Pi. They need to be set for VT-100 -emulation, and on an Apple II Plus you need a Videx VideoTerm (but not -UltraTerm) for 80 column support. I haven’t tried them, but [here’s the -relevant discussion thread][70]. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: make a floppy or image - -If you have [A2SERVER][26] installed — which you do if you installed A2CLOUD -with [Raspple II][28] — it’s easy to download software with your modern -computer and turn it into a floppy disk with your Apple II, or use it as a -virtual drive. And it’s just as easy to make an image from an Apple II floppy -that you can use in an emulator on your modern computer. - -(If you don’t have A2SERVER installed, you can start over with -[Raspple II][28], or you can, at your Raspberry Pi’s prompt, type `wget -ivanx.com/a2server/setup; source setup` to install it. If you’re not sure, -type `a2server-help`; if you get a help screen, you’ve got A2SERVER.) - -On your newer computer, you can browse your network and you should see - “raspberrypi” as a server you can connect to. You can log in as Guest if -asked. - -On Mac OS X, it should appear under Shared in the sidebar of a Finder window, -or under “Network” from the “Go” menu of the Finder. On Windows, it should -appear under Network. On Mac OS 7 through 9, open Chooser from the Apple menu -and click on AppleShare. - -(If you can’t browse to the server on your network, try typing -`a2server-setup` to update it, and if that doesn’t work, type `showip` to get -your Pi’s IP address. On Mac OS X, enter the IP address under “Connect To -Server…” from the Go menu of the Finder; on Windows, type the IP address -following two blackslash characters (\\) in an Explorer window.) - - - -Open the ADTDISKS shared volume and copy any disk images you want to make into -disks in there. - -Then run [ADTPro][60] on your Apple II, which is on your A2CLOUD boot disk. -Type R to receive, and type the name of the image file (case matters), and -then choose the drive containing the disk you want to put the image onto. The -disk will be erased, so be careful. Also, if you were using VSDRIVE before -you ran ADTPro, you might not have access to slot 6; if you need it, reboot -and then run ADTPro. - -If you want to turn a disk into an image, do the reverse process: type S to -send in ADTPro, and then choose the drive you wish. The image will appear in -the ADTDISKS network volume on your newer computer. - -You can type D for directory in ADTPro to get a listing, but characters are -sometimes missing, so you might need to do it a few times, or refer to the -ADTDISKS network volume on your newer computer. - -Unix-type computers can also use `scp` to copy files to and from A2SERVER; -Windows computers can also do so in the command window by using `pscp` -in [PuTTY][53]. The shared volume is at /media/A2SHARED/ADTDISKS. - - -This entry was posted on July 14, 2013 by [ivanx][29]. - - - -# A2CLOUD: learn some Unix - -Once you’re logged into your Raspberry Pi, you can download disk images and -use them with VSDRIVE or transfer them with ADTPro. - -To do so, you’ll need to know some Unix. Everything you type at a prompt is a -Unix command, either built-in, or a program that gets executed. Most commands -can take additional arguments (parameters) separated by spaces to modify how -they operate. Note that everything in Unix is (usually) case-sensitive — that -is, “ls” is not the same thing as “LS”. - -Here’s some basics: - -`pwd` will print the path of the current directory (like PREFIX) - -`cd /path/name` will change the directory to /path/name (like PREFIX -/PATH/NAME) - -`ls `will list the files in the current directory (like CAT) - -`ls -lp` will list the files in the current directory in long format (like -CATALOG) - -`cp sourceFilePath targetFilePath` will copy a file - -`mv filePath newFilePath` will move or rename a file (like RENAME) - -`rm filePath` will delete a file (like DELETE) - -`mkdir dirPath` will create a subdirectory (like CREATE) - -`rmdir dirPath` will delete a subdirectory (like DELETE) - -`logout` logs you out - -`sudo shutdown -h now` will shut down your Pi - -`sudo shutdown -r now` will restart your Pi - - -There are also three “special” directories, indicated by a single or double -period, or a tilde: - -`.` means the current directory - -`..` means the parent (enclosing) directory - -`~` means your home directory (on the Pi’s default user, it’s /home/pi) - - -A couple of tips: - -pressing up-arrow (or solidApple-up-arrow in ProTERM on a IIe/IIc, or in -Z-Link)  at the command prompt will display previously typed commands - -pressing ctrl-A while editing a command will take you to the beginning of a -line - -pressing ctrl-E while editing will take you to the end of a line - - -A2CLOUD provides some specialized commands as well, some of which will be -covered in upcoming posts. To see a full list, type `a2cloud-help`. - -If you need additional explanation of a command and its arguments, you can -sometimes type “command -h” or “command –help”, and for most commands, -extensive help is available by typing “man command”. - -This is just the tip of the iceberg. There are lots and lots of Unix commands -for every purpose imaginable. If you think there are others which should be -included here, please mention them in the comments. - -  -This entry was posted on July 15, 2013 by [ivanx][29]. - - - -# A2CLOUD: “insert” a disk image - -To make things easy, A2CLOUD has commands to “insert” disk image files into -the virtual drives: - -`vsd1 imageFileName` will “insert” imageFileName into S2,D1 - -`vsd2 imageFileName` will “insert” imageFileName into S2,D2 - -`vsd1` or `vsd2` by itself will show you the path to the disk image currently -“in” the drive - -Note that the disk image you “insert” can be either DOS-ordered or -ProDOS-ordered. VSDRIVE will figure it out. The disk doesn’t need to even -contain ProDOS, as long as you’re using ProDOS software which can access it — -for example, System Utilities can copy files from a DOS 3.3 or Pascal image. - -To make new image files, you can transfer real floppy disks from your Apple II -using ADTPro. These will arrive in /usr/local/adtpro/disks, which you can also -refer to as $ADTDISKS for short; if you have A2SERVER installed, this folder -is also available [on your network][11] to other computers, so you can use the -images you create with an emulator. - -Also from another computer, you can copy an image into the ADTDISKS network -folder and then insert it into a virtual drive by typing `vsd1 -$ADTDISKS/imageFileName`. (For virtual drive 2, use `vsd2` instead.) Or you -can download disk images from the internet directly on your Pi, which I’ll -explain in a later post. - -You can always put the A2CLOUD disk image back in virtual drive 2 with: - -~~~ bash -vsd2 $A2CLOUD -~~~ - -(The `vsd1` and `vsd2` commands create a symbolic link, which is like a -Windows shortcut or Mac alias, to whatever file you specify as imageFileName. -The symlinks are in /usr/local/adtpro/disks, and are called Virtual.po or -Virtual2.po, respectively.) - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: connect with other people - -Once you’ve logged into your Pi — that could be from your Apple II using -ProTERM or Z-Link or Spectrum, or with a directly attached keyboard and -screen, or via SSH from another computer — you can start communicating on the -internet. - -Unless you’re using ProTERM or Spectrum on an Apple IIgs, *remember to hold -down solidApple when pressing the arrow keys* when you’re using these -programs. - - -### IRC (Internet Relay Chat) - -If you want to chat live with other Apple II people, all you need to do is -type `a2chat`. It will launch an IRC program called Irssi and connect you -directly to the #a2c.chat channel. (If you want to connect to other channels, -instead type `irssi`.) Type `/quit` when you’re done. You might want to check -out more detailed instructions for [IRC generally][71] or -[Irssi specifically][72]. - - -### Usenet newsgroups (discussion boards) - -To access the Apple II discussion boards on Usenet (often referred to as -comp.sys.apple2.\*), type `a2news` and it will start the Tin newsreader. You -will be subscribed to only the Apple II newsgroups by default; to access all -the other ones, type Y (for “yank”) and subscribe to the ones you like. (If -you have a preferred NNTP server you would like to use, you can set it by -typing `a2news -s your.server.address`.) - - -### Twitter - -You can indeed tweet from your Apple II, if you can believe it. Type `ttytter` -and follow the instructions. For initial setup, you’ll need to sign in to your -Twitter account from a web browser, which, if you don’t want to leave your -Apple II, could be Lynx, as I will explain in the next post. If you need -help, an [extensive manual][73] is available for TTYtter. You can also try -starting it by typing `ttytter -readline` for enhanced input, though it is -beta and may have problems. - - -### Email - -There are email programs you can use, but they can be challenging to set up, -so they have not formally been made a part of A2CLOUD for the moment. If you -want to give it a go, [see this comment][74] to get started, and look for help -on Linux forums if you need it. - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: browse & download - -If you want to get new Apple II software, there are a few ways to go about it. - -You could try a desktop browser on the Pi, such as the included Epiphany -(a.k.a. Web), Midori, or Netsurf, or install an alternative such as -[Chromium][75], the open-source cousin of Google Chrome, or [Iceweasel][76], -which is a rebranded Firefox. - -You can also download with a modern computer, and [copy to your Pi over your -network][11]. If you don’t want to immediately create a real floppy, see the -next post for what to do with your downloads. - -Or, for maximum fun, you can browse and download with your Apple II, -because A2CLOUD provides you with the stuff on your Pi that you need. My -general advice here is to just dive in and try these out if you’re not -familiar with them. You’ll find no shortage of help for most of these if you -search for it. - -Unless you’re using ProTERM or Spectrum on an Apple IIgs, *remember to hold -down solidApple when pressing the arrow keys* when you’re using these -programs. - -  -`lynx`\: a text-only web browser which can access simply laid out sites. -Examples: `lynx ivanx.com`, or a download site, like `lynx -mirrors.apple2.org.za`. ProTERM and Spectrum work better for lynx than Z-Link -does. (You can also try out [alternative text-only web browsers][77].) - -`links`\: another text-only web browser you might, or might not, prefer to -Lynx. If you see only a black screen when you start it, press the ESC key to -see the menu. - -`cftp`\: What you’ll probably spend a lot of time using if you want new Apple -II software. It’s for logging into FTP (File Transfer Protocol) servers. -Unlike the traditional command line FTP program, cftp is full-screen, uses the -arrow keys, and is easy. Example: `cftp ftp.gno.org` - -`ftp`\: The traditional command line FTP program. Example: `ftp ftp.gno.org`. -It uses (mostly) typical [Unix commands][12]. When asked for username, enter -“anonymous” and then anything for the password. Use the usual directory -listing and navigation commands (`cd`, `pwd`, `ls`), to browse the site, -then `get filename` to download a file from a site, or `put filename` to -upload a file to a site. To see the current local directory (the one you’ll be -downloading into or uploading from), type `!pwd`, and to change it, type `lcd -directoryPath`. You can see all commands by typing `help`. - -`wget`\: a simple program that can download a full URL from an FTP or web site -in a single command, e.g: `wget -http://appleii.ivanx.com/slammer/files/SLAMMER111P.DSK` - -  -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: use disk images - -Once you’ve [downloaded stuff to your Pi][15], or [copied stuff on to it from -another computer on your network][11], you can [immediately use the `vsd1` or - `vsd2` commands][13] for an uncompressed disk image file (.DSK, .DO, .PO, -.RAW, .HDV, .2MG. ISO) containing ProDOS files, and then access them from your -Apple II. The image file will be “inserted” into virtual drive 1 or 2, and -accessible from VSDRIVE at S2,D1 or S2,D2. - -If what you download is an archive file (.SHK, .SDK, .BXY, .ZIP, .TAR.GZ, -etc.), you’ll need to expand it first, which you can read about how to do in -the next post. - -If you’re not sure whether the disk image you downloaded is ProDOS format or -not, you can type `a2cat imageFileName` on your Pi, and it will catalog the -disk and tell you the format at the bottom of the listing. - -If it’s a DOS 3.3 disk, you can type `dos2pro imageFileName` to copy the files -to a new ProDOS  image, or `dos2pro imageFileName DOSFILENAME` to copy a -single file. Some programs may not work when copied to ProDOS. - -Or, you can use ADTPro to transfer the image file to a floppy disk. To make a -disk image available to ADTPro, you need to move it into into the ADTPro disk -images directory (/usr/local/adtpro/disks) by typing `forfloppy -imageFileName`. To access the files inside that directory, you can also refer -to it as $ADTDISKS (e.g. `ls $ADTDISKS`). - -You can also use `vsd1` or `vsd2` for non-ProDOS disks, but you won’t be able -to access them from within ProDOS. However, you can use a ProDOS utility which -knows how to access the format (e.g. System Utilities can copy files from DOS -3.3 and Pascal disks). - - -### Some commands for working with Apple II disk images: - -`mkpo -b totalBlocks newImageFileName PRODOS.VOL.NAME` will make a new disk -image that has the capacity specified in `totalBlocks`. (A block is 512 bytes, -or half a KB.) The maximum block count is 65535, though if you plan to use the -disk image with VSDRIVE, a realistic maximum is 8192. If you omit `-b -totalBlocks`, you’ll get an 800K disk image, unless your image name ends in -“.dsk”, in which case you’ll get a 140K disk image. You can also -omit `PRODOS.VOL.NAME` to get an untitled disk image. - -`dopo imageFileName` will convert a DOS-ordered 140K disk image to a -ProDOS-ordered image, or vice-versa. The original ordering will not be kept. - -`acmd` will do lots of stuff with Apple II disk images (many formats, -including ProDOS, DOS 3.3, and Pascal, are supported). Type `acmd` by itself -to see usage; syntax for copying files in and out of images will be mentioned -in the next post on transferring things to your Apple II. (`cppo` is an -alternative, but it’s even slower. It does preserve dates, however.) - -`$VSD1` and `$VSD2` can be used in commands to refer to the disk images -assigned to virtual drives 1 and 2, rather than typing out the full path. - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: expand archives - -If you have an archive file, on your Pi, you’ll need to expand it. - -Commands for general archive formats: - -`unzip archiveFileName` will extract files from a .zip archive - -`gunzip compressedFileName` will uncompress a .gz compressed file - -`tar xf archiveFileName` will extract files from a .tar archive - -`tar zxf archiveFileName` will extract files from a .tar.gz (or .tgz) archive -(both of the previous commands in a single step) - -`unar archiveFileName` will extract files from tons of archive formats, -including obsolete ones like StuffIt and DiskDoubler. See [The -Unarchiver][78] for a full list. - - -Commands for Apple II archive formats: - -`nulib2 -x archiveFileName` will extract files from a ShrinkIt (.SHK, .SDK, -.BXY) or Binary II (.BQY, .BNY) archive. This will mostly be useful when the -archive contains a full disk image (typically, but not always, indicated as -.SDK); if the archive contains files, use one of the commands below. You can -view the contents of an archive before expanding with `nulib2 -v -archiveFileName`. - -`shk2image archiveFileName imageFileName` will extract files from a ShrinkIt -or Binary II archive to a ProDOS disk image file (if the one you specify -doesn’t exist, an 800K image will be created, unless the name you gave ends in -“.dsk”, in which case a 140K image will be created). If you want the archive -to be expanded directly to virtual drive 1 or 2, use `$VSD1` or `$VSD2` for -`imageFileName`. - -If you want the archive to be expanded into a ProDOS subdirectory rather than -at the top level of the disk image, you can supply a ProDOS path, without the -volume name, as an additional argument. The subdirectory (and any -subdirectories within it) will be created if it doesn’t exist. For example: - -`shk2image archiveFileName $VSD2 PATH/TO/PRODOS.DIR.NAME` - -(You can also uncompress ShrinkIt archives on your Apple II by transferring -the archive, as I’ll explain in the next post. It’s slower that way, though.) - -For other (and older) Apple II formats: `sciibin filename` will decode a -BinSCII file (.BSC, .BSQ); note that .BSQ files produce ShrinkIt archives when -decoded, so use `nulib2 -x` or `shk2image` on the result. `nulib2 -x -filename` will extract files from a Binary II (.BNY, .BQY) archive, and will -automatically uncompress any Squeezed (.QQ) files within the archive; -alternatively, `unblu filename` will extract files from a Binary II archive -and `usq filename` will uncompress Squeezed files. `unbit filename > -outfilename` will decode an EXEC file made by Executioner; `unexec filename > -outfilename` will decode an EXEC file containing monitor input. - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: transfer files - -If you’ve got files on your Pi that aren’t inside one of your viritual disks, -and you want to transfer them to your Apple II, you’ve got a few options. - - -### Archive files: - -If it’s an archive file, you can (and perhaps should) expand it directly on -the Pi, as explained in [A2CLOUD: working with archives and disk images][17]. -Otherwise, use one of the cool moves below, and then expand it with ShrinkIt -or the appropriate program on the Apple II. - -  -### Copy a file into a disk image - -`acmd -c fileToBeCopied imageFileName` - -You can then use `vsd1` or `vsd2` to access the image file, or, alternatively, -transfer it to a floppy with ADTPro. If you want to copy a file directly to a -disk image already in a virtual drive, use `$VSD1` or `$VSD2` for -`imageFileName`. *You must immediately type `vsdsync` if you modify an image -currently assigned to a virtual drive.* - -If you want to specify a different name and/or file type, you can use the long -form: - -`acmd -p imageFileName APPLE2.FILENAME fileType auxType < fileToBeCopied` - -`fileType` should be a three-letter name (e.g. TXT), or a numeric type (e.g. -255 or $E0). `auxType` is also needed for file types that require it (e.g. -BIN), and can be either decimal, or hexadecimal if preceded with $. You can -use $2000 for `auxType` if you’re not sure. If you want the file to go into a -ProDOS subdirectory, you can specify the path as part of `APPLE2.FILENAME` -(but do not include the volume name); any subdirectories that don’t already -exist will be created. - -(This is a slightly modified version of AppleCommander’s normal -p option: the -file type and ProDOS file name are optional, the file name is checked to make -sure it’s ProDOS-compatible, and any existing file of the same name within the -image is first deleted.) - - -### Transfer a file from your Pi to your Apple II - -You can transfer a file to be saved on a local or virtual disk by using the -YMODEM protocol. To send one or more files with YMODEM, type: - -`sb fileToBeTransferred1 fileToBeTransferred2 fileToBeTransferred3` (etc) - -Once started, you will need to tell ProTERM or Z-Link to receive YMODEM. In -ProTERM, choose YMODEM from the Receive menu; in Z-Link, type -open-apple-downarrow, then option 4. In either one, accept the default options -(unless you want to change them), and the files should transfer. If for -whatever reason they don’t, and you can’t get access to the Linux shell prompt -again, type ctrl-X until the prompt reappears. Transfer may be slow at the -default 4800 baud rate; I’ll explain how to increase the baud rate in the next -post. - -If you are using ProTERM, you can also try ZMODEM by using `sz` instead of -`sb`. ZMODEM is a more efficient protocol than YMODEM, it can auto-start, and -it can recover from incomplete transfers, but those are less important in a -direct-attached (rather than dial-up) situation, and I haven’t had as much -success with it as I have had with YMODEM. - - -### Transfer a file from your Apple II to your Pi - -You can also go in the other direction — from your Apple II to the Pi. -Type `rb` (for YMODEM) then tell ProTERM or Z-Link to send YMODEM. (If you -prefer to send ZMODEM from ProTERM, just do that, and the Pi will -automatically start receiving; you don’t need to type a command first.) - -Another option is to save a file to a virtual disk — or transfer a real floppy -using ADTPro — and then copy files out of the disk image on the Pi with this -command: - -`acmd -g imageFileName APPLE2.FILENAME` - -If you saved to the virtual disk, you can type `$VSD1` or `$VSD2` for -imageFileName. - -acmd (AppleCommander) has some smarts, and it can translate (or “export”, as -it prefers to say) from various Apple II file formats into modern formats. If -you want it to give that a shot, use `-e` instead of `-g` above. - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: increase serial port speed - -I chose the default speed of 4800 baud for Pi as a lowest common -denominator that should work in almost any situation, even a IIc using -Z-Link without any kind of hardware handshaking serial cable. It should -be fine for command-line stuff, but might be slower than you’d like if -you use any full-screen programs (like cftp) or are transferring with -YMODEM. - -You can try to use a faster baud rate with the following command: - -`baud baudRate` - -`baudRate` can be 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, -or 115200. The change will take effect immediately (unless you’re not doing it -from your Apple II itself, in which case it won’t do anything), so you’ll need -to change the setting in ProTERM or Z-Link, too. - -If you want to make the change permanent, with the change taking effect on -logout, use: - -`baud -d baudRate` - -To see the current speed, just type `baud` by itself. - -You’ll only be able to use 38400 or 57600 on a IIgs (and not with Z-Link), but -Hugh Hood has come up with [clever ProTERM macros][79] that enable 115200 -baud on any Apple II, and A2CLOUD provides them with ProTERM. If you use -115200 baud, you’ll likely drop some characters, especially on an 8-bit Apple -II. One strategy you might want to try is to use a slower speed normally, but -then “upshift” to 115200 for transfers. When you’re done, you can switch back -to the slower speed. - -To use Hugh’s macros, choose “Read Globals” from the “Misc” menu, and select -either PT3.IIE.GLOBALS, PT3.IIC.GLOBALS, or PT3.IIGS.GLOBALS, depending on -what computer you’re using. Then, for a IIe or IIc/IIc+, type solid-apple-F, -and it will switch to 115200; you can still switch back to other speeds as -usual from the “Online” window. For a IIgs, type shift-option-H, and it will -switch to 115200 baud; to switch back to other speeds, type option-H to -disable the macro. If you want these macros to automatically be available when -ProTERM starts without having to use the “Read Globals” menu item, delete or -rename PT3.GLOBALS, and then rename the appropriate globals file to -PT3.GLOBALS. - - -This entry was posted on August 11, 2013 by [ivanx][29]. - - - -# A2CLOUD: emulate an Apple II - -Though the purpose of A2CLOUD is primarily to extend the functionality of your -actual Apple II, there are also emulators provided in case you want a virtual -Apple II. (If you’re using [Apple II Pi][21], that’s in fact sort of the -point.) - -You’ll either need a screen attached to your Raspberry Pi, or -[remote desktop software][5]. - -For an emulated Apple IIgs, use [GSport][80], a descendent of the KEGS -emulator with significant enhancements by David Schmidt, David Schmenk, Peter -Neubauer, Christopher Mason, and others. GSport’s features include Uthernet -card emulation, AppleTalk networking, and ImageWriter and Epson printer -emulation. Type `gsport` to if you are at the command prompt and want a -full-screen experience, or double-click GSport on the Raspbian desktop. Press -F4 for the configuration screen, and alt-F4 to exit. Usage instructions are on -the [GSport home page.][80] - -For a emulated Apple IIe, type `linapple` to run the [LinApple][81] emulator. -It has some nifty features like built-in software downloading and a built-in -help screen. More information is [here][81]. - -You can also use GSport’s ancestor, [KEGS][82], by choosing it from the menu -of the Raspbian desktop. (To start the Raspbian desktop, type `startx` or use -[remote desktop software][5].) Usage instructions are [here][83]. - - -This entry was posted on November 29, 2013 by [ivanx][29]. - - - -# A2CLOUD: Apple II Pi - -David Schmenk has created [Apple II Pi][27], which takes a different approach -than A2CLOUD. With A2CLOUD, the idea is to use your Pi as a peripheral for -your Apple II. - -Apple II Pi flips this around: you can use your Apple II’s keyboard, mouse, -joystick, and drives to control your Raspberry Pi, primarily so you can use -the GSport emulator, giving you a virtual souped up Apple II. To get benefit -from this, you’ll need a screen attached to your Pi. - -To use Apple II Pi, you’ll need the [Apple II Pi card][84], or a [Raspberry -Pi console cable][50] attached to a Super Serial Card (even in a IIgs) or a -IIc/IIc+ serial port, via [the appropriate serial cable][41] and possibly a -[DE-9 (aka DB-9) male-to-male null modem adapter][85]. The software is -already installed by Raspple II or A2CLOUD (if it doesn’t seem to work, try -updating A2CLOUD by typing `a2cloud-update`). - -Once connected, boot the A2CLOUD floppy, and press space on the splash screen. -The first time you do this, it will ask you to choose the slot of your Apple -II Pi card or Super Serial Card. It should then connect immediately; your -Apple II will sound a tone, and any keystrokes you type will show up on the -Raspberry Pi’s screen, rather than your Apple II; on the Raspbian desktop, you -can use your Apple II mouse. And if you want to see your Apple II prompt on -your Raspberry Pi, type `a2term`; prepare to be pleasantly disoriented. - -Apple II Pi also lets you go straight into GSport, bypassing the Raspbian -command line, by logging in with username “apple2″ (no password); type alt-F4 -(or openApple-solidApple-4 on an Apple II keyboard) to quit. When you do, your -Pi will fully shut down. - -Apple II Pi has many more sophisticated abilities, such being able to develop -6502 code on the Raspberry Pi and execute it on the Apple II. For more info -on how to use it, check out [Dave’s web site][27] and the [Ultimate Apple 2 -forums][86]. - - -This entry was posted on November 29, 2013 by [ivanx][29]. - - - -# A2CLOUD: release history and notes - -A2CLOUD is sorta always in a state of development with tiny tweaks happening -without announcement, often to the installer script rather than any visible -features per se, and those changes and other small details are (somewhat) -documented at the end of [the script itself][87]. But here are the noteworthy -enhancements. To update, type `a2cloud-update`. - -### v1.8.1, May 5, 2015 - -* ADTPro 2.0.1 - -* Apple II Pi client 1.5 - - -### v1.8.0, March 17, 2015 - -* compatible with every Raspberry Pi, including Raspberry Pi 2 Model B - -* GSport installed for non-Raspberry Pi computers, with option for - new GS/OS+Spectrum installation, or GSport Internet Starter Kit premade - image - -* Links web browser - -* desktop shortcuts and Apple II menu group for emulators and ADTPro -* new `a2cloud-update os` command will perform full Raspple II update, - including Raspbian OS and NOOBS install manager, A2CLOUD, A2SERVER, and - Apple II Pi - -* many small improvements and fixes to A2CLOUD environment and installer - script - - -### v1.7.2, February 7, 2015 - -* supports Raspberry Pi Model A and A+ (and Pi 2 Model B) - -* resolves issues with Raspbian 2015-01-31 (kernel 3.18) - - -### v1.7.1, August 11, 2014 - -* A2CLOUD is no longer “beta” on non-Raspberry Pi computers - -* A2CLOUD includes KEGS and Linapple on non-Raspberry Pi computers - -* A2CLOUD has a faster install script for non-Raspberry Pi computers - (downloads binaries) - -* unbit/unexec/bsq archive tools are installed - - -### v1.7.0, August 2, 2014 - -* a2cloud-setup installs Java 8 if not already installed - - -### v1.6.9, July 24, 2014 (KansasFest) - -* ADTPro 2.0.0 (quicker and more reliable transfer; selectable filenames from - list) - -* confirmed working on Raspberry Pi Model B+ (use the USB ports closer to the - Ethernet port) - - -### v1.6.8, Apr 7, 2014 - -* ADTPro 1.3.0 - -* TTYtter installs properly on non-Pi systems - - -### v1.6.7, Feb 19, 2014 - -* A2CLOUD boot floppy contains A2PI client version 1.4 - -* A2CLOUD boot floppy splash screen provides simple menu for virtual drives, - Apple II Pi, or BASIC - -* A2CLOUD.HDV is now called A2CLOUD.PO (a symbolic link called A2CLOUD.HDV is - still there for backwards compatibility/habits) - -* bug fixes for `cppo`, `shk2image`, and some launcher scripts`` - - -### v1.6.6, Feb 17, 2014 - -* [beta support for Debian and Ubuntu Linux on non-Pi machines][25] - -* ttytter support for color and avoiding non-ASCII characters when running -  under Screen - -* opens LXTerminal window by default when starting graphical desktop - -* a2cloud-setup installs Screen if not already installed - -* a2cloud-setup shows installed and available versions - -* a2cloud-setup -y bypasses all prompts - - -### v1.6.5, Feb 5, 2014 - -* can use `term mono` and `term color` instead of `term vt100` and `term - pcansi` - - -### v1.6.4, Jan 31, 2014 - -* support for `screen` command to allow switching between multiple terminals - on Apple II - -* `term -f` can be used to force emulation setting even when `term` doesn’t - want to - - -### v1.6.3, Jan 23, 2014 - -* Set TTYtter to always use -ssl mode, which is required by Twitter after - 14-Jan-14. - -* Set TTYtter to avoid display of non-ASCII characters on serial port shell - -* Set TTYtter to use color ANSI text (for IIgs) if shell is currently set to - display it - -* Provided TTYtter readline module for enhanced input with -readline option - -* Added `appleiipi-update` command - - -### v1.6.2, Jan 19, 2014 - -* Improved display of non-ASCII characters in Apple II terminal emulation - programs - -* Support for “PC ANSI” colored text and graphics characters , for use with - Spectrum’s ANSI online display, via new `term` command * Added `sciibin` and - `unblu` for converting BinSCII and Binary II files - -* `baud` command supports 300 baud, in case you *really* want to kick it old - school - - -### v1.6.1, Jan 14, 2014 - -* Added `telnet` and `ttytter` (Twitter client) - -* fix for network boot failure when set up under v1.6 - - -### v1.6, Dec 31, 2013 - -* ADTPro/VSDRIVE 1.2.9 (much faster virtual drives read performance, for the - price of a short delay on the `vsd1`/`vsd2` commands and a need to type - `vsdsync` after changing an active virtual drive directly on the Pi; ability - to run VSDRIVE from ProDOS program launcher, not just BASIC.SYSTEM) - -* if A2SERVER is installed, shares the ADTPro disks folder as ADTDISKS on the - network - -* responds to name “raspberrypi.local” as alternative to IP address to Mac OS - X (and Windows with [Bonjour Print Services][52] installed) computers on - network - - -### v1.5.2, Dec 22 2013 - -* added `dos2pro` command - -* Apple II Pi is now installed with GSport emulator and “apple2user” packages - -* speedier install by downloading A2CLOUD disk images instead of building them - - -### v1.5, Dec 1 2013 - -* Adds IRC and newsreader clients (Irssi and Tin) and, with shortcuts for - Apple II community (`a2chat` and `a2news` commands) - -* adds KEGS and LinApple emulators - -* installs Apple II Pi - -* easy installation via [Raspple II][28] - - -### v1.2.3, Nov 2013 - -* A2PI client version 1.3 added to A2CLOUD disk - -* faster install for unar/lsar, nulib2, and cftp (downloads rather than - compiles) - -* console (built-in serial) login disabled, to allow Apple II Pi to have that - port - -* installs xrdp/tightvncserver for remote desktop access from another computer - -* adds DSK2FILE image utility to A2CLOUD disk - - -### v1.0, Sep 2 2013 - -* first proper release with full documentation, bug fixes, and demo video - - -### beta, Jul 27, 2013 - -* internet access and virtual drives for any Apple II via a Raspberry Pi; - introduced at KansasFest 2013 - - -This entry was posted on December 28, 2013 by [ivanx][29]. - - -# A2CLOUD: other stuff - -This is a post for new techniques or features that aren’t fully ready, or -other stuff that doesn’t seem to fit into the main guide. View the -comments to see, or post one of your own. - -If this is at the top of a bunch of posts below, you’re reading the A2CLOUD -guide backwards. Click “A2CLOUD” in the menu header above to fix it, or just -go to [http://ivanx.com/a2cloud][1]. - - - -### ivanx, January 26, 2014 at 4:03 pm - -[Alistair Ross][88], who suggested the TTYtter client for Twitter that is now -in A2CLOUD, has introduced me to the Mutt email client. Mutt requires a -hand-built .muttrc file to put in account information, but Alistair has -developed a wizard that will create one for Gmail and other IMAP servers. I -have more familiarity with Alpine (a clone of my first email client from the -early 90’s, Pine), and may include one, or the other, or both, or neither, in -a future A2CLOUD release. - -To install Mutt or Alpine, type: -`sudo apt-get install mutt` (or `alpine`) -also, get [Alistair’s Mutt configuration wizard][89] - - -### ivanx, January 26, 2014 at 9:44 pm - -[Alistair Ross][88] also suggested the Links web browser. It has a cleaner -layout than Lynx does, devoting more screen space to web content (especially -valuable on the Apple II’s 80×24 display). You get nothing but a blank screen -on startup, but press ESC to get a menu bar, and from there it’s -self-explanatory. On a IIgs with Spectrum’s ANSI online display, you need to -enable its color support from the Settings menu. There’s also a derivative -called “Elinks” which at first glance seems to have more accurate color -support (select “16 colors” from its setup menu). Alistair also suggested w3m, -which I haven’t tried. You can get any of these with: -`sudo apt-get install links` (or `elinks`, or `w3m`) - - -### ivanx, January 26, 2014 at 10:08 pm - -In [this comp.sys.apple2 thread][90] I discuss various techniques for copying -contents of Apple II floppy images to another disk. In this case, it’s a hard -disk image file used by a CFFA 3000 card, but it could be any kind of “hard -disk”, including a Focus or MicroDrive card, or one provided by VSDRIVE such -as the default 4 MB disk in S2,D1. - - -### ivanx, February 17, 2014 at 9:43 pm - -A2CLOUD can be installed on Debian or Ubuntu Linux (and possibly derivatives). -It has been tried on the 32-bit versions of Debian 7 and Ubuntu Server 13.10. -To install, type: - -~~~ bash -wget ivanx.com/a2cloud/setup; source setup -~~~ - -You can also install it into the [A2SERVER][91] virtual machine with the same -command, or start fresh with the premade [A2SERVER+A2CLOUD][91] virtual -machine. To use a USB-to-serial adapter with the VM, click the USB icon in the -bottom of the window, and select the adapter. If you have two, repeat. If you -want it to be automatically recognized, you can add it under -Settings -> Ports -> USB. - -One particular difference compared with running A2CLOUD on a Pi is -that there is no assignment of USB-to-serial adapters to specific physical USB -ports. Instead, the “upper” USB port is always the adapter that appears first -to the system (aka `/dev/ttyUSB0` or `/dev/ttyUSBupper`), and is used for -shell login. The “lower” USB port is always the adapter that appears second to -the system (aka `/dev/ttyUSB1` or `/dev/ttyUSBlower`), and is used for ADTPro -and virtual drives. - -If they are both present at system startup, or connected to a hub which is -then attached to the system, there’s no way of knowing which the system will -see first. If things don’t work, either swap the cables on the Apple II side, -or unplug both adapters and reattach one at a time, starting with the one -connected to the Apple II printer port. - -Apple II Pi is not offered as an installation option on non-Pi computers, -though if you’re dedicated, you can compile it yourself [here][92]. - - -This entry was posted on January 26, 2014 by [ivanx][29]. - - -[1]: http://appleii.ivanx.com/a2cloud/ "A2CLOUD" -[2]: #a2cloud-intro -[3]: #a2cloud-what-you-need -[4]: #a2cloud-prepare-your-pi -[5]: #a2cloud-go-headless-optional -[6]: #a2cloud-install-the-software -[7]: #a2cloud-attach-your-cables -[8]: #a2cloud-make-your-boot-disk -[9]: #a2cloud-use-virtual-drives -[10]: #a2cloud-log-in-from-your-apple-ii -[11]: #a2cloud-make-a-floppy-or-image -[12]: #a2cloud-learn-some-unix -[13]: #a2cloud-insert-a-disk-image -[14]: #a2cloud-connect-with-other-people -[15]: #a2cloud-browse-amp-download -[16]: #a2cloud-use-disk-images -[17]: #a2cloud-expand-archives -[18]: #a2cloud-transfer-files -[19]: #a2cloud-increase-serial-port-speed -[20]: #a2cloud-emulate-an-apple-ii -[21]: #a2cloud-apple-ii-pi -[22]: #a2cloud-release-history-and-notes -[23]: #a2cloud-other-stuff -[24]: http://www.raspberrypi.org "Raspberry Pi" -[25]: #ivanx-february-17-2014-at-943-pm "A2CLOUD on non-Pi computers" -[26]: http://appleii.ivanx.com/a2server/ "A2SERVER" -[27]: http://schmenk.is-a-geek.com/wordpress/ "Apple II Pi" -[28]: http://appleii.ivanx.com/rasppleii/ "Raspple II" -[29]: mailto:ivan@ivanx.com "Contact Ivan Drucker" -[30]: #apple-ii-plus-and-unenhanced-iie "A2CLOUD: log in from your Apple II" -[31]: http://www.raspberrypi.org/products/ "Raspberry Pi purchase" -[32]: http://www.amazon.com/s/ref=nb_sb_ss_i_0_4?url=search-alias%3Daps&field-keywords=raspberry+pi+2&sprefix=rasp%2Caps%2C173 "Raspberry Pi 2 Model B search - Amazon" -[33]: http://www.amazon.com/gp/product/B00LPESRUK/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B00LPESRUK&linkCode=as2&tag=ivane-20&linkId=B7F2LQNXIWGYCNYQ "Raspberry Pi 1 model B+ - Amazon" -[34]: http://www.amazon.com/gp/product/B009SQQF9C/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B009SQQF9C&linkCode=as2&tag=ivane-20 "Raspberry Pi 1 model B - Amazon" -[35]: http://www.amazon.com/Raspberry-Pi-Model-A-256MB/dp/B00PEX05TO/ref=sr_1_1?ie=UTF8&qid=1423325260&sr=8-1&keywords=raspberry+pi+model+a%2B "Raspberry Pi 1 model A+ - Amazon" -[36]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=4gb%20sd%20card&linkCode=ur2&rh=i%3Aaps%2Ck%3A4gb%20sd%20card&sprefix=4gb%20s%2Caps&tag=ivane-20&url=search-alias%3Daps "SD card" -[37]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=8gb%20sd%20card&linkCode=ur2&rh=i%3Aaps%2Ck%3A4gb%20sd%20card&sprefix=4gb%20s%2Caps&tag=ivane-20&url=search-alias%3Daps "8 GB SD card at Amazon" -[38]: http://www.amazon.com/gp/product/B00A9PO5AM/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B00A9PO5AM&linkCode=as2&tag=ivane-20 -[39]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=ethernet%20cable&linkCode=ur2&rh=i%3Aaps%2Ck%3Aethernet%20cable&sprefix=ethernet%2Caps&tag=ivane-20&url=search-alias%3Daps "ethernet cable" -[40]: http://ivanx.com/raspberrypi/raspberrypi_wifi.html "Raspberry Pi WiFi" -[41]: http://retrofloppy.com/products.html "Apple II null modem serial cable" -[42]: http://adtpro.sourceforge.net/connectionsserial.html "ADTPro serial connections" -[43]: http://www.amazon.com/gp/product/B0007T27H8/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B0007T27H8&linkCode=as2&tag=ivane-20 "TRENDnet TU-S9 USB-to-serial adapter" -[44]: http://www.ebay.com/sch/i.html?_nkw=apple+super+serial+card "eBay - Apple Super Serial Card" -[45]: http://www.amazon.com/gp/product/B006T9B6R2/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B006T9B6R2&linkCode=as2&tag=ivane-20 "SD card reader" -[46]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=usb%20keyboard&linkCode=ur2&rh=i%3Aaps%2Ck%3Ausb%20keyboard&tag=ivane-20&url=search-alias%3Daps "USB keyboard" -[47]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=usb%20mouse&linkCode=ur2&rh=i%3Aaps%2Ck%3Ausb%20mouse&tag=ivane-20&url=search-alias%3Daps "USB mouse" -[48]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=powered%20usb%20hub&linkCode=ur2&rh=i%3Aaps%2Ck%3Apowered%20usb%20hub&tag=ivane-20&url=search-alias%3Daps "powered USB hub" -[49]: http://ultimateapple2.com "Apple II Pi card from Ultimate Apple 2" -[50]: http://www.pridopia.co.uk/pi-232r1-db9.html "Raspberry Pi console cable" -[51]: http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Delectronics&field-keywords=db9+male+female+null+modem+adapter+-usb&rh=n%3A172282%2Ck%3Adb9+male+female+null+modem+adapter+-usb "DE-9 male-to-female null modem adapters at Amazon" -[51]: https://www.sdcard.org/downloads/formatter_4/ -[52]: http://support.apple.com/kb/dl999 -[53]: http://www.chiark.greenend.org.uk/~sgtatham/putty/ -[54]: http://ivanx.com/raspberrypi/files/PiFinder.zip -[55]: http://www.advanced-ip-scanner.com/ -[56]: https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417?mt=12 "Microsoft Remote Desktop for Mac" -[57]: http://elinux.org/RPi_VNC_Server "configure TightVNCServer" -[58]: http://elinux.org/Configuring_a_Static_IP_address_on_your_Raspberry_Pi "Raspberry Pi static IP address" -[59]: http://adtpro.sourceforge.net/vdrive.html "VSDRIVE" -[60]: http://adtpro.sourceforge.net/ "ADTPro" -[61]: http://appleii.ivanx.com/a2cloud/files/A2CLOUD.DSK "140K A2CLOUD boot disk" -[62]: http://appleii.ivanx.com/a2cloud/files/A2CLOUD.HDV "800K A2CLOUD boot disk" -[63]: http://apple2.info/wiki/index.php?title=DOS#Commands_quick_reference "ProDOS and DOS 3.3 commands" -[64]: http://www.apple2scans.net/?p=33 "BASIC Programming with ProDOS" -[65]: http://lostclassics.apple2.info/announcements/19/proterm-a2/ "ProTERM" -[66]: http://www.wannop.info/speccie/Site/Speccies_Home_Pages.html "Spectrum for Apple IIgs" -[67]: http://www.bartbania.com/index.php/linux-screen/ "using Screen" -[68]: http://www.wannop.info/speccie/Site/Download_Centre.html "Spectrum download" -[69]: http://macgui.com/downloads/?file_id=24237 "Mac GUI Vault: Kermit 3.87" -[70]: https://groups.google.com/d/msg/comp.sys.apple2/8yUpfbAgdx0/oVwep6fMsTYJ "VT-100 on Apple II Plus and unenhanced IIe" -[71]: http://www.irchelp.org/ "IRC Help" -[72]: http://www.irssi.org/documentation/ "Irssi Documentation" -[73]: http://www.floodgap.com/software/ttytter/ "TTYtter" -[74]: #ivanx-january-26-2014-at-403-pm "email on A2CLOUD" -[75]: http://elinux.org/RPi_Chromium "Chromium (Google Chrome for Raspberry Pi)" -[76]: http://elinux.org/RPi_IceWeasel "Iceweasel (Firefox for Raspbian)" -[77]: #ivanx-january-26-2014-at-944-pm -[78]: http://unarchiver.c3.cx/formats "The Unarchiver supported formats" -[79]: https://groups.google.com/forum/#!searchin/comp.sys.apple2/115200$20hugh "Hugh Hood's 115200 baud ProTERM macros" -[80]: http://gsport.sourceforge.net/ "GSport" -[81]: http://linapple.sourceforge.net/ "LinApple" -[82]: http://kegs.sourceforge.net/ "KEGS" -[83]: http://kegs.sourceforge.net/README.kegs.txt "KEGS instructions" -[84]: https://ultimateapple2.com/ "Apple II Pi card" -[85]: http://www.amazon.com/s/?_encoding=UTF8&camp=1789&creative=390957&field-keywords=db9%20male%20null%20modem%20adapter%20-usb%20-female&linkCode=ur2&rh=n%3A172282%2Ck%3Adb9%20male%20null%20modem%20adapter%20-usb%20-female&tag=ivane-20&url=search-alias%3Delectronics "DE-9 male-to-male null modem adapter" -[86]: https://www.ultimateapple2.com/forums/ "Ultimate Apple 2 forums" -[87]: http://appleii.ivanx.com/a2cloud/setup/setup.txt "A2CLOUD setup script" -[88]: http://twitter.com/AJRossNZ -[89]: http://pastebin.com/Mawvd2pZ -[90]: https://groups.google.com/forum/#!msg/comp.sys.apple2/VGvddYfn_wk/eFrQ-u3qBkUJ -[91]: http://appleii.ivanx.com/a2server/a2server_virtualbox.html -[92]: https://github.com/dschmenk/apple2pi "Apple II Pi source code" diff --git a/docs/ivanx/setup/a2chat.txt b/docs/ivanx/setup/a2chat.txt deleted file mode 100644 index ff064ef..0000000 --- a/docs/ivanx/setup/a2chat.txt +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -if [[ ! $(dpkg -l irssi 2> /dev/null | grep '^ii') ]]; then - echo "Installing irssi..." - supo apt-get -y update - sudo apt-get -y install irssi &> /dev/null - sudo apt-get -y clean -fi - -if [[ $1 == "-n" && $2 ]]; then - nickname=$2 -elif [[ $1 == "-n" ]]; then - nickname="0" -elif [[ -f ~/.irssi/a2c.nickname ]]; then - nickname=$(cat ~/.irssi/a2c.nickname) -else - nickname= -fi - -while [[ ! $nickname || ! $(grep -i '^[a-z_\-\\^{}|`][a-z0-9_\-\\^{}|`]*$' <<< $nickname) ]]; do - echo -n "Enter a nickname for chat (to change later, use 'a2chat -n'): " - read - nickname=$REPLY -done - -mkdir -p ~/.irssi -echo $nickname > ~/.irssi/a2c.nickname - -if [[ -f ~/.irssi/startup ]]; then - mv ~/.irssi/startup ~/.irssi/startup.orig -fi -echo -e "/network add -autosendcmd '/join #a2c.chat' Palomino.A2\n/server add -auto -network Palomino.A2 irc.a2central.com\n" > ~/.irssi/startup - -if [[ -f ~/.irssi/config ]]; then - cp ~/.irssi/config ~/.irssi/config.orig -fi - -irssi -n $nickname - -rm ~/.irssi/startup &> /dev/null -if [[ -f ~/.irssi/startup.orig ]]; then - mv ~/.irssi/startup.orig ~/.irssi/startup -fi - -rm ~/.irssi/config &> /dev/null -if [[ -f ~/.irssi/config.orig ]]; then - mv ~/.irssi/config.orig ~/.irssi/config -fi diff --git a/docs/ivanx/setup/a2cloud-aliases.txt b/docs/ivanx/setup/a2cloud-aliases.txt deleted file mode 100644 index caee9cb..0000000 --- a/docs/ivanx/setup/a2cloud-aliases.txt +++ /dev/null @@ -1,87 +0,0 @@ -# A2CLOUD aliases: - -alias a2cloud-setup='wget -qO /tmp/a2cloud-setup ivanx.com/a2cloud/setup/; source /tmp/a2cloud-setup' -alias a2cloud-help='(IFS=""; while read thisLine; do [[ ${#thisLine} -eq 0 ]] && echo || echo "$(tput bold)${thisLine%% *}$(tput sgr0) ${thisLine#* }"; done < /usr/local/etc/a2cloud-help.txt | more)' -alias a2cloud-version='cat /usr/local/etc/A2CLOUD-version' -alias a2cloud-update='a2cloud-setup' - -alias system-shutdown='sudo shutdown -h now' -alias system-restart='sudo shutdown -r now' - - -alias raspi-config='[[ -f /usr/bin/raspi-config ]] && sudo /usr/bin/raspi-config || echo "raspi-config not found. Are you using a Raspberry Pi with Raspbian?"' -alias appleiipi-update="sudo apt-get -y update && sudo apt-get -y --force-yes install a2pi apple2user gsport" -alias raspbian-update='wget -qO /tmp/raspbian-update ivanx.com/a2cloud/setup/raspbian-update.txt; source /tmp/raspbian-update' -alias rasppleii-update='raspbian-update a2cloud a2server' - - -alias welcome-message-edit='sudo nano /etc/motd' - -alias showip='ifconfig eth0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1' -alias showmac='ifconfig eth0 | grep "HWaddr" | cut -dH -f2 | cut -c7-23' -alias showip-wifi='ifconfig wlan0 | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1' -alias showmac-wifi='ifconfig wlan0 | grep "HWaddr" | cut -dH -f2 | cut -c7-23' -alias ifreset='sudo rm /etc/udev/rules.d/70-persistent-net.rules; echo Interfaces removed. You should system-restart now.' - -alias adtpro-stop='sudo pkill -f [A]DTPro' - - -alias adtpro-restart='sudo pkill -f [A]DTPro; while [[ $(ps aux | grep [A]DTPro) ]]; do sleep 1; done; adtpro-start' - -alias usblogin-off='sudo sed -i "s/^\(.*-scanttyUSB\)/#\1/" /etc/inittab; sudo init q; sudo pkill -f [g]etty' -alias usblogin-on='sudo sed -i "s/^#\(.*-scanttyUSB\)/\1/" /etc/inittab; sudo init q' - - - -alias term='source term' - - - - - - -alias vsd1='source /usr/local/bin/vsd -d1' -alias vsd2='source /usr/local/bin/vsd -d2' -forfloppy () { [[ $1 ]] && { mv "$1" /usr/local/adtpro/disks && echo "moved $1 to /usr/local/adtpro/disks" || echo "Unsuccessful. $1 was not moved."; } || echo "Usage: forfloppy imageFileName"; } - -alias vsdsync='adtpro-restart' - -alias nulib=nulib2 - - - - - - - -alias a2cat='acmd -l' - - - - - - - - -VSD1=$(readlink /usr/local/adtpro/disks/Virtual.po) -VSD2=$(readlink /usr/local/adtpro/disks/Virtual2.po) -ADTDISKS=/usr/local/adtpro/disks; A2DISKS=/usr/local/adtpro/disks -A2CLOUD=/usr/local/adtpro/disks/A2CLOUD.HDV -GSDISKS=/usr/local/share/gsdisks -GSHD=/usr/local/share/gsdisks/gsoshd.hdv - - - - - - - - - - -ttytter () { ( ansi=; seven=; [[ $(grep ttyUSB <<< $myTTY) || $(grep ttyAMA <<< $myTTY) ]] && { seven="-seven"; [[ $TERM=="ansi" || $TERM=="pcansi" ]] && ansi="-ansi"; }; [[ -f /usr/bin/ttytter ]] && /usr/bin/ttytter -ssl $seven $ansi $@ || /usr/local/bin/ttytter -ssl $seven $ansi $@ ); } - - -alias raspple-update='rasppleii-update' -alias rasappleii-update='rasppleii-update' -alias rasapple-update='rasppleii-update' diff --git a/docs/ivanx/setup/a2cloud-help.txt b/docs/ivanx/setup/a2cloud-help.txt deleted file mode 100644 index b39ce76..0000000 --- a/docs/ivanx/setup/a2cloud-help.txt +++ /dev/null @@ -1,87 +0,0 @@ - A2CLOUD commands: - (note : new commands may be added; use a2cloud-setup to refresh) - -a2cloud-help : show this list of commands -a2cloud-version : see installed version of A2CLOUD -a2cloud-update : update A2CLOUD, or add features - -system-shutdown : shut down the A2CLOUD machine (or VM) -system-restart : shut down and restart the A2CLOUD machine (or VM) - - Raspberry Pi commands, if you're using one: -raspi-config : configure Raspberry Pi -appleiipi-update : update Apple II Pi and GSport -raspbian-update : update Raspbian operating system -rasppleii-update : update Raspbian OS, A2CLOUD, A2SERVER, Apple II Pi - Apple II Pi: for help, visit http://schmenk.is-a-geek.com/wordpress - -welcome-message-edit : change the welcome message - -showip : show the current ethernet IP address of the server -showmac : show the MAC (Ethernet hardware) address of the server -showip-wifi : show the current wifi IP address of the server -showmac-wifi : show the MAC (wifi hardware) address of the server -ifreset : reset all network interfaces (requires restart) - -adtpro-stop : stop the ADTPro service -adtpro-start : start the ADTPro service - (note: autostarts on appearance of eligible USB-to-serial adapter) -adtpro-restart : restart the ADTPro service - -usblogin-off : disable shell login for USB-to-serial adapter -usblogin-on : enable shell login with USB-to-serial adapter on upper - USB port or hub attached to it, or highest-numbered port on hub - attached to lower USB port - -term [-d] mono : use VT-100 (mostly monochrome) emulation in serial - shell login for ProTERM, Spectrum, Z-Link, etc. (-d sets default) -term [-d] color : use ANSI color and PC graphic text in serial shell - login for Spectrum or other PC-ANSI terminal (-d sets default) -baud : show or set serial port shell baud rate -screen : switch between multiple terminal screens - -vsd1 : show or set the disk image assigned to virtual drive 1 -vsd2 : show or set the disk image assigned to virtual drive 2 -forfloppy : move the disk image to the ADTPro disk images folder - (/usr/local/adtpro/disks) in preparation for transfer -vsdsync : update ADTPro server with the current virtual drive images - -nulib2 : create, extract, and work with NuFX (ShrinkIt) archive files -sciibin : decode BinSCII file (they start with 'FiLeStArTfIlEsTaRt') -unblu/usq/unbit/unexec : decode Binary II, Squeezed, Executioner, - or monitor hex entry EXEC file (old Apple II distribution formats) - -unar : extract non-Apple II archive files (multiformat) -lsar : list contents of non-Apple II archive files (multiformat) - -a2cat: catalog Apple II disk image (any format) -acmd : do stuff with files inside Apple II disk images -mkpo : make blank ProDOS disk image file -dos2pro: copy files from DOS 3.3 disk image to ProDOS disk image -dopo : convert DOS-ordered disk image to ProDOS, or vice-versa -cppo : catalog and copy files from ProDOS image file (slow, but works) -shk2image : extract files from ShrinkIt archive to disk image file - - environment variables : -$VSD1 = disk image currently "inserted" in virtual drive 1 -$VSD2 = disk image currently "inserted" in virtual drive 2 -$ADTDISKS = ADTPro disks directory (/usr/local/adtpro/disks) -$A2CLOUD = 800K A2CLOUD disk (/usr/local/adtpro/disks/A2CLOUD.HDV) -$GSDISKS = GSport/KEGS disks directory (/usr/local/share/gsdisks) -$GSHD = GSport/KEGS hard drive (/usr/local/share/gsdisks/gsoshd.hdv) - - internet tools: -ftp : connect to an FTP site (command line operation) -cftp : connect to an FTP site (full screen operation) -lynx : browse the web (in text only, of course) -links : browse the web (alternative to lynx; press ESC for menu) -wget : download a single URL from an FTP or web site -irssi : IRC chat (general purpose) -a2chat : IRC chat (automatically opens to Apple II channel) -a2news : read and post on Usenet discussions (default Apple II topics) -ttytter : tweet like there's no tomorrow - - emulators: -gsport : GSport Apple IIgs emulator -kegs : KEGS Apple IIgs emulator -linapple : LinApple Apple IIe emulator diff --git a/docs/ivanx/setup/a2cloudrc.txt b/docs/ivanx/setup/a2cloudrc.txt deleted file mode 100644 index aee7c12..0000000 --- a/docs/ivanx/setup/a2cloudrc.txt +++ /dev/null @@ -1,34 +0,0 @@ -source /usr/local/etc/a2cloud-aliases - -if [[ -f /usr/local/java/bin/java ]]; then - export JAVA_HOME=/usr/local/java -elif [[ -f /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/java ]]; then # RPi - export JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt -elif [[ -f /usr/lib/jvm/java-8-oracle/bin/java ]]; then # webupd8 - export JAVA_HOME=/usr/lib/jvm/java-8-oracle -elif [[ -f /usr/lib/jvm/java-8-oracle/jre/bin/java ]]; then # Ubuntu 14.04 RPi2 - export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre -elif [[ -f /usr/lib/jvm/jdk-7-oracle-armhf/bin/java ]]; then # RPi - export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle-armhf -elif [[ -f /usr/lib/jvm/jdk-7-oracle/bin/java ]]; then # webupd8 - export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle -fi -[[ ! $(grep java <<< $PATH) ]] && PATH=$PATH:$JAVA_HOME/bin - -if [[ -f /usr/local/etc/a2cloud-lang ]]; then - lang8bit=$(cat /usr/local/etc/a2cloud-lang) -else - lang8bit=C -fi -if [[ ${TERM:0:6} == "screen" ]]; then - myTTY=$(ps hp $(ps hp $(ps hp $$ -o ppid) -o ppid) -o tty) -else - myTTY=$(tty) - export ttyTERM="$TERM" -fi -if [[ $(grep ttyUSB <<< $myTTY) || $(grep ttyAMA <<< $myTTY) ]]; then - LANG=$lang8bit -fi -if [[ ${TERM:0:6} == "screen" ]]; then - TERM=$ttyTERM -fi diff --git a/docs/ivanx/setup/a2news.txt b/docs/ivanx/setup/a2news.txt deleted file mode 100644 index d185a33..0000000 --- a/docs/ivanx/setup/a2news.txt +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -defaultNNTP="news.aioe.org" -defaultGroups="comp.emulators.apple2:\ncomp.sys.apple2:\ncomp.sys.apple2.comm:\ncomp.sys.apple2.marketplace:\ncomp.sys.apple2.programmer:\ncomp.sys.apple2.usergroups:" - -if [[ ! $(dpkg -l tin 2> /dev/null | grep '^ii') ]]; then - echo "Installing Tin newsreader..." - sudo apt-get -y update - sudo apt-get -y install tin &> /dev/null - sudo apt-get -y clean -fi - -if [[ $1 == "-h" || $1 == "--help" ]]; then - echo "Usage: a2news [-s nntpServerAddress] [-m postingEmailAddress] [otherTinOptions]" - echo " note: for full options, instead use 'tin'" - exit 1 -fi - -while [[ $1 == "-s" || $1 == "-m" ]]; do - if [[ $1 == "-s" && $2 ]]; then - nntpServer=$2 - shift - shift - fi - - if [[ $1 == "-m" && $2 ]]; then - emailAddress=$2 - shift - shift - fi -done - -mkdir -p ~/.tin - -if [[ ! -f ~/.newsrc ]]; then - IFS=''; echo -e "$defaultGroups" > ~/.newsrc -fi - -if [[ $nntpServer || ! -f ~/.tin/nntp.server ]]; then - [[ ! $nntpServer ]] && nntpServer="$defaultNNTP" - echo "$nntpServer" > ~/.tin/nntp.server -else - nntpServer=$(cat ~/.tin/nntp.server) -fi - -if [[ $emailAddress || ! -f ~/.tin/tinrc ]]; then - while [[ ! $emailAddress || ! $(grep "@" <<< $emailAddress) || ! $(grep "\." <<< $emailAddress) ]]; do - echo -n "Enter the email address you want to post as: " - read - emailAddress=$REPLY - done - if [[ -f ~/.tin/tinrc ]]; then - sed -i "s/^mail_address=.*$/mail_address=$emailAddress/" ~/.tin/tinrc - else - echo "mail_address=$emailAddress" > ~/.tin/tinrc - fi -fi - -NNTPSERVER=$nntpServer tin -r "$@" diff --git a/docs/ivanx/setup/acmd.txt b/docs/ivanx/setup/acmd.txt deleted file mode 100644 index 432168f..0000000 --- a/docs/ivanx/setup/acmd.txt +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash - -decToHex () { -# converts single-byte decimal value to hexadecimal equivalent -# arg: decimal value from 0-255 -# out: two-digit hex value from 00-FF -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $arg1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ( $(printf %d "$arg1" 2> /dev/null) == $arg1 ) \ - && ( $arg1 -ge 0 ) && ( $arg1 -le 255 ) ]] || return 21 - # args are valid - printf %02X "$arg1" -} - -echoerr() { - echo "$@" 1>&2; -} - -helpExit () { - if [[ -s $acmdStdErr ]]; then - if [[ $(grep CommandLineHelp $acmdStdErr) ]]; then - grep -v ^-[pge][[:space:]] $acmdStdErr | grep -v '^ or' | grep -v 0x2000 1>&2 - echoerr "-g [] copy filename out of any" - echoerr " disk image. Using - for outputFilename will copy to stdout." - echoerr "-e [] like -g, with conversion" - echoerr " to modern file format if possible." - echoerr "-p [[$|0x]] [[$|0x]] copy filename" - echoerr " into ProDOS disk image. is either three-letter or numeric" - echoerr " ProDOS file type (BIN if omitted). Will read from stdin if supplied." - echoerr " ProDOS subdirectories in will be created if needed." - echoerr "-c [[$|0x]] [[$|0x]] synonym for -p" - echoerr " with filename and imagename reversed." - else - cat $acmdStdErr - fi - if [[ $arg1 == "-h" ]]; then - exitVal=0 - else - exitVal=1 - fi - else - if [[ $vsd1_md5 && ( "$vsd1_md5" != "$(md5sum /usr/local/adtpro/disks/Virtual.po)" || "$vsd2_md5" != "$(md5sum /usr/local/adtpro/disks/Virtual2.po)" ) ]]; then - if [[ "$vsd1_md5" != "$(md5sum /usr/local/adtpro/disks/Virtual.po)" || "$vsd2_md5" != "$(md5sum /usr/local/adtpro/disks/Virtual2.po)" ]]; then - echoerr "One of the virtual drive image files has changed while ADTPro server is active." - echoerr " If using VSDRIVE, type 'vsdsync' now to see changes and prevent corruption." - fi - fi - exitval=0 - fi - rm $acmdStdErr &> /dev/null - exit $exitVal -} - -arg1=$1 - -acmdStdErr="/tmp/acmd_$RANDOM$RANDOM" - -[[ -f /usr/local/adtpro/adtpro.sh ]] && adtPath="/usr/local/adtpro" || adtPath=$(ls -1d /Applications/ADTPro* | head -1); - -if [[ ! $2 || $arg1 == "-h" ]]; then - java -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar 2> $acmdStdErr - [[ $? -eq 127 ]] && exit 127 || helpExit $arg1 -fi - -if [[ $arg1 != "-i" && $arg1 != "-ls" && $arg1 != "-l" && $arg1 != "-ll" && $arg1 != "-x" && $arg1 != "-g" && $arg1 != "-e" && $(ps aux | grep [A]DTPro) ]]; then - vsd1_md5="$(md5sum /usr/local/adtpro/disks/Virtual.po)" - vsd2_md5="$(md5sum /usr/local/adtpro/disks/Virtual2.po)" -fi - -if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2 && $3 ]]; then - - getArg= - if [[ $arg1 == "-p" ]]; then - prodosArg="$3" - imageArg="$2" - elif [[ $arg1 == "-c" ]]; then - prodosArg="$2" - imageArg="$3" - elif [[ $arg1 == "-g" || $arg1 == "-e" ]]; then - fileArg="$3" - imageArg="$2" - getArg="$arg1" - else - exit 2; - fi - - shift - - if [[ $getArg ]]; then # get file - outFile= - [[ $3 && $3 != "-" ]] && outFile="$3" - [[ ! $3 ]] && outFile="${2##*/}" - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar $getArg "$imageArg" "$fileArg" $outFile 2> $acmdStdErr - else # put file - - # test ProDOS name legitimacy - prodosPath=$(tr [:lower:] [:upper:] <<< $prodosArg ) - IFS_orig="$IFS"; IFS="/"; - prodosPathParts="$prodosPath" - for thisProdosPathPart in $prodosPathParts; do - if [[ ${#thisProdosPathPart} -gt 15 || ! $(grep ^[A-Z][0-9A-Z\.]*$ <<< $thisProdosPathPart) ]]; then - echoerr "Invalid ProDOS name: $prodosPath"; exit 1; - fi - done - IFS="$IFS_orig" - - # process filetype - [[ ${3:0:2} == "0x" ]] && ftArg="\$${3:2}" || ftArg="$3" - auxType="$4" - - # assume BIN/$2000 if filetype omitted - if [[ ! $ftArg ]]; then - ft="BIN" - auxType="\$2000" - # accept hex or decimal number for file type - elif [[ ( ${ftArg:0:1} == '$' && ${#ftArg} -eq 3 ) || $(grep [0-9] <<< ${ftArg:0:1}) ]]; then - if [[ ${ftArg:0:1} == '$' ]]; then - fc=$(tr [:upper:] [:lower:] <<< ${ftArg:1:2}) - else - fc=$(decToHex $ftArg | tr [:upper:] [:lower:]) - fi - P_00=UNK; P_01=BAD; P_02=PCD; P_03=PTX; P_04=TXT; P_05=PDA; P_06=BIN; P_07=FNT; P_08=FOT; P_09=BA3; P_0a=DA3; P_0b=WPF; P_0c=SOS; P_0f=DIR; P_10=RPD; P_11=RPI; P_12=AFD; P_13=AFM; P_14=AFR; P_15=SCL; P_16=PFS; P_19=ADB; P_1a=AWP; P_1b=ASP; P_20=TDM; P_21=IPS; P_22=UPV; P_29=3SD; P_2a=8SC; P_2b=8OB; P_2c=8IC; P_2d=8LD; P_2e=P8C; P_41=OCR; P_42=FTD; P_50=GWP; P_51=GSS; P_52=GDB; P_53=DRW; P_54=GDP; P_55=HMD; P_56=EDU; P_57=STN; P_58=HLP; P_59=COM; P_5a=CFG; P_5b=ANM; P_5c=MUM; P_5d=ENT; P_5e=DVU; P_60=PRE; P_6b=BIO; P_6d=DVR; P_6e=PRE; P_6f=HDV; P_80=GEZ; P_81=GE1; P_82=GEO; P_83=GE3; P_84=GE4; P_85=GE5; P_86=GE6; P_87=GE7; P_88=GE8; P_89=GE9; P_8a=GEA; P_8b=GEB; P_8c=GEC; P_8d=GED; P_8e=GEE; P_8f=GEF; P_a0=WP_; P_ab=GSB; P_ac=TDF; P_ad=BDF; P_b0=SRC; P_b1=OBJ; P_b2=LIB; P_b3=S16; P_b4=RTL; P_b5=EXE; P_b6=STR; P_b7=TSF; P_b8=NDA; P_b9=CDA; P_ba=TOL; P_bb=DRV; P_bc=LDF; P_bd=FST; P_bf=DOC; P_c0=PNT; P_c1=PIC; P_c2=ANI; P_c3=PAL; P_c5=OOG; P_c6=SCR; P_c7=CDV; P_c8=FON; P_c9=FND; P_ca=ICN; P_d5=MUS; P_d6=INS; P_d7=MDI; P_d8=SND; P_db=DBM; P_e0=SHK; P_e2=DTS; P_ee=R16; P_ef=PAS; P_f0=CMD; P_f9=P16; P_fa=INT; P_fb=IVR; P_fc=BAS; P_fd=VAR; P_fe=REL; P_ff=SYS; - ftVar="P_$fc"; - [[ ${!ftVar} ]] && ft=${!ftVar} || ft="\$$fc"; - else - ft="$ftArg" - fi - - # set auxtype to $0801 for Applesoft programs if not specified - [[ $ft == "BAS" && ! $auxType ]] && auxType="\$0801" - - # test for absence of stdin [[ -t 0 ]] and if absent use ProDOS name - if [[ -t 0 ]]; then - [[ ! -f $prodosArg ]] && { echoerr "$prodosArg not found."; exit 1; } - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar -d "$imageArg" $prodosPath &> /dev/null - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar -p "$imageArg" $prodosPath $ft $auxType < $prodosArg 2> $acmdStdErr - else - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar -d "$imageArg" $prodosPath &> /dev/null - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar -p "$imageArg" $prodosPath $ft $auxType 2> $acmdStdErr - fi - fi - -else - - imageArg="$2" - java -Xmx128m -jar "$adtPath"/lib/AppleCommander/AppleCommander-ac.jar "$@" 2> $acmdStdErr - -fi - -helpExit diff --git a/docs/ivanx/setup/adtpro-start.txt b/docs/ivanx/setup/adtpro-start.txt deleted file mode 100644 index 2996a1c..0000000 --- a/docs/ivanx/setup/adtpro-start.txt +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# don't do anything if ADTPro is already running -if [[ $(ps aux | grep [A]DTPro) ]]; then - - 1&>2 echo "ADTPro server is already running." - -else - - # look for eligible USB-to-serial adapter - ttyUSB= - # if lower USB port - if [[ -c /dev/ttyUSBlower ]]; then - ttyUSB=ttyUSBlower - # if hub in lower port, use lowest numbered port on hub - elif [[ $(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | wc -l) -gt 0 ]]; then - ttyUSB=$(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | head -1 | cut -c 6-) - # if hub in upper port with multiple adapters, use lowest numbered port on hub - elif [[ $(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | wc -l) -gt 1 ]]; then - ttyUSB=$(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | head -1 | cut -c 6-) - fi - - if [[ $ttyUSB ]]; then - echo -n "Please wait..." - sudo nohup adtpro.sh headless serial &> /dev/null - echo "ok." - else - 1>&2 echo "No USB-to-serial adapter found in the lower USB port, or" - 1>&2 echo " a hub on the lower USB port, or the lowest-numbered port" - 1>&2 echo " of a hub on the upper USB port. Not starting ADTPro server." - fi - -fi \ No newline at end of file diff --git a/docs/ivanx/setup/adtpro.sh.txt b/docs/ivanx/setup/adtpro.sh.txt deleted file mode 100644 index aa9b2a5..0000000 --- a/docs/ivanx/setup/adtpro.sh.txt +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash - -# ADTPro - *nix startup shell script -# -# Note: -# Invoke with the name of the communications button to push -# in order to start with that mode active (i.e. './adtpro.sh ethernet') -# -# You can set two variables here: -# 1. $MY_JAVA_HOME - to pick a particular java to run under -# 2. $ADTPRO_HOME - to say where you installed ADTPro -# -# Set default ADTPRO_HOME to be the fully qualified -# current working directory. -#export ADTPRO_HOME="`dirname \"$0\"`" -#cd "$ADTPRO_HOME" -#export ADTPRO_HOME=`pwd` - -# Uncomment and modify one or both of the lines below if you -# want to specify a particular location for Java or ADTPro. -# NOTE: be sure to include a trailing slash on MY_JAVA_HOME, -# but not on ADTPRO_HOME. -# -# export MY_JAVA_HOME=/usr/local/java/bin/ -# export ADTPRO_HOME=~/myuser/adtpro - -usageExit () { - echo "usage:" 1>&2 - echo "adtpro.sh [headless] [serial|ethernet|audio|localhost] [serialPortName]" 1>&2 - exit 1 -} - -export ADTPRO_HOME=/usr/local/adtpro -cd "$ADTPRO_HOME" - -OS=`uname` -OS_ARCH=`uname -m` - -[[ $1 == "headless" ]] && { headless=1; shift; } || headless= - -if [[ $1 && ( $1 != "serial" && $1 != "ethernet" && $1 != "audio" && $1 != "localhost" ) ]]; then - usageExit -fi - -# For Linux, use this: -if [ "$OS" = "Linux" ]; then - - serialPortName= - if [[ $1 == "serial" ]]; then - if [[ $2 ]]; then - serialPortName="$2" - [[ ${serialPortName:0:5} == "/dev/" ]] && serialPortName=${serialPortName:5} - if [[ ! -c /dev/$serialPortName ]]; then - echo "Serial port $serialPortName not found." 1>&2 - usageExit - fi - elif [[ -c /dev/ttyUSBlower ]]; then - serialPortName=ttyUSBlower - elif [[ $(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | wc -l) -gt 0 ]]; then - serialPortName=$(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | head -1 | cut -c 6-) - elif [[ $(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | wc -l) -gt 1 ]]; then - serialPortName=$(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | head -1 | cut -c 6-) - else - echo "No eligible USB-to-serial adapter found." 1>&2 - echo "Possible ports:" 1>&2 - echo " lower USB port" - echo " any port on lower USB hub with no other adapters" - echo " lowest port on USB hub on upper or lower USB port with multiple adapters" - usageExit - fi - fi - - if [[ $(grep CommPort= /usr/local/adtpro/disks/ADTPro.properties) ]]; then - if [[ $serialPortName ]]; then - sed -i "s/^CommPort=.*$/CommPort=\/dev\/$serialPortName/" /usr/local/adtpro/disks/ADTPro.properties &> /dev/null - else - serialPortName=$(grep 'CommPort=/dev/' ADTPro.properties 2> /dev/null | cut -f 3 -d '/') - fi - else - echo -e "#ADTPro.properties\n#$(date)\nCommPortSpeed=115200\nCommPortBootstrapSpeed=2400\nCommPort=/dev/$serialPortName\nCommPortBootstrapPacing=250\nHardwareHandshaking=false\nSerialIPHost=localhost\nSerialIPPort=1977" > /usr/local/adtpro/disks/ADTPro.properties - chmod ugo+w /usr/local/adtpro/disks/ADTPro.properties - fi - - ADTPRO_EXTRA_JAVA_PARMS="-Dgnu.io.rxtx.SerialPorts=/dev/$serialPortName" - - if [ -f /usr/bin/raspi-config ]; then - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/arm - elif [ "$OS_ARCH" = "i686" ]; then - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/i686-pc-linux-gnu - else - if [ "$OS_ARCH" = "i386" ]; then - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/i686-pc-linux-gnu - else - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/x86_64-unknown-linux-gnu - fi - fi -fi - -# For OSX, use this: -if [ "$OS" = "Darwin" ]; then - if [ "$OS_ARCH" = "powerpc" ]; then - export RXTXLIB=lib/rxtx/rxtx-2.1-7-bins-r2/Mac_OS_X - else - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/mac-10.5 - fi -fi - -# For Solaris, use this: -if [ "$OS" = "SunOS" ]; then - export RXTXLIB=lib/rxtx/rxtx-2.2pre2-local/sparc-sun-solaris2.10-32 -fi - -# Set up the library location. -export TWEAK1="-Djava.library.path=" -export TWEAK=$TWEAK1$ADTPRO_HOME/$RXTXLIB - -if [[ $headless ]]; then - if [[ ! $1 || ! -f /usr/bin/xvfb-run ]]; then - if [[ ! -f /usr/bin/xvfb-run ]]; then - echo "Headless operation requires xvfb." - usageExit - else - echo "Headless operation requires a communication mode (e.g. serial)." - usageExit - fi - exit 1 - else - HEADLESS="xvfb-run --auto-servernum " - fi -fi - -if [[ $serialPortName && $(ps aux | grep "/sbin/getty.*$serialPortName") ]]; then - sudo pkill -f "/sbin/getty.*$serialPortName" -fi -sudo pkill -f [A]DTPro -cd "$ADTPRO_HOME"/disks -$HEADLESS"$MY_JAVA_HOME"java -Xms256m -Xmx512m "$TWEAK" $ADTPRO_EXTRA_JAVA_PARMS -cp ../lib/ADTPro.jar:../"$RXTXLIB"/../RXTXcomm.jar:../lib/AppleCommander/AppleCommander-ac.jar org.adtpro.ADTPro $* & -if [[ $1 == "serial" ]]; then - echo "Starting up on interface $serialPortName. Please wait..." -fi -sleep 30 diff --git a/docs/ivanx/setup/baud.txt b/docs/ivanx/setup/baud.txt deleted file mode 100644 index 7d48f8e..0000000 --- a/docs/ivanx/setup/baud.txt +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -if [[ $1 == "-d" ]]; then - shift - setgetty=1 -else - setgetty= -fi - -if [[ $1 -ne 300 && $1 -ne 1200 && $1 -ne 2400 && $1 -ne 4800 && $1 -ne 9600 && $1 -ne 19200 && $1 -ne 38400 && $1 -ne 57600 && $1 -ne 115200 ]]; then - echo 'Usage: baud [-d] 300|1200|2400|4800|9600|19200|38400|57600|115200'; - echo ' -d sets default speed for all serial port shells (takes effect on logout)' - echo ' omitting -d makes change temporary and immediate' -else - if [[ $setgetty ]]; then - sudo sed -i "s/ttyAMA0 .* /ttyAMA0 $1 /" /etc/inittab; - sudo sed -i "s/ttyAMA0,[0-9]*/ttyAMA0,$1/g" /boot/cmdline.txt; - sudo sed -i "s/\(ttyUSB.*\) .* /\1 $1 /g" /etc/inittab; - sudo init q; - sudo pkill -f "/sbin/getty" - else - if [[ $(tty | grep tty) ]]; then - stty -F $(tty) $1 - fi - fi -fi - -echo -e "$(tput bold)$(tty) current $(stty -a -F $(tty) | grep -o 'speed .* baud')$(tput sgr0)" -echo -e "$(tput bold)default speed at login: $(grep ttyUSB /etc/inittab | sed 's/^.*ttyUSB[^ ]* \(.*\) .*$/\1/') baud$(tput sgr0)" diff --git a/docs/ivanx/setup/cppo-bash.txt b/docs/ivanx/setup/cppo-bash.txt deleted file mode 100644 index 7a1b93a..0000000 --- a/docs/ivanx/setup/cppo-bash.txt +++ /dev/null @@ -1,761 +0,0 @@ -#!/bin/bash - -# need to test: -# does both -e and -ad work as expected? what if you do both? - - -#--ID-bashbyter routines - -decToHex () { -# converts single-byte decimal value to hexadecimal equivalent -# arg: decimal value from 0-255 -# out: two-digit hex value from 00-FF -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ( $(printf %d "$1" 2> /dev/null) == $1 ) \ - && ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21 - # args are valid - printf %02X "$1" -} - -hexToDec () { -# converts single-byte hexadecimal value to decimal equivalent -# arg: two-digit hex value from 00-FF -# out: decimal value -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ${#1} -eq 2 ]] || return 21 - [[ $(printf %02X "0x$1" 2> /dev/null) == \ - $(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21 - # args are valid - printf %d "0x$1" -} - -hexToBin () { -# converts single-byte hexadecimal value to binary string -# arg: two-digit hex value from 00-FF -# out: binary string value -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ${#1} -eq 2 ]] || return 21 - [[ $(printf %02X "0x$1" 2> /dev/null) == \ - $(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21 - # args are valid - for n in 0 1; do - if [[ ${1:n:1} == "0" ]]; then b="0000" - elif [[ ${1:n:1} == "1" ]]; then b="0001" - elif [[ ${1:n:1} == "2" ]]; then b="0010" - elif [[ ${1:n:1} == "3" ]]; then b="0011" - elif [[ ${1:n:1} == "4" ]]; then b="0100" - elif [[ ${1:n:1} == "5" ]]; then b="0101" - elif [[ ${1:n:1} == "6" ]]; then b="0110" - elif [[ ${1:n:1} == "7" ]]; then b="0111" - elif [[ ${1:n:1} == "8" ]]; then b="1000" - elif [[ ${1:n:1} == "9" ]]; then b="1001" - elif [[ ${1:n:1} == "A" ]]; then b="1010" - elif [[ ${1:n:1} == "B" ]]; then b="1011" - elif [[ ${1:n:1} == "C" ]]; then b="1100" - elif [[ ${1:n:1} == "D" ]]; then b="1101" - elif [[ ${1:n:1} == "E" ]]; then b="1110" - elif [[ ${1:n:1} == "F" ]]; then b="1111" - fi - echo -n $b - done -} - -binToDec () { -# converts single-byte binary string (8 bits) value to decimal -# warning: no error checking -# arg: binary string up to 8 bits -# out: decimal value - dec=0 - bits=$1 - while (( ${#bits} < 8 )); do - bits="0$bits" - done - for n in {0..7}; do - (( dec+=( ${bits:$n:1} * ( 2**(7-$n) ) ) )) - done - echo -n $dec -} - -binToHex () { -# converts single-byte binary string (8 bits) value to hex -# warning: no error checking -# arg: binary string up to 8 bits -# out: hex value - echo $(decToHex $(binToDec $1)) -} - -charToDec () { -# converts single character to corresponding decimal value -# stdin OR arg: one character -# [arg overrides stdin; stdin is required for NUL (0) or LF (0x0A)] -# out: decimal value from 0-255 -#exit: 8=extraneous arg, 9=invalid stdin, -# 11=missing stdin/arg, 21=invalid arg - [[ ( ! -t 0 ) && $1 ]] && { cat > /dev/null; return 8; } - [[ ( -t 0 ) ]] && { [[ $2 ]] && return 8; [[ $1 ]] || return 11; } - # arg/stdin is potentially valid (additional check below) - charX="$1X"; [[ $1 ]] || charX="$(cat; echo -n 'X';)" - [[ ${#charX} -le 2 ]] || return $(( $([[ $1 ]]; echo $?) ? 9 : 21 )) - # above line verifies that arg/stdin is valid - [[ ${#charX} -ne 2 ]] && { echo -n 0; return 0; } - echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n' -} - -charToHex () { -# converts single character to corresponding hexadecimal value -# stdin OR arg: one character -# [arg overrides stdin; stdin is required for NUL (0) or LF (0x0A)] -# out: decimal value from 0-255 -#exit: 8=extraneous arg, 9=invalid stdin, -# 11=missing stdin/arg, 21=invalid arg - [[ ( ! -t 0 ) && $1 ]] && { cat > /dev/null; return 8; } - [[ ( -t 0 ) ]] && { [[ $2 ]] && return 8; [[ $1 ]] || return 11; } - # arg/stdin is potentially valid (additional check below) - charX="$1X"; [[ $1 ]] || charX="$(cat; echo -n 'X';)" - [[ ${#charX} -le 2 ]] || return $(( $([[ $1 ]]; echo $?) ? 9 : 21 )) - # above line verifies that stdin/arg is valid - [[ ${#charX} -ne 2 ]] && { echo -n "00"; return 0; } - printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n') -} - -decToChar () { -# converts single-byte decimal value to equivalent character -# arg: decimal number from 0-255 -# out: one character -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ( $(printf %d "$1" 2> /dev/null ) == $1 ) \ - && ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21 - # args are valid - echo -n -e "\x$(printf %02X "$1")" -} - -hexToChar () { -# converts single-byte hexadecimal value to corresponding character -# arg: two-digit hexadecimal number from 00-FF -# out: one character -#exit: 8=extraneous arg, 11=missing arg, 21=invalid arg - [[ $1 ]] || return 11 - [[ $2 ]] && return 8 - [[ ${#1} -eq 2 ]] || return 21 - [[ $(printf %02X "0x$1" 2> /dev/null) == \ - $(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21 - # args are valid - echo -n -e "\x$1" -} - -readchars () { -# read one or more characters from a file -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# arg3: (optional) # of chars to read (default is until end of file) -# out: sequence of characters -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11 - [[ $4 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - [[ $3 ]] && { [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \ - && ( $3 -ge 0 ) ]] || return 23; } - # args are valid - dd if="$1" bs=1 skip=$(($2)) $([[ $3 ]] && echo -n "count=$3") \ - 2> /dev/null -} - -readcharDec () { -# read one character from file & convert to equivalent decimal value -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# out: decimal value from 0-255 -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2 - [[ $1 ]] || return 11 - [[ $3 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - # args are valid - charX="$(dd if="$1" bs=1 skip=$(($2)) \ - count=1 2> /dev/null; echo -n X)" - [[ ${#charX} -gt 1 ]] || { echo -n 0; return 0; } - echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n' -} - -readcharHex () { -# read one character from file & convert to corresponding hex value -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# out: two-digit hex value from 00-FF -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2 - [[ $1 ]] || return 11 - [[ $3 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - # args are valid - charX="$(dd if="$1" bs=1 skip=$(($2)) \ - count=1 2> /dev/null; echo -n X)" - [[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; } - printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n') -} - -### 2-15-11 above tested on OS X and Linux - -writechars () { -# write one or more characters (bytes) to file -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before writing) -# arg3 OR stdin: sequence of characters -# [stdin required if writing NUL (0) or trailing LF (0x0A) chars] -# out: nothing -# exit: 8=extraneous arg, 11=missing arg1, -# 13=missing stdin/arg3, 22=invalid arg2 - [[ $1 ]] || { [[ -t 0 ]] || cat > /dev/null; return 11; } - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) && \ - ( $2 -ge 0 ) ]] || { [[ -t 0 ]] || cat > /dev/null; return 22; } } - [[ ( ! -t 0 ) && $3 ]] && { cat > /dev/null; return 8; } - [[ ( -t 0 ) ]] && { [[ $4 ]] && return 8; [[ $3 ]] || return 13; } - # args are valid - if [[ -t 0 ]]; then - echo -n "$3" | \ - dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null - else - dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null - fi -} - -writecharDec () { -# write corresponding character of single-byte decimal value into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: decimal number from 0-255 -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 -# out: nothing - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \ - && ( $3 -ge 0 ) && ( $3 -lt 255 ) ]] || return 23 - # args are valid - echo -n -e "\x$(printf %02X "$3")" | \ - dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null -} - -writecharHex () { -# write corresponding character of single-byte hex value into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: two-digit hexadecimal number from 00-FF -# out: nothing -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - [[ $(printf %02X "0x$3" 2> /dev/null) == \ - $(echo -n "$3" | tr [a-z] [A-Z]) ]] || return 23 - # args are valid - echo -n -e "\x$3" | \ - dd of="$1" bs=1 seek=$2 conv=notrunc 2> /dev/null -} - -writecharsHex () { -# write corresponding characters of hex values into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: string of two-digit hexadecimal numbers from 00-FF, period delimited (not checked!) -# out: nothing -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - p=0 - offset=$2 - len=${#3} - while (( p < len )); do - outByte=${3:$p:2} - [[ $(printf %02X "0x$outByte" 2> /dev/null) == \ - $(echo -n "$outByte" | tr [a-z] [A-Z]) ]] || return 23 - # args are valid - echo -n -e "\x$outByte" | \ - dd of="$1" bs=1 seek=$offset conv=notrunc 2> /dev/null - (( p += 3 )) - (( offset++ )) - done -} - - -# --- - -pdosDateToUnixDate () { - # input: ProDOS date/time bit sequence string in format: - # yyyyyyymmmmddddd000hhhhh00mmmmmm - # output: seconds since Unix epoch (1-Jan-1970), or current date/time if no ProDOS date - year=$(( $(binToDec ${1:0:7}) + 1900 )) - (( $year < 1940 )) && (( year+=100 )) - month=$(binToDec ${1:7:4}) - day=$(binToDec ${1:11:5}) - hour=$(binToDec ${1:19:5}) - minute=$(binToDec ${1:26:6}) - date -d "$year-$month-$day $hour:$minute:00" "+%s" 2> /dev/null -} - -unixDateToADDate () { - # input: seconds since Unix epoch (1-Jan-1970 00:00:00 GMT) - # output: seconds since Netatalk epoch (1-Jan-2000 00:00:00 GMT), - # in four period-delimited hex bytes (big endian) - adDate=$(( $1 - 946684800 )); - if (( $adDate < 0 )); then - (( adDate+=4294967296 )) # to get negative hex number - fi - adDateHex=$(printf %08X $adDate) - echo "${adDateHex:0:2}.${adDateHex:2:2}.${adDateHex:4:2}.${adDateHex:6:2}" -} - -# cppo support routines: -# arg1: directory block -# arg2: file index (if applicable) -# arg3: directory chunk # (if applicable) - -# returns byte position in disk image file -getStartPos () { - echo $(( ($1 * 512) + (39 * ( ($2 + ($2>11) ) % 13) ) + ( ($2>11) ? 4 : 43) )) -} - -getStorageType () { - start=$(getStartPos $1 $2) - firstByte=$(readcharDec "$image" $start) - echo $(($firstByte/16)) -} - -getFileName () { - start=$(getStartPos $1 $2) - firstByte=$(readcharDec "$image" $start) - entryType=$(($firstByte/16)) - nameLength=$(($firstByte-$entryType*16)) - echo $(readchars "$image" $(($start+1)) $nameLength) -} - -getFileType () { - start=$(getStartPos $1 $2) - echo $(readcharHex "$image" $(($start+16)) ) -} - -getKeyPointer () { - start=$(getStartPos $1 $2) - echo $(( $(readcharDec "$image" $(($start+17)) ) + \ - $(readcharDec "$image" $(($start+18)) ) * 256 )) -} - -getFileLength () { - start=$(getStartPos $1 $2) - echo $(( $(readcharDec "$image" $(($start+21)) ) + \ - $(readcharDec "$image" $(($start + 22)) ) * 256 + \ - $(readcharDec "$image" $(($start + 23)) ) * 65536 )) -} - -getAuxType () { - start=$(getStartPos $1 $2) - echo $(readcharHex "$image" $(($start+32)) ).$(readcharHex "$image" $(($start+31)) ) -} - -getCreationDate () { - #outputs prodos creation date/time as Unix time (seconds since Jan 1 1970 GMT) - #or "NONE" if there is none - start=$(getStartPos $1 $2) - pdosDate=\ -$( hexToBin $(readcharHex "$image" $(($start+25)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+24)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+27)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+26)) ) ) - pdosDateToUnixDate $pdosDate || echo "NONE" -} - -getModifiedDate () { - #outputs prodos modified date/time as Unix time (seconds since Jan 1 1970 GMT) - start=$(getStartPos $1 $2) - pdosDate=\ -$( hexToBin $(readcharHex "$image" $(($start+34)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+33)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+36)) ) )\ -$( hexToBin $(readcharHex "$image" $(($start+35)) ) ) - pdosDateToUnixDate $pdosDate || echo "NONE" -} - -#isLocked () { -# #returns 1 (meaning locked) if bit 7, 6, or 1 are clear; otherwise returns 0 -# start=$(getStartPos $1 $2) -# access=$( $hexToBin $(readcharHex "$image" $(($start+30)) ) ) -# if [[ ${access:0:1} != "1" || ${access:1:1} != "1" || ${access:7:1} != "1" ]]; then -# echo 1 -# else -# echo 0 -# fi -#} - -getVolumeName () { - echo $(getWorkingDirName 2) -} - -getWorkingDirName () { - start=$(( $1 * 512 )) - firstByte=$(readcharDec "$image" $(($start+4)) ) - entryType=$(($firstByte/16)) - nameLength=$(($firstByte-$entryType*16)) - echo $(readchars "$image" $(($start+5)) $nameLength) -} - -getDirEntryCount () { - start=$(( $1 * 512 )) - echo $(( $(readcharDec "$image" $(($start+37)) ) + \ - $(readcharDec "$image" $(($start+38)) ) * 256 )) -} - -getDirNextChunkPointer () { - start=$(( $1 * 512 )) - echo $(( $(readcharDec "$image" $(($start+2)) ) + \ - $(readcharDec "$image" $(($start+3)) ) * 256 )) -} - -# -- script begins in earnest here - -copyFile () { - activeFileBytesCopied=0 - storageType=$(getStorageType $1 $2) - keyPointer=$(getKeyPointer $1 $2) - fileLen=$(getFileLength $1 $2) - if (( $storageType == 1 )); then #seedling - copyBlock $keyPointer $fileLen - elif (( $storageType == 2 )); then #sapling - processIndexBlock $keyPointer - elif (( $storageType == 3 )); then #tree - processMasterIndexBlock $keyPointer - elif (( $storageType == 5)); then #forked fileLen - processForkedFile $keyPointer - fi -} - -copyBlock () { - #arg1: block to copy - #arg2: bytes to write (should be 512, unless final block with less than 512 bytes) - #echo $1 $2 $activeFileBytesCopied - (( $1 == 0 )) && blockSource=/dev/zero || blockSource="$image" - if (( $resourceFork > 0 )); then - [[ $AD ]] && dd if="$blockSource" of="$ADdir/$targetName" bs=1 count=$2 skip=$(($1*512)) seek=$(($activeFileBytesCopied + 741)) 2> /dev/null - [[ $EX ]] && dd if="$blockSource" of="$targetDir/${eTargetName}r" bs=1 count=$2 skip=$(($1*512)) seek=$activeFileBytesCopied 2> /dev/null - else - dd if="$blockSource" of="$targetDir/$targetName" bs=1 count=$2 skip=$(($1*512)) seek="$activeFileBytesCopied" 2> /dev/null - fi - activeFileBytesCopied=$(( $activeFileBytesCopied + $2 )) -} - -processDir () { - # arg1: dirBlock - # arg2/3/4/5: for non-key chunks: entryCount, entry#, - # workingDirName, processedEntryCount - - local entryCount - local e - local pe - local workingDirName - - if [[ $2 ]]; then - entryCount=$2 - e=$3 - workingDirName=$4 - pe=$5 - else - e=0 - pe=0 - entryCount=$(getDirEntryCount $1) - workingDirName=$(getWorkingDirName $1) - DIRPATH="$DIRPATH/$workingDirName" - if [[ $PDOSPATH_INDEX ]]; then - if (( $PDOSPATH_INDEX == 1 )); then - if [[ "/$PDOSPATH_SEGMENT" != "$DIRPATH" ]]; then - echo "ProDOS volume name does not match disk image." - exit 2 - else - (( PDOSPATH_INDEX++ )) - PDOSPATH_SEGMENT=${PDOSPATH[PDOSPATH_INDEX]} - fi - fi - else - echo $DIRPATH - fi - fi - while (( $pe < $entryCount )); do - if (( $(getStorageType $1 $e) > 0 )); then - processEntry $1 $e - (( pe++ )) - fi - (( e++ )) - (( ($e + ( $e>11 ) ) % 13 )) || { processDir $(getDirNextChunkPointer $1) $entryCount $e $workingDirName $pe; break; } - done -} - - -processEntry () { - #echo $(getFileName $1 $2) $(getStorageType $1 $2) $(getFileType $1 $2) $(getKeyPointer $1 $2) $(getFileLength $1 $2) $(getAuxType $1 $2) $(getCreationDate $1 $2) $(getModifiedDate $1 $2) - activeFileName=$(getFileName $1 $2) - activeFileSize=$(getFileLength $1 $2) - [[ $PDOSPATH_INDEX ]] || echo " $activeFileName" - - if [[ ( ! $PDOSPATH_INDEX ) || ( $activeFileName == $PDOSPATH_SEGMENT ) ]]; then - - if (( $(getStorageType $1 $2) == 13 )); then - [[ $PDOSPATH_INDEX ]] || targetDir="$targetDir/$activeFileName" - ADdir="$targetDir/.AppleDouble" - [[ $DIR || -d $targetDir ]] || mkdir -p $targetDir - [[ $DIR || ! $AD || -d $ADdir ]] || mkdir -p $ADdir - if [[ $PDOSPATH_SEGMENT ]]; then - (( PDOSPATH_INDEX++ )) - PDOSPATH_SEGMENT=${PDOSPATH[PDOSPATH_INDEX]} - fi - processDir $(getKeyPointer $1 $2) - DIRPATH=${DIRPATH%/*} - [[ $PDOSPATH_INDEX ]] || targetDir="$targetDir/.." - ADdir="$targetDir/.AppleDouble" - else - [[ $DIR ]] && return - [[ $targetName ]] || targetName=$activeFileName - [[ $EX ]] && eTargetName="$targetName#$(getFileType $1 $2 | tr [:upper:] [:lower:])$(getAuxType $1 $2 | sed 's/\.//' | tr [:upper:] [:lower:])" - touch "$targetDir/$targetName" - makeADfile - copyFile $1 $2 - creationDate=$(getCreationDate $1 $2); - modifiedDate=$(getModifiedDate $1 $2); - if [[ $creationDate == "NONE" && $modifiedDate != "NONE" ]]; then - creationDate=$modifiedDate - elif [[ $creationDate != "NONE" && $modifiedDate == "NONE" ]]; then - modifiedDate=$creationDate - elif [[ $creationDate == "NONE" && $modifiedDate == "NONE" ]]; then - creationDate=$(date "+%s") - modifiedDate=$creationDate - fi - if [[ $AD ]]; then # AppleDouble - # set dates - ADfilePath="$ADdir/$targetName" - writecharsHex "$ADfilePath" 637 $(unixDateToADDate $creationDate).$(unixDateToADDate $modifiedDate) - writecharHex "$ADfilePath" 645 80 - writecharHex "$ADfilePath" 649 80 - #set type/creator - writechars "$ADfilePath" 653 "p" - writecharsHex "$ADfilePath" 654 "$(getFileType $1 $2).$(getAuxType $1 $2)" - writechars "$ADfilePath" 657 "pdos" - fi - touch -d @$modifiedDate "$targetDir/$targetName" - if [[ $EX ]]; then # extended name - mv "$targetDir/$targetName" "$targetDir/$eTargetName" - [[ -f $targetDir/${eTargetName}r ]] && touch -d @$modifiedDate "$targetDir/${eTargetName}r" - fi - [[ $PDOSPATH_SEGMENT ]] && syncExit - targetName= - fi - - #else - #echo "$activeFileName doesn't match $PDOSPATH_SEGMENT" - fi -} - -processForkedFile () { - # finder info except type/creator - fInfoA_entryType=$(readcharDec "$image" 9) - fInfoB_entryType=$(readcharDec "$image" 27) - if (( $fInfoA_entryType==1 )); then - readchars "$image" 18 8 | writechars "$image" 661 - elif (( $fInfoA_entryType==2 )); then - readchars "$image" 10 16 | writechars "$image" 669 - fi - if (( $fInfoB_entryType==1 )); then - readchars "$image" 36 8 | writechars "$image" 661 - elif (( $fInfoB_entryType==2 )); then - readchars "$image" 28 16 | writechars "$image" 669 - fi - - for f in 0 256; do - resourceFork=$f - activeFileBytesCopied=0 - forkStart=$(( ($1 * 512) )) # start of Forked File key block - # echo --$forkStart - forkStorageType=$(readcharDec "$image" $(($forkStart+$f+0)) ) - forkKeyPointer=$(( $(readcharDec "$image" $(($forkStart+$f+1)) ) + \ - $(readcharDec "$image" $(($forkStart+$f+2)) ) * 256 )) - forkFileLen=$(( $(readcharDec "$image" $(($forkStart+$f+5)) ) + \ - $(readcharDec "$image" $(($forkStart+$f+6)) ) * 256 + \ - $(readcharDec "$image" $(($forkStart+$f+7)) ) * 65536 )) - activeFileSize=$forkFileLen - if (( $resourceFork > 0 )); then - rsrcForkLenHex=$(readcharHex "$image" $(($forkStart+$f+7)) ).\ -$(readcharHex "$image" $(($forkStart+$f+6)) ).\ -$(readcharHex "$image" $(($forkStart+$f+5)) ) - # echo ">>>$rsrcForkLenHex" - echo " [resource fork]" - [[ $AD ]] && writecharsHex "$ADdir/$targetName" 35 "$rsrcForkLenHex" - else - echo " [data fork]" - fi - if (( $forkStorageType == 1 )); then #seedling - copyBlock $forkKeyPointer $forkFileLen - elif (( $forkStorageType == 2 )); then #sapling - processIndexBlock $forkKeyPointer - elif (( $forkStorageType == 3 )); then #tree - processMasterIndexBlock $forkKeyPointer - fi - done - # echo - resourceFork=0 -} - -processMasterIndexBlock() { - processIndexBlock $1 1 -} - -processIndexBlock () { - #arg1: indexBlock - #arg2: if set, it's a Master Index Block - local pos=0 - local bytesRemaining - while (( $activeFileBytesCopied < $activeFileSize )); do - targetBlock=$(( $(readcharDec $image $(($1*512+$pos)) ) + $(readcharDec $image $(($1*512+($pos+256) )) )*256 )) - if [[ $2 ]]; then - processIndexBlock $targetBlock - else - bytesRemaining=$(($activeFileSize - $activeFileBytesCopied)) - bs=$(( $bytesRemaining<512 ? $bytesRemaining : 512 )) - copyBlock $targetBlock $bs - fi - (( pos++ )) - (( $pos > 255 )) && break # go to next entry in Master Index Block (tree) - done -} - -makeADfile () { - ADfilePath="$ADdir/$targetName" - [[ ! $AD ]] && return - dd if=/dev/zero of="$ADfilePath" bs=741 count=1 2> /dev/null - writecharsHex "$ADfilePath" $(hexToDec 00) "00.05.16.07.00.02.00.00" # ADv2 header - writecharsHex "$ADfilePath" $(hexToDec 18) "00.0D" # number of entries - writecharsHex "$ADfilePath" $(hexToDec 1A) "00.00.00.02.00.00.02.E5.00.00.00.00" # Resource Fork - writecharsHex "$ADfilePath" $(hexToDec 26) "00.00.00.03.00.00.00.B6.00.00.00.00" # Real Name - writecharsHex "$ADfilePath" $(hexToDec 32) "00.00.00.04.00.00.01.B5.00.00.00.00" # Comment - writecharsHex "$ADfilePath" $(hexToDec 3E) "00.00.00.08.00.00.02.7D.00.00.00.10" # Dates Info - writecharsHex "$ADfilePath" $(hexToDec 4A) "00.00.00.09.00.00.02.8D.00.00.00.20" # Finder Info - writecharsHex "$ADfilePath" $(hexToDec 56) "00.00.00.0B.00.00.02.C1.00.00.00.08" # ProDOS file info - writecharsHex "$ADfilePath" $(hexToDec 62) "00.00.00.0D.00.00.02.B5.00.00.00.00" # AFP short name - writecharsHex "$ADfilePath" $(hexToDec 6E) "00.00.00.0E.00.00.02.B1.00.00.00.04" # AFP File Info - writecharsHex "$ADfilePath" $(hexToDec 7A) "00.00.00.0F.00.00.02.AD.00.00.00.04" # AFP Directory ID - # dbd (second time) will create DEV, INO, SYN, SV~ -} - -syncExit () { - if [[ -d /usr/local/etc/netatalk && $AD ]]; then - echo "File(s) have been copied to the target directory. If the directory" 1>&2 - echo "is shared by Netatalk, please use 'afpsync' now." 1>&2 - fi - exit 0 -} - -usage () { - echo "usage:" - echo "copy all files: cppo [-ad|-e] imagefile targetDirectory" - echo "copy one file : cppo [-ad|-e] imagefile /FULL/PRODOS/FILE/PATH targetPath" - echo "catalog image : cppo -cat imagefile" - echo - echo "cppo copies either one file or all files from a ProDOS raw disk image" - echo "to a folder shared by Netatalk. -cat displays all files on the image." - echo "No verification or validation of the disk image is performed." - echo - echo "-ad enables creating AppleDouble header files and copying resource forks." - echo "-e appends the ProDOS type and auxtype to filenames, and copies resource" - echo " forks, so they can be preserved when added to ShrinkIt archives by" - echo " nulib2 (using its -e option)." - echo - echo "Wildcard matching (*) is not supported." - exit 1 -} - -# --- start - -if [[ $1 == "-ad" ]]; then - AD=1 - shift -fi -if [[ $1 == "-e" ]]; then - [[ $AD ]] && usage - EX=1 - shift -fi - -if [[ $1 == "-cat" ]]; then - DIR=1 - shift -fi - -[[ ( $DIR && $1 ) || ( $1 && $2 ) ]] || usage -[[ $3 && ( ${2:0:1} != "/" ) && ( ${2:0:1} != ":" ) ]] && usage - -image="$1" -[[ -f "$image" ]] || { echo "Source image not found."; exit 2; } -if [[ $3 ]]; then - pdospath=$(echo $2 | tr [:lower:] [:upper:]) - targetPath=$3 - if [[ -d $targetPath ]]; then - targetDir=$targetPath - else - targetDir="${targetPath%/*}" - targetName="${targetPath##*/}" - fi - [[ -d $targetDir ]] || { echo "Target directory not found."; exit 2; } -else - if [[ ! $DIR ]]; then - [[ -d "$2" ]] || { echo "Target directory not found."; exit 2; } - fi -fi - -activeDirBlock=0 -activeFileName="" -activeFileSize=0 -activeFileBytesCopied=0 -resourceFork=0 - -if [[ $3 ]]; then - IFS='/:' - PDOSPATH=($pdospath) - unset IFS - [[ ! ${PDOSPATH[0]} ]] && (( PDOSPATH_INDEX++ )) - PDOSPATH_SEGMENT=${PDOSPATH[PDOSPATH_INDEX]} - ADdir="$targetDir/.AppleDouble" - [[ ! $AD || -d $ADdir ]] || mkdir $ADdir - processDir 2 - echo "ProDOS file not found within image file." - exit 2 -else - if [[ ! $DIR ]]; then - targetDir="$2/$(getVolumeName)" - ADdir="$targetDir/.AppleDouble" - [[ -d $targetDir ]] || mkdir -p $targetDir - [[ ! $AD || -d $ADdir ]] || mkdir -p $ADdir - fi - processDir 2 - [[ $DIR ]] || syncExit -fi diff --git a/docs/ivanx/setup/cppo.txt b/docs/ivanx/setup/cppo.txt deleted file mode 100644 index fdbf660..0000000 --- a/docs/ivanx/setup/cppo.txt +++ /dev/null @@ -1,882 +0,0 @@ -#!/usr/bin/env python -"""cppo: Copy or catalog one or all files from a ProDOS raw disk image. - -copy all files: - cppo [-ad|-e] imagefile target_directory -copy one file: - cppo [-ad|-e] imagefile /FULL/PRODOS/FILE/PATH target_path -catalog image: - cppo -cat imagefile - --ad : Create AppleDouble header files and preserve resource forks. --e : Append ProDOS type and auxtype to filenames, and copy resource - forks, for adding to ShrinkIt archives with Nulib2 - using its -e option. - -Wildcard matching/globbing (*) is not supported. -No verification or validation of the disk image is performed. - -(Compatible with Python 2.6 and later, including 3.x.) -""" - -# cppo by Ivan X, ivan@ivanx.com, ivanx.com/appleii - -# If anyone's looking at this, and feels it's not sufficiently Pythonic, -# I know that. It's pretty much a line-for-line conversion of the original -# Bash script. I did start a beautiful from-the-ground-up object-oriented -# version, then realized it would be faster to translate it ugly and quick. - -# imports for python 3 code compatibility -from __future__ import print_function -from __future__ import unicode_literals -from __future__ import absolute_import -from __future__ import division - -import sys -import os -import time -import datetime - -# Intentially fails on pre-2.6 so user can see what's wrong -b'ERROR: cppo requires Python 2.6 or later, including 3.x.' - -class Globals(object): - pass - -g = Globals() - -g.imageData = b'' -g.outFileData = bytearray(b'') -g.adFileData = bytearray(b'') -g.exFileData = bytearray(b'') - -g.activeDirBlock = None -g.activeFileName = None -g.activeFileSize = None -g.activeFileBytesCopied = 0 -g.resourceFork = 0 - -g.PDOSPATH = [] -g.PDOSPATH_INDEX = 0 -g.PDOSPATH_SEGMENT = None -g.DIRPATH = "" - -g.targetName = None -g.targetDir = "" -g.ADdir = None -g.imageFile = None - -g.AD = 0 -g.EX = 0 -g.DIR = 0 -g.silent = 0 - -# functions - -def pdosDateToUnixDate(arg1): - # input: ProDOS date/time bit sequence string in format: - # "yyyyyyymmmmddddd000hhhhh00mmmmmm" (ustr) - # output: seconds since Unix epoch (1-Jan-1970), - # or current date/time if no ProDOS date - year = (binToDec(slyce(arg1,0,7)) + 1900) - if (year < 1940): year += 100 - month = binToDec(slyce(arg1,7,4)) - day = binToDec(slyce(arg1,11,5)) - hour = binToDec(slyce(arg1,19,5)) - minute = binToDec(slyce(arg1,26,6)) - # print(year, month, day, hour, minute) - td = (datetime.datetime(year, month, day, hour, minute) - - datetime.datetime(1970,1,1)) - unixDate_naive = (td.days*24*60*60 + td.seconds) - td2 = (datetime.datetime.fromtimestamp(unixDate_naive) - - datetime.datetime.utcfromtimestamp(unixDate_naive)) - utcoffset = (td2.days*24*60*60 + td2.seconds) - # print(unixDate_naive - utcoffset) - return (unixDate_naive - utcoffset) # local time zone with DST - -def unixDateToADDate(arg1): - # input: seconds since Unix epoch (1-Jan-1970 00:00:00 GMT) - # output: seconds since Netatalk epoch (1-Jan-2000 00:00:00 GMT), - # in hex-ustr (big endian) - adDate = (arg1 - 946684800) - if (adDate < 0 ): - adDate += 4294967296 # to get negative hex number - adDateHex = to_hex(adDate).zfill(8).upper() - # print(arg1, adDate, adDateHex) - return adDateHex - -# cppo support routines: -# arg1: directory block -# arg2: file index (if applicable) -# arg3: directory chunk # (if applicable) - -#most of these not tested yet in Python -# returns byte position in disk image file -def getStartPos(arg1, arg2): - return ( (arg1 * 512) + - (39 * ((arg2 + (arg2 > 11)) % 13)) + - (4 if (arg2 > 11) else 43) ) - -def getStorageType(arg1, arg2): - start = getStartPos(arg1, arg2) - firstByte = readcharDec(g.imageData, start) - return (firstByte//16) - -def getFileName(arg1, arg2): - start = getStartPos(arg1, arg2) - firstByte = readcharDec(g.imageData, start) - entryType = (firstByte//16) - nameLength = (firstByte - entryType*16) - return readchars(g.imageData, start+1, nameLength) - -def getFileType(arg1, arg2): - start = getStartPos(arg1, arg2) - return readcharHex(g.imageData, start+16) - -def getKeyPointer(arg1, arg2): - start = getStartPos(arg1, arg2) - return (readcharDec(g.imageData, start+17) + - readcharDec(g.imageData, start+18)*256) - -def getFileLength(arg1, arg2): - start = getStartPos(arg1, arg2) - return (readcharDec(g.imageData, start+21) + - readcharDec(g.imageData, start+22)*256 + - readcharDec(g.imageData, start+23)*65536) - -def getAuxType(arg1, arg2): - start = getStartPos(arg1, arg2) - return (readcharHex(g.imageData, start+32) + - readcharHex(g.imageData, start+31)) - -def getCreationDate(arg1, arg2): - #outputs prodos creation date/time as Unix time - # (seconds since Jan 1 1970 GMT) - #or None if there is none - start = getStartPos(arg1, arg2) - pdosDate = (hexToBin(readcharHex(g.imageData, start+25)) + - hexToBin(readcharHex(g.imageData, start+24)) + - hexToBin(readcharHex(g.imageData, start+27)) + - hexToBin(readcharHex(g.imageData, start+26))) - try: - rVal = pdosDateToUnixDate(pdosDate) - except Exception: - rVal = None - return rVal - -def getModifiedDate(arg1, arg2): - #outputs prodos modified date/time as Unix time - # (seconds since Jan 1 1970 GMT) - #or None if there is none - start = getStartPos(arg1, arg2) - pdosDate = (hexToBin(readcharHex(g.imageData, start+34)) + - hexToBin(readcharHex(g.imageData, start+33)) + - hexToBin(readcharHex(g.imageData, start+36)) + - hexToBin(readcharHex(g.imageData, start+35))) - try: - rVal = pdosDateToUnixDate(pdosDate) - except Exception: - rVal = None - return rVal - -def getVolumeName(): - return getWorkingDirName(2) - -def getWorkingDirName(arg1): - start = ( arg1 * 512 ) - firstByte = readcharDec(g.imageData, start+4) - entryType = (firstByte//16) - nameLength = (firstByte - entryType*16) - return readchars(g.imageData, start+5, nameLength) - -def getDirEntryCount(arg1): - start = ( arg1 * 512 ) - return (readcharDec(g.imageData, start+37) + - readcharDec(g.imageData, start+38)*256) - -def getDirNextChunkPointer(arg1): - start = ( arg1 * 512 ) - return (readcharDec(g.imageData, start+2) + - readcharDec(g.imageData, start+3)*256) - -# -- script begins in earnest here - -def copyFile(arg1, arg2): - g.outFileData = bytearray(b'') - g.exFileData = bytearray(b'') - g.activeFileBytesCopied = 0 - storageType = getStorageType(arg1, arg2) - keyPointer = getKeyPointer(arg1, arg2) - fileLen = getFileLength(arg1, arg2) - if (storageType == 1): #seedling - copyBlock(keyPointer, fileLen) - elif (storageType == 2): #sapling - processIndexBlock(keyPointer) - elif (storageType == 3): #tree - processMasterIndexBlock(keyPointer) - elif (storageType == 5): #extended (forked) - processForkedFile(keyPointer) - -def copyBlock(arg1, arg2): - #arg1: block to copy - #arg2: bytes to write (should be 512, - # unless final block with less than 512 bytes) - #print(arg1 + " " + arg2 + " " + g.activeFileBytesCopied) - if (arg1 == 0): - outBytes = (b'\x00' * arg2) - else: - outBytes = slyce(g.imageData, arg1*512, arg2) - if (g.resourceFork > 0): - if g.AD: - g.adFileData[g.activeFileBytesCopied+741: - (g.activeFileBytesCopied+741 + arg2)] = outBytes - if g.EX: - g.exFileData[g.activeFileBytesCopied: - (g.activeFileBytesCopied + arg2)] = outBytes - else: - g.outFileData[g.activeFileBytesCopied: - (g.activeFileBytesCopied + arg2)] = outBytes - g.activeFileBytesCopied += arg2 - -def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None): - # arg1: dirBlock - # arg2/3/4/5: for non-key chunks: entryCount, entry#, - # workingDirName, processedEntryCount - - entryCount = None - e = None - pe = None - workingDirName = None - - if arg2: - entryCount = arg2 - e = arg3 - workingDirName = arg4 - pe = arg5 - else: - e = 0 - pe = 0 - entryCount = getDirEntryCount(arg1) - workingDirName = getWorkingDirName(arg1).decode("L1") - g.DIRPATH = (g.DIRPATH + "/" + workingDirName) - if g.PDOSPATH_INDEX: - if (g.PDOSPATH_INDEX == 1): - if (("/" + g.PDOSPATH_SEGMENT) != g.DIRPATH): - print("ProDOS volume name does not match disk image.") - sys.exit(2) - else: - g.PDOSPATH_INDEX += 1 - g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX] - else: - print(g.DIRPATH) - while (pe < entryCount): - if (getStorageType(arg1, e) > 0): - processEntry(arg1, e) - pe += 1 - e += 1 - if not ((e + ( e>11 ) ) % 13): - processDir(getDirNextChunkPointer(arg1), - entryCount, - e, - workingDirName, - pe) - break - -def processEntry(arg1, arg2): - ''' - print(getFileName(arg1, arg2), getStorageType(arg1, arg2), - getFileType(arg1, arg2), getKeyPointer(arg1, arg2), - getFileLength(arg1, arg2), getAuxType(arg1, arg2), - getCreationDate(arg1, arg2), getModifiedDate(arg1, arg2)) - ''' - g.activeFileName = getFileName(arg1 ,arg2).decode("L1") - g.activeFileSize = getFileLength(arg1, arg2) - - if ((not g.PDOSPATH_INDEX) or (g.activeFileName == g.PDOSPATH_SEGMENT)): - - if (getStorageType(arg1, arg2) == 13): # if ProDOS directory - if not g.PDOSPATH_INDEX: - g.targetDir = (g.targetDir + "/" + g.activeFileName) - g.ADdir = (g.targetDir + "/.AppleDouble") - if not (g.DIR or os.path.isdir(g.targetDir)): - makedirs(g.targetDir) - if not (g.DIR or (not g.AD) or os.path.isdir(g.ADdir)): - makedirs(g.ADdir) - if g.PDOSPATH_SEGMENT: - g.PDOSPATH_INDEX += 1 - g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX] - processDir(getKeyPointer(arg1, arg2)) - g.DIRPATH = g.DIRPATH.rsplit("/", 1)[0] - if not g.PDOSPATH_INDEX: - g.targetDir = g.targetDir.rsplit("/", 1)[0] - g.ADdir = (g.targetDir + "/.AppleDouble") - else: # if ProDOS file - if not g.PDOSPATH_INDEX: - print(" " + g.activeFileName) - if g.DIR: - return - if not g.targetName: - g.targetName = g.activeFileName - if g.EX: - eTargetName = (g.targetName + "#" + - getFileType(arg1, arg2).lower() + - getAuxType(arg1, arg2).lower()) - touch(g.targetDir + "/" + g.targetName) - if g.AD: makeADfile() - copyFile(arg1, arg2) - saveFile((g.targetDir + "/" + g.targetName), g.outFileData) - creationDate = getCreationDate(arg1, arg2) - modifiedDate = getModifiedDate(arg1, arg2) - if (creationDate is None and modifiedDate is not None): - creationDate = modifiedDate - elif (creationDate is not None and modifiedDate is None): - modifiedDate = creationDate - elif (creationDate is None and modifiedDate is None): - creationDate = (datetime.datetime.today() - - datetime.datetime(1970,1,1)).days*24*60*60 - modifiedDate = creationDate - if g.AD: # AppleDouble - # set dates - ADfilePath = (g.ADdir + "/" + g.targetName) - writecharsHex(g.adFileData, - 637, - (unixDateToADDate(creationDate) + - unixDateToADDate(modifiedDate))) - writecharHex(g.adFileData, 645, "80") - writecharHex(g.adFileData, 649, "80") - #set type/creator - writechars(g.adFileData, 653, b'p') - writecharsHex(g.adFileData, - 654, - (getFileType(arg1, arg2) + - getAuxType(arg1, arg2))) - writechars(g.adFileData, 657, b'pdos') - saveFile(ADfilePath, g.adFileData) - touch((g.targetDir + "/" + g.targetName), modifiedDate) - if g.EX: # extended name - os.rename((g.targetDir + "/" + g.targetName), - (g.targetDir + "/" + eTargetName)) - if (len(g.exFileData) > 0): - saveFile((g.targetDir + "/" + eTargetName + "r"), - g.exFileData) - touch((g.targetDir + "/" + eTargetName + "r"), - modifiedDate) - if g.PDOSPATH_SEGMENT: - syncExit() - g.targetName = None - - #else: - #print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT) - -def processForkedFile(arg1): - # finder info except type/creator - fInfoA_entryType = readcharDec(g.imageData, 9) - fInfoB_entryType = readcharDec(g.imageData, 27) - if (fInfoA_entryType == 1): - writechars(g.imageData, 661, readchars(g.imageData, 18, 8)) - elif (fInfoA_entryType == 2): - writechars(g.imageData, 669, readchars(g.imageData, 10, 16)) - if (fInfoB_entryType == 1): - writechars(g.imageData, 661, readchars(g.imageData, 36, 8)) - elif (fInfoB_entryType == 2): - writechars(g.imageData, 669, readchars(g.imageData, 28, 16)) - - for f in [0, 256]: - g.resourceFork = f - g.activeFileBytesCopied = 0 - forkStart = (arg1 * 512) # start of Forked File key block - # print("--" + forkStart) - forkStorageType = readcharDec(g.imageData, forkStart+f+0) - forkKeyPointer = (readcharDec(g.imageData, forkStart+f+1) + - readcharDec(g.imageData, forkStart+f+2)*256) - forkFileLen = (readcharDec(g.imageData, forkStart+f+5) + - readcharDec(g.imageData, forkStart+f+6)*256 + - readcharDec(g.imageData, forkStart+f+7)*256*256) - g.activeFileSize = forkFileLen - if (g.resourceFork > 0): - rsrcForkLenHex = (readcharHex(g.imageData, forkStart+f+7) + - readcharHex(g.imageData, forkStart+f+6) + - readcharHex(g.imageData, forkStart+f+5)) - # print(">>>" + rsrcForkLenHex) - print(" [resource fork]") - if g.AD: - writecharsHex(g.adFileData, 35, rsrcForkLenHex) - else: - print(" [data fork]") - if (forkStorageType == 1): #seedling - copyBlock(forkKeyPointer, forkFileLen) - elif (forkStorageType == 2): #sapling - processIndexBlock(forkKeyPointer) - elif (forkStorageType == 3): #tree - processMasterIndexBlock(forkKeyPointer) - # print() - g.resourceFork = 0 - -def processMasterIndexBlock(arg1): - processIndexBlock(arg1, True) - -def processIndexBlock(arg1, arg2=False): - #arg1: indexBlock - #arg2: if True, it's a Master Index Block - pos = 0 - bytesRemaining = g.activeFileSize - while (g.activeFileBytesCopied < g.activeFileSize): - targetBlock = (readcharDec(g.imageData, arg1*512+pos) + - readcharDec(g.imageData, arg1*512+(pos+256))*256) - if arg2: - processIndexBlock(targetBlock) - else: - bytesRemaining = (g.activeFileSize - g.activeFileBytesCopied) - bs = (bytesRemaining if (bytesRemaining < 512) else 512) - copyBlock(targetBlock, bs) - pos += 1 - if (pos > 255): - break # go to next entry in Master Index Block (tree) - -def makeADfile(): - if not g.AD: return - touch(g.ADdir + "/" + g.targetName) - g.adFileData = bytearray(b'\x00' * 741) - # ADv2 header - writecharsHex(g.adFileData, hexToDec("00"), "0005160700020000") - # number of entries - writecharsHex(g.adFileData, hexToDec("18"), "000D") - # Resource Fork - writecharsHex(g.adFileData, hexToDec("1A"), "00000002000002E500000000") - # Real Name - writecharsHex(g.adFileData, hexToDec("26"), "00000003000000B600000000") - # Comment - writecharsHex(g.adFileData, hexToDec("32"), "00000004000001B500000000") - # Dates Info - writecharsHex(g.adFileData, hexToDec("3E"), "000000080000027D00000010") - # Finder Info - writecharsHex(g.adFileData, hexToDec("4A"), "000000090000028D00000020") - # ProDOS file info - writecharsHex(g.adFileData, hexToDec("56"), "0000000B000002C100000008") - # AFP short name - writecharsHex(g.adFileData, hexToDec("62"), "0000000D000002B500000000") - # AFP File Info - writecharsHex(g.adFileData, hexToDec("6E"), "0000000E000002B100000004") - # AFP Directory ID - writecharsHex(g.adFileData, hexToDec("7A"), "0000000F000002AD00000004") - # dbd (second time) will create DEV, INO, SYN, SV~ - -def syncExit(): - if (not g.silent and g.AD and os.path.isdir("/usr/local/etc/netatalk")): - print("File(s) have been copied to the target directory. " + - "If the directory") - print("is shared by Netatalk, please type 'afpsync' now.") - # saveFile(g.imageFile, g.imageData) - sys.exit(0) - -def usage(): - print(sys.modules[__name__].__doc__) - sys.exit(1) - -# --- ID bashbyter functions (adapted) - -def decToHex(arg1): -# converts single-byte decimal value to hexadecimal equivalent -# arg: decimal value from 0-255 -# out: two-digit hex string from 00-FF -#exit: 21=invalid arg - if (arg1<0 or arg1>255): sys.exit(21) - return to_hex(arg1).upper() - -def hexToDec(arg1): -# converts single-byte hexadecimal value to decimal equivalent -# arg: two-digit hex value from 00-FF -# out: decimal value -#exit: 21=invalid arg - if (len(arg1) != 2): return 21 - return to_dec(arg1) - -def hexToBin(arg1): -# converts single-byte hexadecimal value to binary string -# arg: two-digit hex value from 00-FF -# out: binary string value -#exit: 21=invalid arg - if (len(arg1) != 2): return 21 - return to_bin(arg1).zfill(8) - -def binToDec(arg1): -# converts single-byte binary string (8 bits) value to decimal -# warning: no error checking -# arg: binary string up to 8 bits -# out: decimal value - return to_dec([arg1]) - -def binToHex(arg1): -# converts single-byte binary string (8 bits) value to hex -# warning: no error checking -# arg: binary string up to 8 bits -# out: hex value - return to_hex(arg1).upper() - -def charToDec(arg1): -# converts single char (of type bytes) to corresponding decimal value -# arg: one char (of type bytes) -# out: decimal value from 0-255 -#exit: 21=invalid arg - if (len(arg1) != 1): return 21 - return to_dec(arg1) - -def charToHex(arg1): -# converts single char (of type bytes) to corresponding hex value -# arg: one char (of type bytes) -# out: hexadecimal value from 00-FF -#exit: 21=invalid arg - if (len(arg1) != 1): return 21 - return to_hex(arg1).upper() - -def decToChar(arg1): -# converts single-byte decimal value to equivalent char (of type bytes) -# arg: decimal number from 0-255 -# out: one character -#exit: 21=invalid arg - if (arg1<0 or arg1>255): sys.exit(21) - return to_bytes(arg1) - -def hexToChar(arg1): -# converts single-byte hex value to corresponding char (of type bytes) -# arg: two-digit hexadecimal number from 00-FF -# out: one character -#exit: 21=invalid arg - if (len(arg1) != 2): return 21 - return to_bytes(arg1) - -def readchars(arg1, arg2=0, arg3=0): -# read one or more characters from a bytes variable -# arg1: bytes or bytearray variable -# arg2: (optional) offset (# of bytes to skip before reading) -# arg3: (optional) # of chars to read (default is to end of bytes var) -# out: sequence of characters (bytes or bytearray) -# exit: 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - if not (isinstance(arg1, bytes) or isinstance(arg1, bytearray)): - sys.exit(21) - if (arg2<0): sys.exit(22) - if (arg3<0): sys.exit(23) - if (arg3 == 0): - arg3 = len(arg1) - return slyce(arg1, arg2, arg3) - -def readcharDec(arg1, arg2=0): -# read one character from bytes var & convert to equivalent dec value -# arg1: bytes var -# arg2: (optional) offset (# of bytes to skip before reading) -# out: decimal value from 0-255 -# exit: 21=invalid arg1, 22=invalid arg2 - if not (isinstance(arg1, bytes) or isinstance(arg1, bytearray)): - sys.exit(21) - if (arg2<0): sys.exit(22) - return to_dec(slyce(arg1, arg2, 1)) - -def readcharHex(arg1, arg2=0): -# read one character from bytes var & convert to corresponding hex value -# arg1: bytes var -# arg2: (optional) offset (# of bytes to skip before reading) -# out: two-digit hex value from 00-FF -# exit: 21=invalid arg1, 22=invalid arg2 - if not (isinstance(arg1, bytes) or isinstance(arg1, bytearray)): - sys.exit(21) - if (arg2<0): sys.exit(22) - return to_hex(slyce(arg1, arg2, 1)) - -def writechars(arg1, arg2, arg3): -# write one or more characters (bytes) to bytearray -# arg1: bytearray variable -# arg2: offset (# of bytes to skip before writing) -# arg3: sequence of bytes (or bytearray) -# out: nothing -# exit: 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - if not isinstance(arg1, bytearray): sys.exit(21) - if (arg2<0): sys.exit(22) - if not (isinstance(arg3, bytes) or isinstance(arg3, bytearray)): - sys.exit(23) - arg1[arg2:arg2+len(arg3)] = arg3 - -def writecharDec(arg1, arg2, arg3): -# write corresponding char of single-byte decimal value into bytearray -# arg1: bytearray -# arg2: offset (# of bytes to skip before writing) -# arg3: decimal number from 0-255 -# exit: 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 -# out: nothing - if not isinstance(arg1, bytearray): sys.exit(21) - if (arg2<0): sys.exit(22) - if not isnumber(arg3): sys.exit(23) - arg1[arg2:arg2+1] = to_bytes(arg3) - -def writecharHex(arg1, arg2, arg3): -# write corresponding character of single-byte hex value into bytearray -# arg1: bytearray -# arg2: offset (# of bytes to skip before writing) -# arg3: two-digit hexadecimal number from 00-FF -# out: nothing -# exit: 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - if not isinstance(arg1, bytearray): sys.exit(21) - if (arg2<0): sys.exit(22) - if not isinstance(arg3, type("".encode().decode())): sys.exit(23) - arg1[arg2:arg2+1] = to_bytes(arg3) - -def writecharsHex(arg1, arg2, arg3): -# write corresponding characters of hex values into bytearray -# arg1: bytearray -# arg2: offset (# of bytes to skip before writing) -# arg3: string of two-digit hexadecimal numbers from 00-FF -# out: nothing -# exit: 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - if not isinstance(arg1, bytearray): sys.exit(21) - if (arg2<0): sys.exit(22) - if not isinstance(arg3, type("".encode().decode())): sys.exit(23) - arg1[arg2:arg2+len(to_bytes(arg3))] = to_bytes(arg3) - -#---- IvanX general purpose functions ----# - -def slyce(val, start_pos=0, length=1, reverse=False): - """returns slice of object (but not a slice object) - allows specifying length, and 3.x "bytes" consistency""" - the_slyce = val[start_pos:start_pos+length] - return (the_slyce[::-1] if reverse else the_slyce) - -def to_hex(val): - """convert bytes, decimal number, or [bin-ustr] to two-digit hex values - unlike hex(), accepts bytes; has no leading 0x or trailing L""" - from binascii import b2a_hex - if isinstance(val, list): # [bin-ustr] - val = int(val[0], 2) - if isinstance(val, bytes): # bytes - return b2a_hex(val).decode("L1") - elif isnumber(val): - # .encode().decode() always returns unicode in both P2 and P3 - return (hex(val)[2:].split("L")[0]).encode("L1").decode("L1") - else: - raise Exception("to_hex() requires bytes, int/long, or [bin-ustr]") - -def hex_slyce(val, start_pos=0, length=1, little_endian=False): - """returns bytes slyce as hex-ustr""" - return to_hex(slyce(val, start_pos, length, little_endian)) - -def dec_slyce(val, start_pos=0, length=1, little_endian=False): - """returns bytes slyce converted to decimal int/long""" - return to_dec(hex_slyce(val, start_pos, length, little_endian)) - -def bin_slyce(val, start_pos=0, length=1, little_endian=False): - """returns bytes slyce converted to bin-ustr""" - return to_bin(hex_slyce(val, start_pos, length, little_endian)) - -def to_dec(val): - """convert bytes, hex-ustr or [bin-ustr] to decimal int/long""" - if isinstance(val, list): # [bin-ustr] - return int(val[0], 2) - elif isinstance(val, bytes): # bytes - return int(to_hex(val), 16) - elif isinstance(val, type("".encode().decode())): # hex-ustr - return int(val, 16) - else: - raise Exception("to_dec() requires bytes, hex-ustr or [bin-ustr]") - -def to_bin(val): - """convert bytes, hex-ustr, or int/long to bin-ustr""" - if isinstance(val, bytes): # bytes - return (bin(to_dec(to_hex(val))))[2:].encode("L1").decode("L1") - elif isinstance(val, type("".encode().decode())): # hex-ustr - return (bin(int(val, 16)))[2:].encode("L1").decode("L1") - elif isnumber(val): # int/long - return (bin(val))[2:].encode("L1").decode("L1") - else: - raise Exception("to_bin() requires bytes, hex-ustr, or int/long") - -def to_bytes(val): - """converts hex-ustr, int/long, or [bin-ustr] to bytes""" - from binascii import a2b_hex - if isinstance(val, list): # [bin-ustr] - val = to_hex(val[0]) - if isnumber(val): # int/long - val = to_hex(val) - if isinstance(val, type("".encode().decode())): # hex-ustr - return a2b_hex(bytes(val.encode("L1"))) # works on both P2 and P3 - else: - raise Exception( - "to_bytes() requires hex-ustr, int/long, or [bin-ustr]") - -def shift(items): - """Shift list items to left, losing the first item. - - in : list - out: list - """ - for i in range(0, (len(items)-1)): - items[i] = items[i+1] - del items[-1] - return items - -def s(string): - """Perform local variable substution, e.g. 'total: {num} items'""" - # http://stackoverflow.com/questions/2960772/ - # putting-a-variable-inside-a-string-python - # http://stackoverflow.com/questions/6618795/ - # get-locals-from-calling-namespace-in-python - import inspect - frame = inspect.currentframe() - try: - rVal = string.format(**frame.f_back.f_locals) - finally: - del frame - return rVal - -def get_object_names(cls, include_subclasses=True): - object_names = [] - for (this_object_name, this_object_id) in list(globals().items()): - if include_subclasses: - if isinstance(this_object_id, cls): - object_names.append(this_object_name) - else: - if type(this_object_id) is cls: - object_names.append(this_object_name) - return object_names - -def touch(filePath, modTime=None): - # http://stackoverflow.com/questions/1158076/implement-touch-using-python - import os - if (os.name == "nt"): - if filePath[-1] == ".": filePath += "-" - filePath = filePath.replace("./", ".-/") - with open(filePath, "ab"): - os.utime(filePath, (None if (modTime is None) else (modTime, modTime))) - -def mkdir(dirPath): - import os - if (os.name == "nt"): - if dirPath[-1] == ".": dirPath += "-" - dirPath = dirPath.replace("./", ".-/") - try: - os.mkdir(dirPath) - except FileExistsError: - pass - -def makedirs(dirPath): - import os - if (os.name == "nt"): - if dirPath[-1] == ".": dirPath += "-" - dirPath = dirPath.replace("./", ".-/") - try: - os.makedirs(dirPath) - except FileExistsError: - pass - -def loadFile(filePath): - import os - if (os.name == "nt"): - if filePath[-1] == ".": filePath += "-" - filePath = filePath.replace("./", ".-/") - with open(filePath, "rb") as imageHandle: - return imageHandle.read() - -def saveFile(filePath, fileData): - import os - if (os.name == "nt"): - if filePath[-1] == ".": filePath += "-" - filePath = filePath.replace("./", ".-/") - with open(filePath, "wb") as imageHandle: - imageHandle.write(fileData) - -def isnumber(number): - try: # make sure it's not a string - len(number) - return False - except TypeError: - pass - try: - int(number) - except ValueError: - return False - return True - -#---- end IvanX general purpose functions ----# - - -# --- start - -args = sys.argv -if (len(args) == 1): - usage() - -if (args[1] == "-s"): - g.silent=1 - args = args[1:] #shift - -if (args[1] == "-ad"): - g.AD = 1 - args = args[1:] #shift - -if (args[1] == "-e"): - if g.AD: usage() - g.EX = 1 - args = args[1:] #shift - -if (args[1] == "-cat"): - g.DIR = 1 - args = args[1:] - -if not ((g.DIR and len(args) >= 2) or (len(args) >= 3)): - usage() -if ((len(args) == 4) and - (slyce(args[2],0,1) != "/") and - (slyce(args[2],0,1) != ":")): - usage() - -g.imageFile = args[1] -if not os.path.isfile(g.imageFile): - print("Source " + g.imageFile + " was not found.") - sys.exit(2) -g.imageData = loadFile(g.imageFile) - -if (len(args) == 4): - g.PDOSPATH = args[2].upper() - targetPath = args[3] - if os.path.isdir(targetPath): - g.targetDir = targetPath - else: - g.targetDir = targetPath.rsplit("/", 1)[0] - g.targetName = targetPath.rsplit("/", 1)[1] - if not os.path.isdir(g.targetDir): - print("Target directory not found.") - sys.exit(2) -else: - if not g.DIR: - if not os.path.isdir(args[2]): - print("Target directory not found.") - sys.exit(2) - -g.activeDirBlock = 0 -g.activeFileName = "" -g.activeFileSize = 0 -g.activeFileBytesCopied = 0 -g.resourceFork = 0 -g.PDOSPATH_INDEX = 0 - -if (len(args) == 4): - g.PDOSPATH = g.PDOSPATH.replace(':', '/').split('/') - if not g.PDOSPATH[0]: - g.PDOSPATH_INDEX += 1 - g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX] - g.ADdir = (g.targetDir + "/.AppleDouble") - if not ((not g.AD) or os.path.isdir(g.ADdir)): - mkdir(g.ADdir) - processDir(2) - print("ProDOS file not found within image file.") - sys.exit(2) -else: - if not g.DIR: - # print(args[0], args[1], args[2]) - g.targetDir = (args[2] + "/" + getVolumeName().decode("L1")) - g.ADdir = (g.targetDir + "/.AppleDouble") - if not os.path.isdir(g.targetDir): - makedirs(g.targetDir) - if not ((not g.AD) or os.path.isdir(g.ADdir)): - makedirs(g.ADdir) - processDir(2) - if not g.DIR: - syncExit() - diff --git a/docs/ivanx/setup/dopo.txt b/docs/ivanx/setup/dopo.txt deleted file mode 100644 index b097d0b..0000000 --- a/docs/ivanx/setup/dopo.txt +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -# follows gzip syntax -- acts in place if filename provided, outputs to -# stdout with -c, accepts stdin and outputs to stdout if filename is - or absent - -# output to stdout? -if [[ "$1" == "-c" ]]; then - shift; - stdout=1; -else - stdout= -fi - -# use stdin? -if [[ ! $1 || "$1" == "-" ]]; then - stdin=1 - stdout=1 -elif [[ $1 && ! -f "$1" ]]; then - echo "usage: dopo [-c] [-|140KdiskImageFilename] 1>&2"; - exit 1; -else - stdin= -fi - -if [[ ! $stdout ]]; then - #get filename extension, in lowercase - f="$(tr [:upper:] [:lower:] <<< ${1##*.})"; - - #if it's dsk/do/po, get name without extension - [[ "$f" == "dsk" || "$f" == "do" || "$f" == "po" ]] && of="${1%.*}" || of="$1"; - - #if name had .po extension, append .dsk to outfile name, otherwise append .po - [[ "$f" == "po" ]] && of="$of.dsk" || of="$of.po" - - # set outfile param for dd - ofile="$of" -else - ofile="/tmp/$$.dopo_out" -fi - -if [[ ! $stdin ]]; then - # set infile param for dd - ifile="$1" -elif [[ -t 0 ]]; then - echo "usage: dopo [-c] [-|140KdiskImageFilename]" 1>&2; exit 1; -else - ifile="/tmp/$$.dopo_in" - cat > "$ifile" -fi - -# verify file is 140K by successfully reading 140K'th byte, and failing to read the one past -[[ $(dd if="$ifile" of=/dev/null bs=1 skip=143359 2>&1 | tail -1 | cut -d ' ' -f 1) -ne 1 || $(dd if="$ifile" of=/dev/null bs=1 skip=143360 2>&1 | tail -1 | cut -d ' ' -f 1) -ne 0 ]] && badInput=1 || badInput= - -if [[ $badInput ]]; then - if [[ ! $stdin ]]; then - echo -n "$1 doesn't appear to be a 140K image. Continue? " 1>&2; - read - [[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]] || exit 1; - else - echo "warning: Input file doesn't appear to be a 140K image." 1>&2 - echo " Output file is likely to be useless." 1>&2 - fi -fi - -# for each track -for t in {0..34}; do - # read each sector in the right sequence to make (or unmake) - # valid ProDOS blocks (sector pairs) - for s in 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15; do - # copy the sector from the old file to the new one - dd if="$ifile" of="$ofile" bs=256 count=1 skip=$(( t*16 + s )) seek=$(( t*16 + (s==0 || s==15 ? s : 15-s) )) 2> /dev/null - done -done - -# remove the old one -[[ ! $stdin && ! $stdout ]] && rm "$1" &> /dev/null - -# dump to stdout if -c or stdin used -[[ $stdout ]] && { cat $ofile; rm $ofile &> /dev/null; } -[[ $stdin ]] && rm $ifile &> /dev/null; diff --git a/docs/ivanx/setup/dos2pro.txt b/docs/ivanx/setup/dos2pro.txt deleted file mode 100644 index 19cf44e..0000000 --- a/docs/ivanx/setup/dos2pro.txt +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash - -readcharDec () { -# read one character from file & convert to equivalent decimal value -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# out: decimal value from 0-255 -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2 - [[ $1 ]] || return 11 - [[ $3 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - # args are valid - charX="$(dd if="$1" bs=1 skip=$(($2)) \ - count=1 2> /dev/null; echo -n X)" - [[ ${#charX} -gt 1 ]] || { echo -n 0; return 0; } - echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n' -} - -readcharHex () { -# read one character from file & convert to corresponding hex value -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# out: two-digit hex value from 00-FF -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2 - [[ $1 ]] || return 11 - [[ $3 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - # args are valid - charX="$(dd if="$1" bs=1 skip=$(($2)) \ - count=1 2> /dev/null; echo -n X)" - [[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; } - printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n') -} - -### start - -usage () { - echo "Usage:" - echo "all files: dos2pro dosImageName" - echo "one file : dos2pro dosImageName DOSFILE" - echo "notes:" - echo " Wildcard matching (*) is not supported." - echo " Illegal prodos characters will be made into periods, and names" - echo " will be truncated at 15 characters and possibly overwrite" - echo " other files if they match a previous name conversion." - exit 1 -} - -[[ $1 == "-h" || $1 == "--help" || ! $1 || ! -f "$1" ]] && usage - -dosImage="$1" -fileName="$2" - -dosImageBasename=$(basename "$dosImage") -proImage="${dosImageBasename%.*}_prodos.po" - -if [[ ! -f "$proImage" ]]; then - echo "Creating $proImage..." - mkpo -b 280 "$proImage" -else - echo "Found $proImage..." -fi - -if [[ ! $(acmd -i "$dosImage" 2> /dev/null | grep "Disk Format: DOS 3.3") ]]; then - echo "The file '$dosImage' doesn't appear to be a DOS 3.3 disk image." - exit 2 -fi - -dosLines=$(acmd -ll "$dosImage") - -IFS='' -while read thisLine; do - if [[ ${thisLine:0:2} == "* " || ${thisLine:0:2} == " " ]]; then - dosName=$(cut -c 5- <<< $thisLine | rev | sed 's/^[^ ]* [^ ]* [^ ]* [^ ]* [^ ]* \(.*$\)/\1/' | rev) - if [[ ! $fileName || "$fileName" == "$dosName" ]]; then - - dosType=$(cut -c 3 <<< $thisLine) - if [[ $dosType == "A" ]]; then - proType="BAS" - binAddr="0801" - elif [[ $dosType == "I" ]]; then - proType="INT" - elif [[ $dosType == "T" ]]; then - proType="TXT" - elif [[ $dosType == "B" ]]; then - proType="BIN" - sector=$(rev <<< $thisLine | cut -f2 -d ' ' | rev | cut -c 2-) - track=$(rev <<< $thisLine | cut -f3 -d ' ' | rev | cut -c 2-) - offset=$(( (track * 16 + sector) * 256 + 12 )) - track=$(readcharDec "$dosImage" $offset) - sector=$(readcharDec "$dosImage" $((offset+1))) - offset=$(( (track * 16 + sector) * 256 )) - binAddr=$(readcharHex "$dosImage" $((offset+1)))$(readcharHex "$dosImage" $offset) - else - echo "Error: Unknown DOS 3.3 file type." - exit 2 - fi - - proName=$(sed 's/^[^A-Za-z]/A/' <<< $dosName | sed 's/[^A-Za-z0-9\.]/./g') - - auxType= - [[ $binAddr ]] && auxType="\$$binAddr" - echo "Copying '$dosName' to '$proName'" - acmd -g "$dosImage" "$dosName" - | acmd -p "$proImage" "$proName" "$proType" "$auxType" - filesCopied=1 - fi - fi -done <<< $dosLines - -if [[ ! $filesCopied ]]; then - if [[ $fileName ]]; then - echo "File '$fileName' not found on DOS 3.3 disk image." - else - echo "No files copied." - fi -fi \ No newline at end of file diff --git a/docs/ivanx/setup/gsport-setup-shell.txt b/docs/ivanx/setup/gsport-setup-shell.txt deleted file mode 100644 index ae6625e..0000000 --- a/docs/ivanx/setup/gsport-setup-shell.txt +++ /dev/null @@ -1,6 +0,0 @@ -wget -qO /tmp/gsport-setup appleii.ivanx.com/a2cloud/setup/gsport-setup.txt -if [[ $(wc -c /tmp/gsport-setup | grep '^0 ') ]]; then - echo "Please connect to the internet to set up GSport." -else - source /tmp/gsport-setup "$@" -fi diff --git a/docs/ivanx/setup/gsport-setup.txt b/docs/ivanx/setup/gsport-setup.txt deleted file mode 100644 index 5ad0bd7..0000000 --- a/docs/ivanx/setup/gsport-setup.txt +++ /dev/null @@ -1,573 +0,0 @@ -#!/bin/bash - -readcharHex () { -# read one character from file & convert to corresponding hex value -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# out: two-digit hex value from 00-FF -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2 - [[ $1 ]] || return 11 - [[ $3 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - # args are valid - charX="$(dd if="$1" bs=1 skip=$(($2)) \ - count=1 2> /dev/null; echo -n X)" - [[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; } - printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \ - head -1 | sed 's/[0\ ]*//' | tr -d ' \n') | tr [A-Z] [a-z] -} - -readchars () { -# read one or more characters from a file -# arg1: filename -# arg2: (optional) offset (# of bytes to skip before reading) -# arg3: (optional) # of chars to read (default is until end of file) -# out: sequence of characters -# exit: 8=extraneous arg, 11=missing arg1, -# 21=invalid arg1, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11 - [[ $4 ]] && return 8 - [[ -f $1 ]] || return 21 - [[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22; } - [[ $3 ]] && { [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \ - && ( $3 -ge 0 ) ]] || return 23; } - # args are valid - dd if="$1" bs=1 skip=$(($2)) $([[ $3 ]] && echo -n "count=$3") \ - 2> /dev/null -} - -writecharsHex () { -# write corresponding characters of hex values into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: string of two-digit hexadecimal numbers from 00-FF, period delimited (not checked!) -# out: nothing -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - p=0 - offset=$2 - len=${#3} - while (( p < len )); do - outByte=${3:$p:2} - [[ $(printf %02X "0x$outByte" 2> /dev/null) == \ - $(echo -n "$outByte" | tr [a-z] [A-Z]) ]] || return 23 - # args are valid - echo -n -e "\x$outByte" | \ - dd of="$1" bs=1 seek=$offset conv=notrunc 2> /dev/null - (( p += 3 )) - (( offset++ )) - done -} - - -### start - -[[ -f /usr/bin/raspi-config ]] && isRpi=1 || isRpi= - -emulatorName="GSport" -emulatorStart="gsport" -emulatorSetup="gsport-setup" -romFileName="ROM" -configFileName="config.txt" - -imagesDir="/usr/local/share/gsdisks" -gsosHD="gsoshd.hdv" -gsosHDvolName="GSOS.HD" -tempDir="/tmp/gs" - -rom=ROM3 -slot6= -autoAnswerYes= -noDisks= -gisk= -installDisks= -kegs= - -{ acmd &> /dev/null || [[ $? -ne 127 ]]; } && acmdOK=1 || acmdOK= - - -while { [[ $1 ]] || (( (0 + $gisk + $noDisks + $installDisks + 0) > 1 )); }; do - arg=$(tr -d '-' <<< ${1,,}) - if [[ $arg == "6" ]]; then - slot6=1 - shift - elif [[ $arg == "rom1" ]]; then - rom=ROM1 - shift - elif [[ $arg == "rom3" ]]; then - rom=ROM3 - shift - elif [[ $arg == "n" ]]; then - noDisks=1 - shift - elif [[ $arg == "g" ]]; then - gisk=1 - shift - elif [[ $arg == "i" ]]; then - installDisks=1 - shift - elif [[ $arg == "y" ]]; then - autoAnswerYes=1 - shift - elif [[ $arg == "k" ]]; then - kegs=1 - shift - else - echo "Usage: $emulatorSetup [rom1|rom3] [-6] [-y [-g|-i|-n]]" - echo "rom1: use GS ROM 01" - echo "rom3: use GS ROM 03" - echo "-k: set up KEGS (rather than GSport)" - echo "-6: put blank disks in slot 6" - echo "-y: auto-answer yes (no prompting)" - echo "-i: use GS/OS and Spectrum installer disk images (use with -y)" - echo "-g: use GSport Internet Starter Kit disk image (use with -y)" - echo "-n: don't provide any disk images (use with -y)" - exit 1 - fi -done - -if [[ $kegs ]]; then - emulatorName="KEGS" - emulatorStart="kegs" - emulatorSetup="kegs-setup" - romFileName="rom.kegs" - configFileName="config.kegs" -fi - -echo -if [[ ! -f /usr/local/lib/$romFileName ]]; then - echo "$emulatorName needs to be set up. This may take several minutes." - if [[ ! $autoAnswerYes ]]; then - echo -n "Do you want to set up $emulatorName now? "; - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - exit 1 - fi - fi - echo "Ok, let's go!" - echo -fi - -if [[ ! $autoAnswerYes ]]; then - noDisks= - gisk= - while true; do - option1=0 - option2=0 - echo - echo "Do you want to:" - echo - if [[ $acmdOK ]]; then - [[ $kegs ]] && andSpectrum= || andSpectrum="and Spectrum " - echo "1) install GS/OS ${andSpectrum}from the installer disk images" - option1=1 - fi - if [[ ! $kegs ]]; then - echo "2) use the premade GSport Internet Starter Kit hard drive image" - option2=2 - fi - echo "3) prepare $emulatorName for use but don't provide any disk images" - echo "4) do nothing and quit" - echo - echo -n "Your choice: " - read - noDisks= - if [[ ${REPLY} == "4" ]]; then - [[ $0 == "-bash" ]] && return 1 || exit 1 - elif [[ ${REPLY} == "3" ]]; then - noDisks=1; break - elif [[ ${REPLY} == $option2 ]]; then - gisk=1; break - elif [[ ${REPLY} == $option1 ]]; then - gisk=; break - fi - done -fi - -sudo mkdir -p "$imagesDir" -sudo chmod ugo+rw "$imagesDir" -mkdir -p "$tempDir" -cd "$tempDir" - -echo "Updating package lists..." -sudo apt-get -y update > /dev/null - -if [[ ! -f /usr/local/bin/unar ]]; then - echo "Installing The Unarchiver..." - sudo apt-get -y install libgnustep-base1.22 - sudo apt-get -y clean - wget -qO- appleii.ivanx.com/a2cloud/setup/unar.tgz | sudo tar Pzx -fi - -if [[ ! -f /usr/local/bin/mkpo ]]; then - echo "Installing mkpo..." - sudo wget -qO /usr/local/bin/mkpo appleii.ivanx.com/a2cloud/setup/mkpo.txt - sudo chmod ugo+x /usr/local/bin/mkpo -fi - -if [[ ! -f /usr/local/bin/nulib2 ]]; then - echo "Installing nulib2..." - wget -qO- appleii.ivanx.com/a2cloud/setup/nulib2.tgz | sudo tar Pzx -fi - -if [[ ! -f $imagesDir/ROM1 ]]; then - echo "Getting GS ROM 01..." - wget -qO ROM1.zip http://web.archive.org/web/20130216031247/http://www.whatisthe2gs.apple2.org.za/files/rom1.zip - unzip ROM1.zip &> /dev/null - mv APPLE2GS.ROM $imagesDir/ROM1 - chmod ugo-w $imagesDir/ROM1 -fi - -if [[ ! -f $imagesDir/ROM3 ]]; then - echo "Getting GS ROM 3..." - wget -qO ROM3.zip http://web.archive.org/web/20130216031247/http://www.whatisthe2gs.apple2.org.za/files/rom3.zip - unzip ROM3.zip &> /dev/null - mv APPLE2GS.ROM2 $imagesDir/ROM3 - chmod ugo-w $imagesDir/ROM3 -fi - -if [[ ! -f /usr/local/lib/$romFileName || $arg ]]; then - echo "Setting $emulatorName to use $rom..." - echo " (to change, use '$emulatorSetup rom1' or '$emulatorSetup rom3')" - sudo rm /usr/local/lib/$romFileName &> /dev/null - sudo ln -s $imagesDir/$rom /usr/local/lib/$romFileName &> /dev/null - sudo ln -s $romFileName /usr/local/lib/ROM &> /dev/null -fi - -if [[ $slot6 ]]; then - echo "Putting blank disks in slot 6..." - sudo sed -i 's@^s6d1.*$@s6d1 = $imagesDir/slot6drive1.po@' /usr/local/lib/$configFileName - sudo sed -i 's@^s6d2.*$@s6d2 = $imagesDir/slot6drive2.po@' /usr/local/lib/$configFileName - if [[ ! -f $imagesDir/slot6drive1.po || ! -f $imagesDir/slot6drive2.po ]]; then - wget -qO- ivanx.com/a2cloud/files/slot6.tgz | sudo tar Pzx 2> /dev/null - fi -fi - -if [[ ! $kegs ]]; then - # set AppleTalk to turbo (works more reliably than Normal) - echo "Setting AppleTalk to turbo..." - if ! grep -q 'g_appletalk_turbo' /usr/local/lib/$configFileName; then - if grep -q 'bram1\[00\]' /usr/local/lib/$configFileName; then - sudo sed -i 's/^\(bram1\[00\]\)/g_appletalk_turbo = 1\n\n\1/' /usr/local/lib/$configFileName - else - echo -e '\ng_appletalk_turbo = 1' | sudo tee -a /usr/local/lib/$configFileName > /dev/null - fi - fi - sudo sed -i 's/g_appletalk_turbo = 0/g_appletalk_turbo = 1/' /usr/local/lib/$configFileName - - # enable Uthernet - echo "Enabling Uthernet card emulation..." - if ! grep -q 'g_ethernet[^_]' /usr/local/lib/$configFileName; then - if grep -q 'bram1\[00\]' /usr/local/lib/$configFileName; then - sudo sed -i 's/^\(bram1\[00\]\)/g_ethernet = 1\n\n\1/' /usr/local/lib/$configFileName - else - echo -e '\ng_ethernet = 1' | sudo tee -a /usr/local/lib/$configFileName > /dev/null - fi - fi - sudo sed -i 's/g_ethernet = 0/g_ethernet = 1/' /usr/local/lib/$configFileName - - # GISK - if [[ $gisk ]]; then - echo "Getting GSport Internet Starter Kit..." - wget -O /tmp/GSport_Internet_Starter_Kit.zip http://sourceforge.net/projects/gsport/files/Emulator%20Software%20Images/GSport_Internet_Starter_Kit.zip - unzip -d /tmp /tmp/GSport_Internet_Starter_Kit.zip "GSport Internet Starter Kit/GSport Internet Starter Kit.2mg" - sudo mv "/tmp/GSport Internet Starter Kit/GSport Internet Starter Kit.2mg" $imagesDir - rm -r /tmp/GSport* - if [[ $(grep ^s7d1 /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^s7d1.*$:s7d1 = $imagesDir/GSport Internet Starter Kit.2mg:" /usr/local/lib/$configFileName - else - echo "s7d1 = $imagesDir/GSport Internet Starter Kit.2mg" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - noDisks=1 - fi - if [[ $noDisks ]]; then - echo - echo - echo "Setup complete. You can now start $emulatorName." - echo - if [[ ! $autoAnswerYes ]]; then - echo -n "Press return to continue..." - read - fi - exit 0 - fi -fi - -# non-GISK; get installer disks -if [[ ! -f $imagesDir/INSTALL.HDV ]] \ -|| [[ ! -f $imagesDir/SYSTEM.DISK.HDV ]] \ -|| [[ ! -f $imagesDir/SYSTEMTOOLS1.HDV ]] \ -|| [[ ! -f $imagesDir/SYSTEMTOOLS2.HDV ]] \ -|| [[ ! -f $imagesDir/FONTS.HDV ]] \ -|| [[ ! -f $imagesDir/SYNTHLAB.HDV ]] \ -|| [[ ! -f $imagesDir/"$gsosHD" ]] \ -|| [[ ! $kegs && ! -f $imagesDir/spectrum.hdv ]]; then - -# if [[ ! $autoAnswerYes ]]; then -# echo -# echo -n "Do you want to download the GS/OS installer disks" -# if [[ ! -f $imagesDir/"$gsosHD" ]]; then -# echo -n -e "\nand create a hard disk image file" -# fi -# if [[ ! $kegs && -f /usr/local/bin/acmd && ! -f $imagesDir/spectrum.hdv ]]; then -# echo -n -e "\nand download Spectrum communications software" -# fi -# echo -n "? " -# read -# fi - - REPLY="y" - if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - - echo - activeDisk=0 - for diskname in Install System.Disk SystemTools1 SystemTools2 Fonts synthLAB; do - (( activeDisk++ )) - outfile="$imagesDir/$(tr [:lower:] [:upper:] <<< $diskname).HDV" - if [[ ! -f "$outfile" ]]; then - echo "Getting GS/OS disk ${activeDisk} of 6: $diskname" - wget -qO "Disk_${activeDisk}_of_7-$diskname.sea.bin" "http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2FDisk_${activeDisk}_of_7-$diskname.sea.bin" - unar -k skip "Disk_${activeDisk}_of_7-$diskname.sea.bin" &> /dev/null - truncate -s 819284 "Disk ${activeDisk} of 7-${diskname}.sea" - dd if="Disk ${activeDisk} of 7-${diskname}.sea" of=${outfile} bs=84 skip=1 &> /dev/null - chmod ugo-w "$outfile" - if [[ $activeDisk -eq 1 ]]; then - if [[ $(grep ^s5d1 /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^s5d1.*$:s5d1 = $imagesDir/INSTALL.HDV:" /usr/local/lib/$configFileName - else - echo "s5d1 = $imagesDir/INSTALL.HDV" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - else - if [[ $(grep ^s7d$activeDisk /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^s7d$activeDisk.*$:s7d$activeDisk = $outfile:" /usr/local/lib/$configFileName - else - echo "s7d$activeDisk = $outfile" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - fi - else - echo "GS/OS disk ${activeDisk} of 6: $diskname has already been downloaded." - fi - done - rm *.sea* &> /dev/null - - if [[ ! -f $imagesDir/"$gsosHD" ]]; then - echo "Creating 32 MB blank image at $imagesDir/$gsosHD..." - if [[ -f /usr/local/bin/acmd ]]; then - # if acmd exists, make a ProDOS disk with GS-ShrinkIt and Teach - - if [[ ! -f /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar ]]; then - echo "Installing AppleCommander-1.3.5.13id..." - sudo mkdir -p /usr/local/adtpro/lib/AppleCommander - wget -qO /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar http://downloads.sourceforge.net/project/applecommander/AppleCommander%20-%20Interim/testcase/AppleCommander-1.3.5.13id-ac.jar - rm /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar &> /dev/null - ln -s AppleCommander-1.3.5.13id-ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar - fi - - echo "Copying ProDOS..." - acmd -g "$imagesDir/INSTALL.HDV" PRODOS "PRODOS#ff0000" - #writecharsHex "PRODOS#ff0000" 0 "4C.00.C5.00" - wget -qO- ivanx.com/a2cloud/files/${emulatorName}SPLASH.SYS | dd of="PRODOS#ff0000" conv=notrunc &> /dev/null - echo "Copying Teach..." - cppo -e $imagesDir/SYSTEMTOOLS2.HDV /SYSTEMTOOLS2/TEACH . &> /dev/null - echo "Downloading GS-ShrinkIt..." - wget -qO- http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea | nulib2 -x -e - GSHK &> /dev/null - nulib2 -a -e $gsosHD.shk "PRODOS#"* "GSHK#"* "TEACH#"* &> /dev/null - acmd -convert $gsosHD.shk $imagesDir/"$gsosHD" 65535 - rm "PRODOS#"* "GSHK#"* "TEACH#"* $gsosHD.shk &> /dev/null - - acmd -n $imagesDir/"$gsosHD" $gsosHDvolName - dd bs=512 count=1 conv=notrunc if="$imagesDir/INSTALL.HDV" of="$imagesDir/$gsosHD" 2> /dev/null - sudo chmod ugo+rw $imagesDir/"$gsosHD" - #acmd -p "$imagesDir/$gsosHD" PRODOS SYS < $tempDir/PRODOS - #rm $tempDir/PRODOS - fi - if [[ $(grep ^s7d1 /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^s7d1.*$:s7d1 = $imagesDir/$gsosHD:" /usr/local/lib/$configFileName - else - echo "s7d1 = $imagesDir/$gsosHD" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - fi - - if [[ $(grep ^g_limit_speed /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^g_limit_speed.*$:g_limit_speed = 0:" /usr/local/lib/$configFileName - else - echo "g_limit_speed = 0" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - - if [[ -f /usr/local/bin/acmd && ! $(acmd -ls $imagesDir/$gsosHD | grep 'GSHK') ]]; then - echo - echo "Downloading GS-ShrinkIt..." - wget -qO- http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea | acmd -p $imagesDir/$gsosHD GS.SHRINKIT.SEA S16 - fi - - - # Spectrum starts here - - if [[ ! $kegs ]]; then - - mkdir -p /tmp/spectrum - cd /tmp/spectrum - - imageName="/tmp/spectrum/spectrum.dmg" - hfsName="/tmp/spectrum/spectrumH.dmg" - ullName="/tmp/spectrum/uthernet.bxy" - - if [[ ! -f /usr/bin/hcopy || ! -f /usr/bin/macsave ]]; then - echo "Installing HFS utilities..." - sudo apt-get -y install hfsutils macutils &> /dev/null - else - echo "HFS utilities are already installed." - fi - - if [[ ! -f /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar ]]; then - echo "Installing AppleCommander..." - sudo mkdir -p /usr/local/adtpro/lib/AppleCommander - wget -qO /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar http://downloads.sourceforge.net/project/applecommander/AppleCommander%20-%20Interim/testcase/AppleCommander-1.3.5.13id-ac.jar - rm /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar &> /dev/null - ln -s AppleCommander-1.3.5.13id-ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar - fi - - if [[ ! -f "$imageName" ]]; then - echo "Downloading Spectrum Deluxe..." - wget -qO spectrum.dmg http://www.wannop.info/speccie/software/spectrum_2.5.3_deluxe.dmg - else - echo "Spectrum Deluxe has already been downloaded." - fi - - mkdir -p mnt - mkdir -p extract - mkdir -p shkstage - cp "$imageName" "$hfsName" - sudo mount -r -t hfs "$imageName" mnt - hmount "$hfsName" - - IFS='' - cd /tmp/spectrum/mnt - find Spectrum.2.5.3 -type d | while read thisDirPath; do - mkdir -p /tmp/spectrum/shkstage/"$thisDirPath" - hcd - IFS='/' - for thisDir in $thisDirPath; do - hcd $thisDir - done - echo " Copying: $(hpwd)" - IFS='' - cd /tmp/spectrum/extract - hls -1 | while read thisFile; do - hcopy -m "$thisFile" - 2> /dev/null | macsave -f 2> /dev/null - if [[ -f "$thisFile".info ]]; then - if [[ $(readcharHex "$thisFile".info 65) == "70" ]]; then - fileType=$(readcharHex "$thisFile".info 66) - auxType=$(readcharHex "$thisFile".info 67)$(readcharHex "$thisFile".info 68) - else - auxType="0000" - fMac=$(readchars "$thisFile".info 65 4) - if [[ "$fMac" == "PS16" ]]; then - fileType="b3"; - elif [[ "$fMac" == "PSYS" ]]; then - fileType="ff"; - elif [[ "$fMac" == "BINA" ]]; then - fileType="00"; - elif [[ "$fMac" == "TEXT" ]]; then - fileType="04"; - elif [[ "$fMac" == "MIDI" ]]; then - fileType="D7"; - elif [[ "$fMac" == "AIFF" || "$fMac" == "AIFC" ]]; then - fileType="D8"; - elif [[ "$fMac" == "dImg" ]]; then - fileType="E0"; - else - echo "WARNING: unknown file type '$fMac' found for file $thisFile" - fi - fi - [[ -f "$thisFile".rsrc ]] && mv "$thisFile".rsrc /tmp/spectrum/shkstage/"$thisDirPath"/"${thisFile}#${fileType}${auxType}r" - [[ -f "$thisFile".data ]] && mv "$thisFile".data /tmp/spectrum/shkstage/"$thisDirPath"/"${thisFile}#${fileType}${auxType}" - rm "$thisFile".info 2> /dev/null - fi - done - cd /tmp/spectrum/mnt - done - - cd /tmp/spectrum/shkstage/Spectrum* - humount - sudo umount /tmp/spectrum/mnt - - mkdir -p Marinetti/Uthernet - cp SAFE2.Archive/Link.Layers/"Uthernet#bc4083" Marinetti/Uthernet - echo -n "After installing Marinetti, put Uthernet in the TCPIP folder of your System folder, and restart GS/OS. Then open Control Panels, choose TCP/IP, and choose Setup Connection. Choose Uthernet for the link layer. Under Primary Domain Name Server, enter 8.8.8.8, then click Configure and select Slot 3 and DHCP. Then click Save." > Marinetti/Uthernet/"Uthernet.README#040000" - - echo "Making archive for conversion to disk image..." - rm /tmp/spectrum/spectrum.shk 2> /dev/null - nulib2 -a -r -0 -e /tmp/spectrum/spectrum.shk * &> /dev/null - echo "Converting archive to disk image..." - acmd -convert /tmp/spectrum/spectrum.shk $imagesDir/spectrum.hdv 20480 - acmd -n $imagesDir/spectrum.hdv SPECTRUM.DELUXE - - if [[ $(grep ^s7d7 /usr/local/lib/$configFileName) ]]; then - sudo sed -i "s:^s7d7.*$:s7d7 = $imagesDir/spectrum.hdv:" /usr/local/lib/$configFileName - else - echo "s7d7 = $imagesDir/spectrum.hdv" | tee -a /usr/local/lib/$configFileName > /dev/null - fi - - cd /tmp - - rm -rf /tmp/spectrum/extract /tmp/spectrum/shkstage /tmp/spectrum/spectrum.shk /tmp/spectrum/mnt &> /dev/null - fi - # Spectrum ends here - fi -fi - -cd -rm -r "$tempDir" - -echo -echo -if [[ -f "$imagesDir/$gsosHD" ]]; then - echo - echo "You can now start $emulatorName." - echo "When the installer boots, you can click Easy Update or Customize" - echo "to install GS/OS, if you downloaded the installer disks aobve." -else - # if no acmd, create unformatted disk - # requires that the disk first be formatted with Advanced Disk Utility - dd bs=512 count=65535 if=/dev/zero of=$imagesDir/"$gsosHD" 2> /dev/null - writecharsHex $imagesDir/"$gsosHD" 0 "00.4C.00.C5.00" - echo - echo "You can now start $emulatorName." - echo - echo "If you downloaded the installer disks above:" - echo "When the installer boots, quit it, change to the SystemTools1 disk," - echo "run Advanced Disk Utility, click Disk until a hard drive icon appears" - echo "that says Uninitialized, and initialize it. Then quit Advanced Disk" - echo "Utility, change to the Install Disk, and run Installer. When it loads," - echo "click Easy Update or Customize to install GS/OS." - echo -fi -echo "When it's done, reboot." -echo "(Use Shut Down, ctrl-F12, or ctrl-solidapple-equals.)" -if [[ -f "$imagesDir/spectrum.hdv" ]]; then - echo - echo "Then on the Spectrum disk, optionally install:" - echo "Marinetti (plus update): TCP/IP driver for GS/OS" - echo "Uthernet: Ethernet driver for Marinetti" - echo "Spectrum: serial and telnet communications" - echo "SAFE: FTP client" - echo "SNAP: Usenet newsgroups (NNTP) client" - echo "SAM2: Email (POP) client" -fi -echo -echo "After installing, press F4 and choose 'Disk Configuration' to" -echo "eject all disks other than slot 7 drive 1." -echo -if [[ ! $autoAnswerYes ]]; then - echo -n "Press return to continue..." - read -fi diff --git a/docs/ivanx/setup/gsport.txt b/docs/ivanx/setup/gsport.txt deleted file mode 100644 index dfbd040..0000000 --- a/docs/ivanx/setup/gsport.txt +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash - -if [[ ( $(grep USB <<< $myTTY) || $(grep AMA <<< $myTTY) || $SSH_CLIENT || $REMOTEHOST ) && ! $DISPLAY ]]; then - echo "Please run GSport on the console, or in an X Window." -else - - if [[ -f /usr/local/lib/ROM ]]; then - if [[ ! $(grep snd-pcm-oss /etc/modules) ]]; then - echo "Configuring GSport sound..." - echo "snd-pcm-oss" | sudo tee -a /etc/modules > /dev/null - [[ ! $(lsmod | grep snd_pcm_oss) ]] && sudo modprobe snd-pcm-oss - fi - - if [[ ! $(dpkg -l xfonts-base 2> /dev/null | grep '^ii') ]]; then - echo "Configuring GSport fonts..." - sudo apt-get -y update - touch /tmp/updated - sudo apt-get -y install xfonts-base &> /dev/null - sudo apt-get -y clean - fi - - if [[ ! $(dpkg -l libpcap0.8-dev 2> /dev/null | grep '^ii') ]]; then - echo "Configuring GSport networking..." - [[ ! -f /tmp/updated ]] && sudo apt-get -y update - sudo apt-get -y install libpcap0.8-dev &> /dev/null - sudo apt-get -y clean - fi - - rm /tmp/updated &> /dev/null - else - gsport-setup - [[ $? -ne 0 ]] && exit 1 - fi - - displayOK= - if [[ $DISPLAY ]]; then # X Window - displayOK=1 - else # console/framebuffer - if [[ ! -f /usr/local/etc/gsportconsolewarningoff ]] && { dpkg -l | grep -q -i virtualbox; }; then - echo - echo "If you have difficulties moving the mouse in GS/OS, choose" - echo "'Disable Mouse Integration' from the Machine menu. To free the mouse" - echo "from the virtual machine, press the Host key (shown in the lower right" - echo "corner of the virtual machine window)." - echo - echo "Press alt-F4 to exit GSport." - echo - echo "Press return to continue," - echo -n " or type 'OK' if you want to stop seeing this message: " - read - if [[ $REPLY == "ok" || $REPLY == "ok" || $REPLY == "Ok" ]]; then - sudo touch /usr/local/etc/gsportconsolewarningoff - fi -# echo "If you wish to run GSport in the console window, the mouse will not work" -# echo "unless you uninstall VirtualBox Guest Additions. If you don't want to do" -# echo "this, you can instead run GSport in an X window (e.g. by typing 'startx')." -# echo "If you're not sure, just uninstall it now. Nothing terrible will happen." -# echo -# echo -n "Do you want to uninstall VirtualBox Guest Additions now? " -# read -# if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then -# echo "Ok, on the case..." -# sudo /etc/init.d/vboxadd-service stop 2> /dev/null -# sudo /etc/init.d/virtualbox-guest-utils stop &> /dev/null -# sudo rmmod vboxvideo 2> /dev/null -# sudo rmmod vboxsf 2> /dev/null -# sudo rmmod vboxguest 2> /dev/null -# while { lsmod | grep -q vbox; }; do -# sleep 1 -# sudo rmmod vboxvideo 2> /dev/null -# sudo rmmod vboxsf 2> /dev/null -# sudo rmmod vboxguest 2> /dev/null -# done -# if [ -f /opt/VBoxGuestAdditions*/uninstall.sh ]; then -# sudo /opt/VBoxGuestAdditions*/uninstall.sh &> /dev/null -# sudo rmdir /opt/VBoxGuestAdditions* 2> /dev/null -# fi -# if { dpkg -l 2> /dev/null | grep -q -i virtualbox; }; then -# sudo apt-get -y purge $(dpkg -l 2> /dev/null | grep -i virtualbox | cut -f 3 -d ' ' | tr '\n' ' ') &> /dev/null -# fi -# touch /tmp/gsport-consolesetup -# fi - fi - - if [[ ! $(grep 'input' <<< $(groups) ) ]]; then - sudo groupadd input &> /dev/null - sudo usermod -a -G input $USER - echo 'SUBSYSTEM=="input", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-input.rules > /dev/null - touch /tmp/gsport-consolesetup - fi - - if [[ -c /dev/fb0 ]]; then - [[ ! -f /tmp/gsport-consolesetup ]] && displayOK=1 - else - if [[ -f /etc/default/grub ]]; then - if [[ ! $(grep 'GRUB_GFXPAYLOAD_LINUX' /etc/default/grub) ]]; then - echo "Preparing GSport for console use..." - sudo sed -i 's/^\(GRUB_CMDLINE_LINUX=.*\)$/\1\nGRUB_GFXPAYLOAD_LINUX=640x480/' /etc/default/grub - sudo update-grub &> /dev/null - touch /tmp/gsport-consolesetup - fi - else - echo "No framebuffer available. Please run GSport in an X window." - fi - fi - fi - - if [[ ! $DISPLAY && -f /tmp/gsport-consolesetup ]]; then - echo "GSport will be ready for console use after you restart your system." - echo "You can restart now by typing 'system-restart'." - elif [[ $displayOK ]]; then - if [[ $(xdpyinfo 2> /dev/null) ]]; then - exec gsportx - else - exec gsportfb - fi - else - echo "GSport has a problem. Please try updating A2CLOUD by" - echo "typing 'a2cloud-setup'." - fi - -fi diff --git a/docs/ivanx/setup/kegs-setup-shell.txt b/docs/ivanx/setup/kegs-setup-shell.txt deleted file mode 100644 index 7e5f02e..0000000 --- a/docs/ivanx/setup/kegs-setup-shell.txt +++ /dev/null @@ -1,6 +0,0 @@ -wget -qO /tmp/gsport-setup ivanx.com/a2cloud/setup/gsport-setup.txt -if [[ $(wc -c /tmp/gsport-setup | grep '^0 ') ]]; then - echo "Please connect to the internet to set up KEGS." -else - source /tmp/gsport-setup -k "$@" -fi diff --git a/docs/ivanx/setup/kegs-setup.txt b/docs/ivanx/setup/kegs-setup.txt deleted file mode 100644 index 9431a45..0000000 --- a/docs/ivanx/setup/kegs-setup.txt +++ /dev/null @@ -1,6 +0,0 @@ -if [[ -f /usr/local/bin/gsport-setup ]]; then - wget -O /tmp/gsport-setup ivanx.com/a2cloud/gsport-setup.txt - source /tmp/gsport-setup -k "$@" -else - gsport-setup -k "$@" -fi diff --git a/docs/ivanx/setup/kegs.txt b/docs/ivanx/setup/kegs.txt deleted file mode 100644 index 7a891f5..0000000 --- a/docs/ivanx/setup/kegs.txt +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -if [[ ! $DISPLAY ]]; then - echo "Please run KEGS in an X Window." - echo "(If you are using the console, type 'startx'.)" -else - if [[ -f /usr/local/lib/rom.kegs ]]; then - if [[ ! $(grep snd-pcm-oss /etc/modules) ]]; then - echo "Configuring KEGS sound..." - echo "snd-pcm-oss" | sudo tee -a /etc/modules > /dev/null - [[ ! $(lsmod | grep snd_pcm_oss) ]] && sudo modprobe snd-pcm-oss - fi - - if [[ ! $(dpkg -l xfonts-base 2> /dev/null | grep '^ii') ]]; then - echo "Configuring KEGS fonts..." - sudo apt-get -y update - sudo apt-get -y install xfonts-base &> /dev/null - sudo apt-get -y clean - fi - - exec xkegs - else - kegs-setup - [[ $? -ne 0 ]] && exit 1 - exec kegs - fi -fi diff --git a/docs/ivanx/setup/linapple.txt b/docs/ivanx/setup/linapple.txt deleted file mode 100644 index 0421dc6..0000000 --- a/docs/ivanx/setup/linapple.txt +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -if [[ ( $(grep USB <<< $myTTY) || $(grep AMA <<< $myTTY) || $SSH_CLIENT || $REMOTEHOST ) && ! $DISPLAY ]]; then - echo "Please run LinApple on the console, or in an X Window." -else - if [[ $(dpkg -l libsdl1.2debian libcurl3 zlib1g libzip2 2> /dev/null | grep ^ii | wc -l) -ne 4 ]]; then - echo "Configuring LinApple libraries (this may take a moment)..." - sudo apt-get -y update &> /dev/null - sudo apt-get -y install libsdl1.2debian libcurl3 zlib1g libzip2 &> /dev/null - sudo apt-get -y clean - fi - - linappleOk= - - if [[ $DISPLAY ]]; then # X Window - linappleOk=1 - else # console/framebuffer - if [[ ! -f /tmp/linapple-consolesetup && ! $(grep 'input' <<< $(groups) ) ]]; then - sudo groupadd input &> /dev/null - sudo usermod -a -G input $USER - echo 'SUBSYSTEM=="input", GROUP="input", MODE="0660"' | sudo tee /etc/udev/rules.d/99-input.rules > /dev/null - touch /tmp/linapple-consolesetup - fi - - if [[ -c /dev/fb0 ]]; then - [[ ! -f /tmp/linapple-consolesetup ]] && linappleOk=1 - else - if [[ -f /etc/default/grub ]]; then - if [[ ! $(grep 'GRUB_GFXPAYLOAD_LINUX' /etc/default/grub) ]]; then - echo "Preparing LinApple for console use..." - sudo sed -i 's/^\(GRUB_CMDLINE_LINUX=.*\)$/\1\nGRUB_GFXPAYLOAD_LINUX=640x480/' /etc/default/grub - sudo update-grub &> /dev/null - touch /tmp/linapple-consolesetup - fi - else - echo "No framebuffer available. Please run LinApple in an X window." - fi - fi - fi - - if [[ ! $DISPLAY && -f /tmp/linapple-consolesetup ]]; then - echo "LinApple will be ready for console use after you restart your system." - echo "You can restart now by typing 'system-restart'." - elif [[ $linappleOk ]]; then - cd /usr/local/linapple - ./linapple - else - echo "LinApple has a problem. Please try updating A2CLOUD by" - echo "typing 'a2cloud-setup'." - fi - -fi diff --git a/docs/ivanx/setup/mkpo.txt b/docs/ivanx/setup/mkpo.txt deleted file mode 100644 index 0aee1d5..0000000 --- a/docs/ivanx/setup/mkpo.txt +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash - -# ID-bashByter routines - -function binToDec () -{ - dec=0; - bits=$1; - while (( ${#bits} < 8 )); do - bits="0$bits"; - done; - for n in {0..7}; - do - (( dec+=( ${bits:$n:1} * ( 2**(7-$n) ) ) )); - done; - echo -n $dec -}; - -function writecharDec () -{ - [[ -n $1 ]] || return 11; - [[ -n $2 ]] || return 12; - [[ -n $3 ]] || return 13; - [[ -n $4 ]] && return 8; - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) && ( $2 -ge 0 ) ]] || return 22; - [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) && ( $3 -ge 0 ) && ( $3 -lt 255 ) ]] || return 23; - echo -n -e "\x$(printf %02X "$3")" | dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null -}; - -function writecharsHex () -{ - [[ -n $1 ]] || return 11; - [[ -n $2 ]] || return 12; - [[ -n $3 ]] || return 13; - [[ -n $4 ]] && return 8; - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) && ( $2 -ge 0 ) ]] || return 22; - p=0; - offset=$2; - len=${#3}; - while (( p < len )); do - outByte=${3:$p:2}; - [[ $(printf %02X "0x$outByte" 2> /dev/null) == $(echo -n "$outByte" | tr [a-z] [A-Z]) ]] || return 23; - echo -n -e "\x$outByte" | dd of="$1" bs=1 seek=$offset conv=notrunc 2> /dev/null; - (( p += 3 )); - (( offset++ )); - done -}; - -# mkpo - -[[ ! -n $1 ]] && { echo "Usage: mkpo [-b totalBlocks] newImageName [PRODOS.VOL.NAME]"; exit 1; }; - -[[ -f /usr/local/adtpro/adtpro.sh ]] && adtPath="/usr/local/adtpro" || adtPath=$(ls -1d /Applications/ADTPro* | head -1); -[[ ! -d "$adtPath" ]] && { echo "AppleCommander not found."; exit 1; } - -if [[ $1 == "-b" ]]; then - totalBlocks="$2" - shift - shift -fi - -[[ -f $1 ]] && { echo "Image '$1' already exists."; exit 1; } - -[[ $2 ]] && prodosVolName="$2" || prodosVolName="UNTITLED" -# test ProDOS name legitimacy -prodosVolName=$(tr [:lower:] [:upper:] <<< $prodosVolName ) -if [[ ${#prodosVolName} -gt 15 || ! $(grep ^[A-Z][0-9A-Z\.]*$ <<< $prodosVolName) ]]; then - echo "Invalid ProDOS name: $prodosVolName"; exit 1; -fi - -# see if nulib2 is available; if so, acmd -convert will create image -# with specified block size -nulib2 &> /dev/null -[[ $? == 2 ]] && nulib2=1 || nulib2= -if [[ $nulib2 ]]; then - if [[ $totalBlocks ]]; then - imageBlocks="$totalBlocks" - else - if [[ $(tr [:upper:] [:lower:] <<< "${1##*.}") == "dsk" ]]; then - imageBlocks=280 - else - imageBlocks=1600 - fi - fi - rm /tmp/blank.shk &> /dev/null - orig_dir="$PWD" - cd /tmp - rm blank.shk EMPTY &> /dev/null - touch EMPTY - nulib2 -a blank.shk EMPTY &> /dev/null - cd "$orig_dir" - acmd -convert /tmp/blank.shk "$1" $imageBlocks - acmd -d "$1" EMPTY - rm /tmp/blank.shk /tmp/EMPTY - acmd -n "$1" "$prodosVolName" -else - # make the disk image without converting archive - if [[ $totalBlocks || $(tr [:upper:] [:lower:] <<< "${1##*.}") == "dsk" ]]; then - acmd -pro140 "$1" $prodosVolName; - else - acmd -pro800 "$1" $prodosVolName; - fi -fi - -# make the disk bootable -if [ -f "$adtPath"/disks/ADTPRO*PO ]; then - dd bs=512 count=1 of="$1" conv=notrunc < "$adtPath"/disks/ADTPRO*PO 2> /dev/null -fi - -# change .DSK to DOS-ordered -if [[ ! $totalBlocks && $(tr [:upper:] [:lower:] <<< "${1##*.}") == "dsk" ]]; then - mv "$1" "$1".tmp - for t in {0..34}; do - for s in 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15; do - dd bs=256 count=1 if="$1".tmp of="$1" skip=$(( $t*16 + $s )) seek=$(( $t*16 + ( $s==0||$s==15 ? $s : 15-$s ) )) 2> /dev/null; - done; - done - rm "$1".tmp -fi - -# if nulib2 isn't available, patch the disk image to use specified block size -if [[ ! $nulib2 && $totalBlocks ]]; then - # change total block count - bcHex=$(printf "%04X" $totalBlocks); - writecharsHex "$1" 1065 "${bcHex:2:2}.${bcHex:0:2}"; - - # fix FSB - dd if=/dev/zero of="$1" bs=512 seek=280 count=$(( $totalBlocks - 280 )) 2> /dev/null; - dd if="$1" of="$1" bs=1 skip=3073 seek=3107 count=$(( ($totalBlocks / 8) - 35 )) conv=notrunc 2> /dev/null; - bits=$(( $totalBlocks % 8 )); - if (( bits > 0 )); then - usedString="00000000"; - freeString=; - for ((b=0; b<$bits; b++)) - do - freeString=$freeString"1"; - done; - binString=$freeString${usedString:$bits}; - writecharDec "$1" $(( ( ($totalBlocks / 8) - 35) + 3107 )) $(binToDec $binString); - fi; - - # assign extra blocks to FSB if needed - fsbExtraBlocks=$(( ($totalBlocks-1)/4096 )); - if (( fsbExtraBlocks > 0 )); then - dd if=/dev/zero of="$1" bs=1 seek=3072 count=$(( (fsbExtraBlocks > 8) + 1 )) conv=notrunc 2> /dev/null; - (( fsbExtraBlocks-- )); - fi; - - bits=$(( fsbExtraBlocks % 8 )); - if (( bits > 0 )); then - freeString="11111111"; - usedString=; - for ((b=0; b<$bits; b++)) - do - usedString=$usedString"0"; - done; - binString=$usedString${freeString:$bits}; - writecharDec "$1" $(( (fsbExtraBlocks>7)+3073 )) $(binToDec $binString); - fi; -fi diff --git a/docs/ivanx/setup/motd-linux.txt b/docs/ivanx/setup/motd-linux.txt deleted file mode 100644 index ec09079..0000000 --- a/docs/ivanx/setup/motd-linux.txt +++ /dev/null @@ -1,16 +0,0 @@ - -Welcome to A2CLOUD! -Instructions and help: http://appleii.ivanx.com - -Type 'a2cloud-help' for a list of A2CLOUD commands. -Type 'system-shutdown' to turn off your Raspberry Pi. - -Type 'raspi-config' to configure your Raspberry Pi. -Type 'startx' to start the Raspbian desktop. - -Type 'lynx' or 'links' to browse the web and 'cftp' to log into FTP sites. -Type 'a2chat' or 'a2news' to talk about Apple II stuff with others. -Type 'ttytter' to tweet. Type 'term color' for a color terminal on a IIgs. - -Type 'gsport' or 'kegs' to use the GSport or KEGS Apple IIgs emulators. -Type 'linapple' to use the LinApple Apple IIe emulator. diff --git a/docs/ivanx/setup/motd-rpi.txt b/docs/ivanx/setup/motd-rpi.txt deleted file mode 100644 index ec09079..0000000 --- a/docs/ivanx/setup/motd-rpi.txt +++ /dev/null @@ -1,16 +0,0 @@ - -Welcome to A2CLOUD! -Instructions and help: http://appleii.ivanx.com - -Type 'a2cloud-help' for a list of A2CLOUD commands. -Type 'system-shutdown' to turn off your Raspberry Pi. - -Type 'raspi-config' to configure your Raspberry Pi. -Type 'startx' to start the Raspbian desktop. - -Type 'lynx' or 'links' to browse the web and 'cftp' to log into FTP sites. -Type 'a2chat' or 'a2news' to talk about Apple II stuff with others. -Type 'ttytter' to tweet. Type 'term color' for a color terminal on a IIgs. - -Type 'gsport' or 'kegs' to use the GSport or KEGS Apple IIgs emulators. -Type 'linapple' to use the LinApple Apple IIe emulator. diff --git a/docs/ivanx/setup/motd.txt b/docs/ivanx/setup/motd.txt deleted file mode 120000 index 1385dc6..0000000 --- a/docs/ivanx/setup/motd.txt +++ /dev/null @@ -1 +0,0 @@ -motd-rpi.txt \ No newline at end of file diff --git a/docs/ivanx/setup/raspbian-update.txt b/docs/ivanx/setup/raspbian-update.txt deleted file mode 100644 index a3efce7..0000000 --- a/docs/ivanx/setup/raspbian-update.txt +++ /dev/null @@ -1,233 +0,0 @@ -#!/bin/bash - -# raspbian-update -# updates Raspbian to latest version, including NOOBS if installed - -[[ -f /usr/bin/raspi-config ]] && isRpi=1 || isRpi= - -if [[ ! $isRpi ]]; then - echo "This ain't a Raspberry Pi." - [[ $0 == "-bash" ]] && return 1 || exit 1 -fi - -skipRepoUpdate= -autoYes= -updateA2Cloud= -updateA2Server= -while [[ $1 ]]; do - if [[ $1 == "-r" ]]; then - shift - skipRepoUpdate="-r" - elif [[ $1 == "-y" ]]; then - shift - autoYes="-y" - elif [[ $1 == "-n" ]]; then - shift - noobsOnly="-n" - elif [[ $1 == "a2cloud" ]]; then - shift - updateA2Cloud=1 - elif [[ $1 == "a2server" ]]; then - shift - updateA2Server=1 - elif [[ $1 ]]; then - echo "options:" - echo "-y: auto-answer yes to all prompts and don't prompt for restart" - echo "-r: don't update package repositories" - echo "-n: update NOOBS only; don't update Raspbian" - echo "a2cloud : update A2CLOUD when complete" - echo "a2server: update A2SERVER when complete" - [[ $0 == "-bash" ]] && return 1 || exit 1 - fi -done - -noobs= -readarray -t partitions < <(sudo fdisk -l | grep '^/dev') -if [[ \ - ${partitions[0]:0:14} == "/dev/mmcblk0p1" && ${partitions[0]:57:2} == " e" && - ${partitions[1]:0:14} == "/dev/mmcblk0p2" && ${partitions[1]:57:2} == "85" && - ${partitions[2]:0:14} == "/dev/mmcblk0p3" && ${partitions[2]:57:2} == "83" && - ${partitions[3]:0:14} == "/dev/mmcblk0p5" && ${partitions[3]:57:2} == " c" && - ${partitions[4]:0:14} == "/dev/mmcblk0p6" && ${partitions[4]:57:2} == "83" ]]; then - noobs=" and the NOOBS install manager" -fi - -if [[ ! $autoYes ]]; then - echo - echo "You are about to update your SD card to the latest version of the" - echo "Raspbian operating system${noobs}." - echo - echo "This may take an hour or more, and will require restarting when complete." - echo "You might want a backup before continuing in case it doesn't go as planned." - echo - echo -n "Update Raspbian? " - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - [[ $0 == "-bash" ]] && return 2 || exit 2 - fi -fi - -origDir="$PWD" -cd /tmp - -if [[ ! $skipRepoUpdate ]]; then - echo "Updating package repositories..." - sudo apt-get -y update > /dev/null -else - echo "Not updating package repositories..." - echo -fi - -if [[ ! $noobsOnly ]]; then - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - freeSpace=$(df / | tail -1 | awk '{ print $4 }') - if (( $freeSpace < 400000 )); then - if dpkg -l | grep -q wolfram-engine; then - if [[ ! $autoYes ]]; then - echo "In order to create enough space on your SD card to upgrade," - echo "the Wolfram Language and Mathematica software packages must be removed." - echo "If you don't know what these are, this won't affect you at all." - echo - echo -n "Remove Wolfram software? " - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - [[ $0 == "-bash" ]] && return 2 || exit 2 - fi - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - sudo apt-get -y purge wolfram-engine - else - echo "Removing Wolfram software due to space constraints..." - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - sudo apt-get -y purge wolfram-engine - fi - else - echo "You don't have enough free space on your SD card to upgrade." - echo "Sorry, man. Delete some stuff or get a bigger card." - [[ $0 == "-bash" ]] && return 1 || exit 1 - fi - fi - - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - dpkg -l | grep -q a2pi && sudo apt-get -y --force-yes install a2pi - dpkg -l | grep -q apple2user && sudo apt-get -y --force-yes install apple2user gsport - if dpkg -l | grep -q wolfram-engine; then - sudo rm /opt/Wolfram/WolframEngine/10.0/SystemFiles/Java/Linux-ARM 2> /dev/null - if [[ $freeSpace -lt 750000 && $(apt-get -s install wolfram-engine | grep upgraded) ]]; then - sudo apt-get -y purge wolfram-engine - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - fi - sudo apt-get -y install wolfram-engine - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - fi - sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null - sudo apt-get -y install raspberrypi-ui-mods - { cd /tmp; sudo apt-get -y autoremove; sudo apt-get -y autoclean; sudo apt-get -y clean; } > /dev/null -fi - -if [[ $noobs ]]; then - echo "Updating NOOBS..." - - # update Partition 3 - mkdir -p /tmp/p3 - sudo mount /dev/mmcblk0p3 /tmp/p3 - sudo rm -rf /tmp/p3/os/* 2> /dev/null - if grep -q 'Raspple II' /tmp/p3/installed_os.json; then - echo "Downloading Raspple II lite..." - noobsUrl="ivanx.com/rasppleii/files/RasppleII_lite.zip" - noobsOSurl="ivanx.com/rasppleii/noobs-os" - distDir="Raspple_II" - sudo mkdir -p /tmp/p3/os/$distDir - sudo sed -i 's:/Raspbian:/Raspple_II:' /tmp/p3/installed_os.json - sudo wget -qO /tmp/p3/icon.png $noobsOSurl/Raspple_II.png - wget -qO- $noobsOSurl/slidesAB.tar | sudo tar -C /tmp/p3/os/$distDir -x - else - echo "Downloading NOOBS lite..." - noobsRoot="downloads.raspberrypi.org/NOOBS_lite/images/" - noobsDir=$(wget -qO- $noobsRoot | grep '^ /dev/null - releaseDate=$(wget -qO- $noobsOSurl/os.json | grep 'release_date' | cut -f 4 -d '"') - sudo sed -i 's/"release_date".*$/"release_date" : "'$releaseDate'"/' /tmp/p3/installed_os.json - sudo sed -i 's/keyboard_layout=gb/keyboard_layout=us/' /tmp/p3/noobs.conf - sudo sed -i 's:/mnt/:/settings/:' /tmp/p3/installed_os.json - sudo sed -i 's@"icon".*,@"icon" : "/settings/os/'$distDir'/icon.png",@' /tmp/p3/installed_os.json - sudo cp /tmp/p3/icon.png /tmp/p3/os/$distDir - sudo wget -qO /tmp/p3/os/$distDir/os.json $noobsOSurl/os.json - sudo wget -qO /tmp/p3/os/$distDir/partition_setup.sh $noobsOSurl/partition_setup.sh - sudo wget -qO /tmp/p3/os/$distDir/partitions.json $noobsOSurl/partitions.json - sudo umount /tmp/p3 - rmdir /tmp/p3 - - # update Partition 1 - mkdir -p /tmp/p1 - sudo mount /dev/mmcblk0p1 /tmp/p1 - wget -qO /tmp/noobs_lite.zip $noobsUrl - sudo rm -rf /tmp/p1/* - sudo unzip -d /tmp/p1 /tmp/noobs_lite.zip - sudo sed -i 's/^runinstaller //' /tmp/p1/recovery.cmdline - sudo sed -i 's/silentinstall//' /tmp/p1/recovery.cmdline - grep -q 'keyboard=us' /tmp/p1/recovery.cmdline || sudo sed -i '1 s/^\(.*\)$/\1 keyboard=us/' /tmp/p1/recovery.cmdline - grep -q 'disablesafemode' /tmp/p1/recovery.cmdline || sudo sed -i '1 s/^\(.*\)$/\1 disablesafemode/' /tmp/p1/recovery.cmdline - sudo umount /tmp/p1 - rmdir /tmp/p1 - - sudo sed -i 's/\(Raspple II release.*[^u]$\)/\1u/' /etc/issue -fi - -echo -echo "*** Raspbian update completed. ***" -echo - -cd /tmp - -if [[ $updateA2Cloud ]]; then - wget -qO /tmp/a2cloud-setup ivanx.com/a2cloud/setup/ - source /tmp/a2cloud-setup -y -r noSetGroups - if acmd -g /usr/share/gsport/disks/GSport\ Internet\ Starter\ Kit.2mg SYSTEM/FONTS/SIS.4.10 &> /dev/null; then - wget -qO /tmp/ua2.txt ivanx.com/rasppleii/files/a/ua2.txt - source /tmp/ua2.txt - fi - echo - echo "*** A2CLOUD update completed. ***" - echo -fi - -cd /tmp - -if [[ $updateA2Server ]]; then - wget -q -O /tmp/a2server-setup ivanx.com/a2server/setup/ - if ps aux | grep -q [s]mbd; then - source /tmp/a2server-setup -y -r -w - else - source /tmp/a2server-setup -y -r - fi - echo - echo "*** A2SERVER update completed. ***" - echo -fi - -cd "$origDir" - -if [[ ! $autoYes ]]; then - echo - echo - echo "Your system has been updated and needs to reboot to use its new software." - echo - echo -n "Reboot now (recommended)? " - read - if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - sudo shutdown -r now - fi -else - echo "*** raspbian-update completed. ***" - sudo shutdown -r now -fi diff --git a/docs/ivanx/setup/setup.txt b/docs/ivanx/setup/setup.txt deleted file mode 120000 index 6bc732c..0000000 --- a/docs/ivanx/setup/setup.txt +++ /dev/null @@ -1 +0,0 @@ -v1.8.2.txt \ No newline at end of file diff --git a/docs/ivanx/setup/shk2image.txt b/docs/ivanx/setup/shk2image.txt deleted file mode 100644 index 8d452cf..0000000 --- a/docs/ivanx/setup/shk2image.txt +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -origDir="$PWD" -[[ ! -n $1 || ! -n $2 ]] && { echo "Usage: shk2image archiveFileName imageFileName [PRODOS.DIR.NAME]"; exit 1; }; -imageFileName="$2"; -prodosDir="$3"; -[[ ! -f "$1" ]] && { echo "Archive file '$1' was not found."; exit 1; }; -[[ ! -f "$imageFileName" ]] && mkpo "$imageFileName"; -[[ -n $prodosDir ]] && dirName="$prodosDir/" || dirName=; -IFS=""; -[[ ${1:0:1} == "/" ]] && archiveFile="$1" || archiveFile="$origDir/$1" -mkdir -p /tmp/shk2image_temp -cd /tmp/shk2image_temp -shkFiles=$(nulib2 -xse "$archiveFile" | tr "\r" "~" | cut -d "~" -f 2 | cut -c 18-); -cd "$origDir" -while read thisFile; do - fileName=${thisFile%%#*}; - fileType=${thisFile##*#}; - echo "extracting $fileName..."; - acmd -d "$imageFileName" $dirName$fileName &>/dev/null; - acmd -p "$imageFileName" $dirName$fileName \$${fileType:0:2} \$${fileType:2:4} < /tmp/shk2image_temp/"$thisFile" - rm /tmp/shk2image_temp/"$thisFile" -done <<< $shkFiles -rm -r /tmp/shk2image_temp diff --git a/docs/ivanx/setup/term.txt b/docs/ivanx/setup/term.txt deleted file mode 100644 index 44d00ba..0000000 --- a/docs/ivanx/setup/term.txt +++ /dev/null @@ -1,46 +0,0 @@ -if [[ $1 == "-d" ]]; then - shift - setgetty=1 -else - setgetty= -fi - -if [[ $1 == "-f" ]]; then - shift - force=1 -else - force= -fi - -if [[ ! $1 || $1 == "--help" || $1 == "-h" ]]; then - echo 'Usage: term [-d] mono|color|none|'; - echo ' -d sets default emulation for all serial port shells (takes effect on logout)' - echo ' omitting -d makes change temporary and immediate' - echo ' -f forces change even if not running on serial port (e.g. within "screen")' - echo ' Terminal emulation: mono->VT-100, color->PC-ANSI/ANSI-BBS, none->no emulation' -else - if [[ $(tr [:upper:] [:lower:] <<< $1) == "mono" ]]; then - term="vt100" - elif [[ $(tr [:upper:] [:lower:] <<< $1) == "color" ]]; then - term="pcansi" - elif [[ $(tr [:upper:] [:lower:] <<< $1) == "none" ]]; then - term="dumb" - else - term="$1" - fi - if [[ $setgetty ]]; then - sudo sed -i "s/\(ttyAMA0 .*\) .*$/\1 $term/" /etc/inittab; - sudo sed -i "s/\(ttyUSB.* .*\) .*$/\1 $term/g" /etc/inittab; - sudo init q; - sudo pkill -f "/sbin/getty" - else - if [[ $force || $(tty | grep tty) ]]; then - TERM="$term" - else - echo 1>&2 "Not running on serial port. No action taken. Use -f to set anyway." - fi - fi -fi - -echo -e "$(tty) current emulation: $(tput bold)$TERM$(tput sgr0)" -echo -e "default serial port emulation at login: $(tput bold)$(grep ttyUSB /etc/inittab | sed 's/^.*ttyUSB[^ ]* .* \(.*\)$/\1/')$(tput sgr0)" diff --git a/docs/ivanx/setup/ttyusbhandler.txt b/docs/ivanx/setup/ttyusbhandler.txt deleted file mode 100644 index 0296fc6..0000000 --- a/docs/ivanx/setup/ttyusbhandler.txt +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# called by udev as: -# ttyusbhandler [add|remove] ttyUSBname - -# depending on what port ttyUSB adapter was added or removed from, -# automatically launches or kills ADTPro as needed -# restarts getty as needed - -# remove: -# kill any ADTPro for this port -# if a getty is on this port, do nothing here, it will be killed and respawn -# iteself - -# add: -# stagger adds by port number to prevent problems during simultaneous add at startup -# if lower port, solo adapter on lower port USB hub, or lower port of any USB hub, -# kill any ADTPro, rescan for getty if sleeping, and launch adtPro -# if upper port, solo adapter on upper port USB hub, or higher port of any USB hub, -# rescan for getty - -if [[ $1 == "remove" ]]; then - rm /tmp/udev-$2-removed &> /dev/null - touch /tmp/udev-$2-removed - pkill -f "$2.*ADTPro" -elif [[ $1 == "add" ]]; then - [[ $2 == "ttyUSBlower" ]] && sleep 1.5 - [[ ${#2} -gt 11 ]] && sleep "${2:15:2}" - if [[ $2 == "ttyUSBlower" || \ - $2 == $(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | head -1 | cut -c 6-) || \ - ( ${2:0:12} == "ttyUSBlower_" && $2 != $(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | tail -1 | cut -c 6-) ) \ - ]]; then - rm /tmp/udev-ttyUSBlower-added &> /dev/null - touch /tmp/udev-ttyUSBlower-added - pkill -f "[A]DTPro" - pkill -f "[u]sbgetty" - exec /usr/local/adtpro/adtpro.sh headless serial - else # ttyUSBupper - rm /tmp/udev-ttyUSBupper-added &> /dev/null - touch /tmp/udev-ttyUSBupper-added - pkill -f "[g]etty.*ttyUSB" - fi -else - exit 2 -fi diff --git a/docs/ivanx/setup/usbgetty.txt b/docs/ivanx/setup/usbgetty.txt deleted file mode 100644 index 8d5b805..0000000 --- a/docs/ivanx/setup/usbgetty.txt +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -ttyUSB= - -pkill -f "sleep 86399" - -if [[ $(grep -e '-scanttyUSB' <<< "$*") ]]; then - # called with -scantty isntead of device name? - # echo "-scantty mode" - - # if upper USB port - if [[ -c /dev/ttyUSBupper ]]; then - ttyUSB=ttyUSBupper - - # if hub in upper port, use highest numbered port on hub - elif [[ $(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | wc -l) -gt 0 ]]; then - ttyUSB=$(ls -1 /dev/ttyUSBupper_hub* 2> /dev/null | tail -1 | cut -c 6-) - - # if hub in lower port with multiple adapters, use highest numbered port on hub - elif [[ $(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | wc -l) -gt 1 ]]; then - ttyUSB=$(ls -1 /dev/ttyUSBlower_hub* 2> /dev/null | tail -1 | cut -c 6-) - - # no port found eligible for getty - else - # echo "scantty no devices eligible: sleeping" - sleep 86399 - fi - - # echo "result:$ttyUSB" -elif [[ $(grep -o 'ttyUSB[^ ]*' <<< "$*") ]]; then - # echo "device specified" - # if specified USB device name is found - ttyUSB=$(grep -o 'ttyUSB[^ ]*' <<< "$*") -else - # echo "specified device failed: sleeping" - sleep 86399 -fi - -if [[ -c /dev/$ttyUSB && ! $(ps aux | grep "[g]etty.*$ttyUSB") ]]; then - # if adapter seems to exist and doesn't already have a getty, - # kill all USB gettys and start the getty, otherwise do nothing - pkill -f "/sbin/getty.*ttyUSB" - exec /sbin/getty $(sed "s/-scanttyUSB/$ttyUSB/" <<< "$@"); -else - # echo "getty already running or doesn't exist: sleeping" - sleep 86399 -fi diff --git a/docs/ivanx/setup/v1.8.2.txt b/docs/ivanx/setup/v1.8.2.txt deleted file mode 100644 index 95210aa..0000000 --- a/docs/ivanx/setup/v1.8.2.txt +++ /dev/null @@ -1,1983 +0,0 @@ -#!/bin/bash - -version="182" -adtProVersion="2.0.1" - -## ID-bashbyter routines - -binToDec () { -# converts single-byte binary string (8 bits) value to decimal -# warning: no error checking -# arg: binary string up to 8 bits -# out: decimal value - dec=0 - bits=$1 - while (( ${#bits} < 8 )); do - bits="0$bits" - done - for n in {0..7}; do - (( dec+=( ${bits:$n:1} * ( 2**(7-$n) ) ) )) - done - echo -n $dec -} - -writecharDec () { -# write corresponding character of single-byte decimal value into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: decimal number from 0-255 -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 -# out: nothing - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \ - && ( $3 -ge 0 ) && ( $3 -lt 255 ) ]] || return 23 - # args are valid - echo -n -e "\x$(printf %02X "$3")" | \ - dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null -} - -writecharsHex () { -# write corresponding characters of hex values into file -# arg1: filename -# arg2: offset (# of bytes to skip before writing) -# arg3: string of two-digit hexadecimal numbers from 00-FF, period delimited (not checked!) -# out: nothing -# exit: 8=extraneous arg, 11=missing arg1, 12=missing arg2, -# 13=missing arg3, 22=invalid arg2, 23=invalid arg3 - [[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13 - [[ $4 ]] && return 8 - [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \ - && ( $2 -ge 0 ) ]] || return 22 - p=0 - offset=$2 - len=${#3} - while (( p < len )); do - outByte=${3:$p:2} - [[ $(printf %02X "0x$outByte" 2> /dev/null) == \ - $(echo -n "$outByte" | tr [a-z] [A-Z]) ]] || return 23 - # args are valid - echo -n -e "\x$outByte" | \ - dd of="$1" bs=1 seek=$offset conv=notrunc 2> /dev/null - (( p += 3 )) - (( offset++ )) - done -} - -# A2CLOUD installer start - -isRpi= -[[ -f /usr/bin/raspi-config ]] && isRpi=1 -[[ $isRpi ]] && { me="Pi"; fullme="Raspberry Pi"; } || { me="computer"; fullme="computer"; } - -isDebian= -[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1 - -if [[ -f /usr/local/etc/A2CLOUD-version ]]; then - echo "A2CLOUD version available: $version" - echo "A2CLOUD version installed: $(cat /usr/local/etc/A2CLOUD-version)" -fi - -args="$@" - -buildA2CloudDisk= -downloadBinaries=1 -noA2PiExtras= -skipRepoUpdate= -restartPrompt= -autoAnswerYes= -updateRasppleII= -slot6= -noSetGroups= -while [[ $1 ]]; do - if [[ $1 == "-b" ]]; then - shift - buildA2CloudDisk=1 - elif [[ $1 == "-c" ]]; then - shift - downloadBinaries= - elif [[ $1 == "-p" ]]; then - shift - noA2PiExtras=1 - elif [[ $1 == "-r" ]]; then - shift - skipRepoUpdate="-r" - elif [[ $1 == "-s" ]]; then - shift - restartPrompt=1 - elif [[ $1 == "-y" ]]; then - shift - autoAnswerYes="-y" - elif [[ $1 == "-6" ]]; then - shift - slot6=1 - elif [[ $1 == "-os" || $1 == "os" ]]; then - # elif [[ ${1,,} == "rasppleii" || ${1,,} == "raspple" || ${1,,} == "rasappleii" || ${1,,} == "rasapple" || ${1,,} == "raspple2" || ${1,,} == "rasapple2" || ${1,,} == "-rasppleii" || ${1,,} == "-raspple" || ${1,,} == "-rasappleii" || ${1,,} == "-rasapple" || ${1,,} == "-raspple2" || ${1,,} == "-rasapple2" ]]; then - shift - updateRasppleII=1 - elif [[ $1 == "-v" ]]; then - shift - if [[ ! -f /usr/local/etc/A2CLOUD-version ]]; then - echo "A2CLOUD version available: $version" - echo "A2CLOUD version installed: none" - fi - [[ $0 == "-bash" ]] && return 1 || exit 1 - elif [[ $1 == "noSetGroups" ]]; then - shift - noSetGroups=1 - elif [[ $1 ]]; then - echo "options:" - echo "-v: display installed and available versions, then exit" - echo "-y: auto-answer yes to all prompts" - echo "-r: don't update package lists" - echo "-s: prompt for restart after installation" - echo "-6: put blank 140K disk images in GSport and KEGS slot 6" - echo "-b: build A2CLOUD disks, rather than downloading premade images" - echo "-c: compile non-package items, rather than downloading binaries" - if [[ $isRpi ]]; then - echo "-p: don't install Apple II Pi extras" - echo "-os: update Raspbian OS, A2CLOUD, A2SERVER, and Apple II Pi" - fi - [[ $0 == "-bash" ]] && return 1 || exit 1 - fi -done - -if [[ $updateRasppleII ]]; then - echo "A2CLOUD: Updating Raspple II (takes up to an hour)..." - wget -qO /tmp/raspbian-update ivanx.com/a2cloud/setup/raspbian-update.txt - source /tmp/raspbian-update a2cloud a2server $autoAnswerYes $skipRepoUpdate - [[ $0 == "-bash" ]] && return 0 || exit 0 -fi - -echo -echo "Your $fullme will be set up for A2CLOUD, providing you" -echo " with mass storage and online access for your Apple II!" -echo -echo "Answer yes to all prompts if you want to be able to do all the" -echo " stuff mentioned on the A2CLOUD web site." -echo -echo "If you already have A2CLOUD installed, you will be updated to the" -echo " latest version. Check out http://ivanx.com/a2cloud for details." -echo -echo "Full installation may take an hour or longer. Updates are usually" -echo " much quicker. Type 'a2cloud-setup -h' for installation options." -echo -echo "Some actions will be performed as the root user." -if [[ ! $autoAnswerYes ]]; then - echo - echo -n "Continue? " - read - if [[ ${REPLY:0:1} != "Y" && ${REPLY:0:1} != "y" ]]; then - [[ $0 == "-bash" ]] && return 2 || exit 2 - fi -fi - -echo -installAllFeatures= -if [[ ! $autoAnswerYes ]]; then - echo - echo -n "Do you want to install all A2CLOUD features? " - read -fi -[[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installAllFeatures=1 - -if [[ $installAllFeatures ]]; then - installADTPro=1 - createBootDisk=1 - setupSerialPortLogin=1 - installCommTools=1 - installArchiveTools=1 - installEmulators=1 - [[ $isRpi ]] && installA2Pi=1 || installA2Pi= -else - installADTPro= - echo - echo -n "Install ADTPro server, for virtual drives and floppy disk transfers" - if [[ ! -f /usr/bin/X ]]; then - echo - echo -n "(the X Window System and LXDE desktop environment will be installed)" - fi - echo -n "? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installADTPro=1 - - createBootDisk= - installArchiveTools= - newImageName= - imageSize= - if [[ $installADTPro ]]; then - - echo - echo -n "Do you want to create A2CLOUD 140K and 800K boot disk images? " - read - if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - createBootDisk=1 - installArchiveTools=1 - fi - - if [[ ! -f /usr/local/adtpro/disks/Virtual.po || ( -f /usr/local/adtpro/adtpro.sh && -f /usr/local/adtpro/disks/Virtual.po && $(sha1sum /usr/local/adtpro/disks/Virtual.po | cut -f 1 -d ' ') == "a209a8b3a485c95c57bc691a8a58867a6c0ec628" ) ]]; then - while (( 1 )); do - echo - echo "The default blank disk in S2,D1 will be 800K. If you want a different size," - echo -n " enter it in K (larger is slower when writing; max 8192): " - read - if (( ${REPLY}0 >= 1400 )); then - imageSize=$REPLY - echo -n "Enter new image file name: " - read - if [[ $REPLY ]]; then - reply="$REPLY" - [[ $(tr [:lower:] [:upper:] <<< ${reply:(-3)}) != ".PO" ]] && reply="$REPLY.PO" - if [[ ! -f /usr/local/adtpro/disks/"$reply" ]]; then - newImageName="$reply" - prodosVolName='0' - # test ProDOS name legality - while [[ ${#prodosVolName} -gt 15 || ! $(grep ^[A-Z][0-9A-Z\.]*$ <<< $prodosVolName) ]]; do - echo -n "Enter new image ProDOS volume name (or return for 'UNTITLED'): " - read - [[ $REPLY ]] && prodosVolName="$REPLY" || prodosVolName="UNTITLED" - prodosVolName=$(tr [:lower:] [:upper:] <<< $prodosVolName) - done - break - else - echo "A2CLOUD: Disk image already exists. Not creating." - fi - fi - else - break - fi - done - fi - fi - - setupSerialPortLogin= - echo - echo -n "Do you want to set up your $me for serial port login? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && setupSerialPortLogin=1 - - installCommTools= - echo - echo -n "Install internet access and file transfer tools on your $me? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installCommTools=1 - - if [[ ! $installArchiveTools ]]; then - echo - echo -n "Install utilities for Apple II archives and disk images? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installArchiveTools=1 - fi - - installEmulators= - echo - echo -n "Install Apple IIgs and IIe emulators? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installEmulators=1 - - installA2Pi= - if [[ $isRpi ]]; then - echo - echo -n "Install Apple II Pi? " - read - [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]] && installA2Pi=1 - fi -fi - -echo -userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':') -[[ $userPw == "$(echo 'apple2' | perl -e '$_ = ; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 || isApple2Pw= -[[ $userPw == "$(echo 'raspberry' | perl -e '$_ = ; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isRaspberryPw=1 || isRaspberryPw= - -if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2CLOUD-version ]]; then - if [[ ! $autoAnswerYes ]]; then - echo "To make A2CLOUD work smoothly, you are recommended" - echo "to change your password to 'apple2'." - echo - echo -n "Do you want to change the password for user '$USER' to 'apple2' now? " - read - fi - if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - echo "A2CLOUD: changing password for user '$USER' to 'apple2'..." - echo "$USER:apple2" | sudo chpasswd - isApple2Pw=1 - fi -fi -thePassword="your password" -[[ $isApple2Pw ]] && thePassword="'apple2'" -[[ $isRaspberryPw ]] && thePassword="'raspberry'" - - -echo -echo "During this installation, enter ${thePassword}" -echo "if prompted for passwords." -echo -if [[ ! $autoAnswerYes ]]; then - echo -n "Press return to continue..." - read -fi - - -origDir="$PWD" -rm -rf /tmp/a2cloud-install &> /dev/null -mkdir -p /tmp/a2cloud-install -cd /tmp/a2cloud-install - -echo -if [[ ! $skipRepoUpdate ]]; then - echo "A2CLOUD: Updating package lists..." - sudo apt-get -y update > /dev/null -else - echo "A2CLOUD: Not updating package lists..." -fi - - -# general commands and configuration - -echo "A2CLOUD: Adding udev trigger to /etc/rc.local..." -#grep udevadm /etc/rc.local > /dev/null || sudo sed -i 's/^exit 0$/[ -e \/dev\/ttyUSBupper ] \&\& $(ps aux | grep "sleep 86399" > \/dev\/null) \&\& udevadm trigger --action=change\n[ -e \/dev\/ttyUSBlower ] \&\& ! $(ps aux | grep [a]dtpro > \/dev\/null) \&\& udevadm trigger --action=change\n\nexit 0/' /etc/rc.local -grep udevadm /etc/rc.local > /dev/null || sudo sed -i 's/^exit 0$/[ -e \/dev\/ttyUSBupper ] \&\& ! [ -f \/tmp\/udev-ttyUSBupper-added ] \&\& udevadm trigger --action=change\n[ -e \/dev\/ttyUSBlower ] \&\& ! [ -f \/tmp\/udev-ttyUSBlower-added ] \&\& udevadm trigger --action=change\n\nexit 0/' /etc/rc.local - -echo "A2CLOUD: Setting up dopo command..." -sudo wget -qO /usr/local/bin/dopo ivanx.com/a2cloud/setup/dopo.txt -sudo chmod ugo+x /usr/local/bin/dopo - -echo "A2CLOUD: Setting up cppo command..." -sudo wget -qO /usr/local/bin/cppo ivanx.com/a2cloud/setup/cppo.txt -sudo chmod ugo+x /usr/local/bin/cppo - -echo "A2CLOUD: Setting up a2cloud-help..." -sudo wget -qO /usr/local/etc/a2cloud-help.txt ivanx.com/a2cloud/setup/a2cloud-help.txt -if [[ $isRpi ]]; then - sudo sed -i 's/^gsport.*$/gsport : GSport Apple IIgs emulator (or log in with user "apple2user")/' /usr/local/etc/a2cloud-help.txt -fi - -echo "A2CLOUD: Setting up motd..." -if [[ $(grep Raspple /etc/motd) ]]; then - wget -qO- ivanx.com/rasppleii/motd-rasppleii.txt | sudo tee /etc/motd > /dev/null -elif [[ $(grep A2SERVER /etc/motd) ]]; then - wget -qO- ivanx.com/rasppleii/motd-vm.txt | sudo tee /etc/motd > /dev/null -else - wget -qO- ivanx.com/a2cloud/setup/motd.txt | sudo tee /etc/motd > /dev/null -fi - -if { lspci 2> /dev/null | grep -q VirtualBox; }; then - echo "A2CLOUD: Disabling VirtualBox console screen blanking..." - sudo sed -i 's/^BLANK_DPMS=off/BLANK_DPMS=on/' /etc/kbd/config - sudo sed -i 's/^BLANK_TIME=[^0].$/BLANK_TIME=0/' /etc/kbd/config - sudo /etc/init.d/kbd restart &> /dev/null - sudo /etc/init.d/console-setup restart &> /dev/null -fi - -echo "A2CLOUD: Setting up control commands and environment variables..." -sudo wget -qO /usr/local/etc/a2cloud-aliases ivanx.com/a2cloud/setup/a2cloud-aliases.txt -echo "A2CLOUD: Setting up login script..." -sudo sed -i "s/a2cloud-aliases/a2cloudrc/" /etc/bash.bashrc -sudo sed -i '/ttyUSB/d' /etc/bash.bashrc -[[ ! $(grep a2cloudrc /etc/bash.bashrc) ]] && echo "source /usr/local/etc/a2cloudrc" | sudo tee -a /etc/bash.bashrc > /dev/null -sudo wget -qO /usr/local/etc/a2cloudrc ivanx.com/a2cloud/setup/a2cloudrc.txt -source /usr/local/etc/a2cloudrc - -echo "A2CLOUD: Saving installer version..." -echo "$version" | sudo tee /usr/local/etc/A2CLOUD-version &> /dev/null - -if [[ ! $(dpkg -l avahi-daemon 2> /dev/null | grep ^ii) || ! $(dpkg -l libnss-mdns 2> /dev/null | grep ^ii) ]]; then - echo "A2CLOUD: Installing avahi-daemon (mDNS)..." - sudo apt-get -y install avahi-daemon &> /dev/null - sudo apt-get -y clean - sudo sed -i 's/^\(hosts.*\)$/\1 mdns/' /etc/nsswitch.conf -else - echo "A2CLOUD: avahi-daemon (mDNS) is already installed." -fi - -if [[ $installADTPro ]]; then - - freeSpace=$(df / | tail -1 | awk '{ print $4 }') - java -version &> /dev/null - if (( $? == 127 && $freeSpace < 350000 )); then - echo "You do not have enough free space to install" - echo "Java, which is needed for ADTPro server." - if [[ $isRpi ]]; then - echo "If you haven't" - echo "yet expanded the file system to use the full capacity" - echo "of your SD card, type \"sudo raspi-config\" and do that." - else - echo "Free up some space." - fi - echo "Then try this installer again." - echo - [[ $0 == "-bash" ]] && return 3 || exit 3 - fi - - if [[ ! -f /usr/bin/X ]]; then - echo "A2CLOUD: Installing X Window System and LXDE..." - sudo apt-get -y install xorg lxde - sudo apt-get -y clean - # prevent automatically running at startup - sudo sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*$/GRUB_CMDLINE_LINUX_DEFAULT="text"/' /etc/default/grub - sudo update-grub - else - echo "A2CLOUD: X Window System and LXDE are already installed." - fi - - # if [[ ! -f /etc/xdg/autostart/lxterminal.desktop ]]; then - # echo "A2CLOUD: Setting terminal window to auto-open on desktop..." - # echo -e "\n[Desktop Entry]\nType=Application\nExec=/usr/bin/lxterminal" | sudo tee /etc/xdg/autostart/lxterminal.desktop > /dev/null - # else - # echo "A2CLOUD: Terminal window already set to auto-open on desktop." - # fi - - if { lspci 2> /dev/null | grep -q VirtualBox; }; then - if { ! grep -q default /etc/xdg/lxsession/LXDE/autostart; }; then - echo "A2CLOUD: Setting desktop to 800x600 in VirtualBox console (no Additions)..." - echo -e "\nxrandr --output default --mode 800x600" | sudo tee -a /etc/xdg/lxsession/LXDE/autostart > /dev/null - else - echo "A2CLOUD: Desktop already set to 800x600 in VirtualBox console (no Additions)." - fi - if { ! grep -q VBOX0 /etc/xdg/lxsession/LXDE/autostart; }; then - echo "A2CLOUD: Setting desktop to 800x600 in VirtualBox console (with Additions)..." - echo -e "\nxrandr --output VBOX0 --mode 800x600" | sudo tee -a /etc/xdg/lxsession/LXDE/autostart > /dev/null - else - echo "A2CLOUD: Desktop already set to 800x600 in VirtualBox console (with Additions)." - fi - echo "A2CLOUD: Disabling screensaver and screen blanking in VirtualBox LXDE..." - sudo sed -i 's/^\(@xscreensaver.*\)$/#\1\n\nxset s noblank\nxset s off\nxset -dpms\n/' /etc/xdg/lxsession/LXDE/autostart - fi - if [[ $isRpi ]]; then - sudo sed -i 's/^.*VBOX0.*$//' /etc/xdg/lxsession/LXDE/autostart 2> /dev/null - sudo sed -i 's/^.*VBOX0.*$//' /etc/xdg/lxsession/LXDE-pi/autostart 2> /dev/null - fi - - # install or update java - javaVersion=$(java -version 2>&1) - if [[ ( $? -eq 127 ) || ( $(head -1 <<< "$javaVersion" | cut -f 2 -d '.') -lt 8 ) ]]; then - echo "A2CLOUD: Installing Java (takes a while)..." - if [[ $isRpi ]]; then - if [[ $(apt-cache search '^oracle-java8-jdk$') ]]; then - sudo apt-get -y install oracle-java8-jdk - else - sudo apt-get -y install oracle-java7-jdk - fi - sudo apt-get -y clean - else - # from http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html - if { ! grep -q webupd8team /etc/apt/sources.list; }; then - { - echo; - echo "# Oracle Java JDK"; - echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main"; - echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main"; - } | sudo tee -a /etc/apt/sources.list > /dev/null - fi - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 - sudo apt-get -y update - echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections - sudo apt-get -y install oracle-java8-installer - sudo apt-get -y clean - fi - source /usr/local/etc/a2cloudrc - else - echo "A2CLOUD: Java is already installed." - fi - - updateADTPro= - # check if update needed - if [ -f /usr/local/adtpro/lib/ADTPro-* ]; then - if [[ $(ls -1 /usr/local/adtpro/lib/ADTPro-*.jar | cut -f 6 -d '/') != "ADTPro-$adtProVersion.jar" ]]; then - echo - echo "ADTPro server should be updated. If you have made any customizations" - echo " to any of the files in /usr/local/adtpro, other than the 'disks' folder," - echo " they will be lost. If you don't know what this means, then you don't" - echo -n " need to worry. Update now? " - read - if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - updateADTPro=1 - echo "A2CLOUD: removing old version of ADTPro server..." - sudo pkill -f [A]DTPro - sudo rm /usr/local/adtpro/disks/ADTPRO*.DSK &> /dev/null - sudo rm /usr/local/adtpro/disks/ADTPRO*.PO &> /dev/null - sudo rm /usr/local/adtpro/disks/VDRIVE*.DSK &> /dev/null - sudo rm -r /tmp/a2cloud-install/disks &> /dev/null - sudo mv /usr/local/adtpro/disks /tmp/a2cloud-install - sudo rm -r /usr/local/adtpro/ac.bat \ - /usr/local/adtpro/ac.sh \ - /usr/local/adtpro/adtpro.bat \ - /usr/local/adtpro/adtpro.cmd \ - /usr/local/adtpro/ADTPro.html \ - /usr/local/adtpro/adtpro.sh \ - /usr/local/adtpro/lib \ - /usr/local/adtpro/LICENSE \ - /usr/local/adtpro/README \ - &> /dev/null - fi - else - echo "A2CLOUD: ADTPro server does not need updating." - fi - fi - - if [[ ! -f /usr/local/adtpro/adtpro.sh || ! -f /usr/local/adtpro/ADTPro.html ]]; then - echo "A2CLOUD: installing ADTPro server..." - sudo pkill -f [A]DTPro - wget -qO /tmp/a2cloud-install/adtpro.tar.gz downloads.sourceforge.net/project/adtpro/adtpro/ADTPro-$adtProVersion/ADTPro-$adtProVersion.tar.gz - sudo mkdir -p /usr/local/adtpro - sudo tar --strip-components=1 -C /usr/local/adtpro -zxf /tmp/a2cloud-install/adtpro.tar.gz - sudo chmod -R ugo+w /usr/local/adtpro - sudo ln -s /usr/local/adtpro/lib/ADTPro*jar /usr/local/adtpro/lib/ADTPro.jar - sudo ln -s /usr/local/adtpro/lib/AppleCommander/AppleCommander*ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar - echo "sudo /usr/local/adtpro/adtpro.sh \$@" | sudo tee /usr/local/bin/adtpro.sh > /dev/null - sudo chmod ugo+x /usr/local/bin/adtpro.sh - sudo usermod -a -G uucp $USER - sudo usermod -a -G uucp root - else - echo "A2CLOUD: ADTPro server is already installed." - fi - - if [[ ! -f /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar ]]; then - echo "A2CLOUD: Installing AppleCommander-1.3.5.13id..." - sudo mkdir -p /usr/local/adtpro/lib/AppleCommander - wget -qO /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar http://downloads.sourceforge.net/project/applecommander/AppleCommander%20-%20Interim/testcase/AppleCommander-1.3.5.13id-ac.jar - rm /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar &> /dev/null - ln -s AppleCommander-1.3.5.13id-ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar - else - echo "A2CLOUD: AppleCommander-1.3.5.13id is already installed." - fi - - echo "A2CLOUD: Setting up customized adtpro.sh..." - wget -qO /usr/local/adtpro/adtpro.sh ivanx.com/a2cloud/setup/adtpro.sh.txt - sudo chmod ugo+rwx /usr/local/adtpro/adtpro.sh - - if [[ $updateADTPro ]]; then - echo "A2CLOUD: Replacing disks folder..." - sudo mv /tmp/a2cloud-install/disks/* /usr/local/adtpro/disks - sudo rmdir /tmp/a2cloud-install/disks - fi - - if [[ ! -f /usr/lib/jni/librxtxSerial.so ]]; then - echo "A2CLOUD: Installing serial port libraries..." - sudo apt-get -y install librxtx-java - sudo apt-get -y clean - else - echo "A2CLOUD: Serial port libraries are already installed." - fi - [[ ! -f /usr/lib/RXTXcomm.jar ]] && sudo ln -s /usr/share/java/RXTXcomm.jar /usr/lib &> /dev/null - [[ ! -d /usr/local/adtpro/lib/rxtx/rxtx-2.2pre2-local/arm ]] && ln -s /usr/lib/jni /usr/local/adtpro/lib/rxtx/rxtx-2.2pre2-local/arm &> /dev/null - - if [[ ! -f /usr/bin/xvfb-run ]]; then - echo "A2CLOUD: Installing xvfb for headless operation..."cd - sudo apt-get -y install xvfb - sudo apt-get -y clean - else - echo "A2CLOUD: xvfb is already installed." - fi - - if [[ -f /usr/local/sbin/afpd ]]; then # A2SERVER/netatalk installed - if [[ ! -d /media/A2SHARED/ADTDISKS || ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then - echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Apple file sharing..." - if [[ ! -d /media/A2SHARED/ADTDISKS ]]; then - ln -s /usr/local/adtpro/disks /media/A2SHARED/ADTDISKS 2> /dev/null - fi - if [[ ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then - sudo sed -i 's@^# End of File@/media/A2SHARED/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default - fi - sudo /etc/init.d/netatalk restart - else - echo "A2CLOUD: /usr/local/adtpro/disks is already set up for Apple file sharing." - fi - - if { grep -q A2SHARED /etc/samba/smb.conf 2> /dev/null; }; then # SMB already enabled by A2SERVER - if { grep -q ADTDISKS /etc/samba/smb.conf 2>/dev/null; }; then - echo "A2CLOUD: /usr/local/adtpro/disks is already set up for Windows file sharing." - else - echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Windows file sharing..." - echo "[ADTDISKS]" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " path = /media/A2SHARED/ADTDISKS" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " browsable = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " guest ok = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " read only = no" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " create mask = 0666" | sudo tee -a /etc/samba/smb.conf > /dev/null - echo " force user = $(whoami)" | sudo tee -a /etc/samba/smb.conf > /dev/null - fi - else - echo "A2CLOUD: Windows file sharing not in use." - fi - fi - - echo "A2CLOUD: Setting up adtpro-start command..." - sudo wget -qO /usr/local/bin/adtpro-start ivanx.com/a2cloud/setup/adtpro-start.txt - sudo chmod ugo+x /usr/local/bin/adtpro-start - - echo "A2CLOUD: Setting up vsd1/vsd2 commands..." - sudo wget -qO /usr/local/bin/vsd ivanx.com/a2cloud/setup/vsd.txt - sudo chmod ugo+x /usr/local/bin/vsd - - echo "A2CLOUD: Setting up acmd command..." - sudo wget -qO /usr/local/bin/acmd ivanx.com/a2cloud/setup/acmd.txt - sudo chmod ugo+x /usr/local/bin/acmd - - echo "A2CLOUD: Setting up mkpo command..." - sudo wget -qO /usr/local/bin/mkpo ivanx.com/a2cloud/setup/mkpo.txt - sudo chmod ugo+x /usr/local/bin/mkpo - - echo "A2CLOUD: Setting up dos2pro command..." - sudo wget -qO /usr/local/bin/dos2pro ivanx.com/a2cloud/setup/dos2pro.txt - sudo chmod ugo+x /usr/local/bin/dos2pro - -fi - -if [[ -f /usr/bin/X ]]; then - if [[ ! -f /usr/sbin/xrdp ]]; then - echo "A2CLOUD: Installing xrdp/tightvncserver..." - sudo apt-get -y install xrdp - sudo apt-get -y clean - else - echo "A2CLOUD: xrdp/tightvncserver is already installed." - fi -else - echo "A2CLOUD: /usr/bin/X not found; not installing xrdp/tightvncserver." -fi - -if [[ $setupSerialPortLogin ]]; then - - echo "A2CLOUD: Setting GPIO serial login to 4800 bps, and disabling..." - # set console port login to 4800 bps (using RPi console cable) and comment it out - sudo sed -i 's/^\(T.*\)ttyAMA0 .* /#\1ttyAMA0 4800 /' /etc/inittab - sudo sed -i 's/ttyAMA0,[0-9]*/ttyAMA0,4800/g' /boot/cmdline.txt 2> /dev/null - - if [[ ! -f /usr/bin/screen ]]; then - echo "A2CLOUD: Installing Screen for multiple terminals..." - sudo apt-get -y install screen - sudo apt-get -y clean - else - echo "A2CLOUD: Screen is already installed." - fi - echo "A2CLOUD: Disabling Screen welcome message..." - sudo sed -i 's/^#startup_message/startup_message/' /etc/screenrc - - # use 8-bit (non-Unicode) character set for proper emulation in Apple II term programs - IFS='' defaultLang=$(grep ^LANG= /etc/default/locale | cut -f 2 -d '=') - langLatin1=${defaultLang%%.*} - if [[ ! $(grep "^$langLatin1.ISO" /usr/share/i18n/SUPPORTED) ]]; then - langLatin1="en_US" - fi - if [[ $(cat /usr/local/etc/a2cloud-lang 2> /dev/null) != $langLatin1 ]]; then - echo "A2CLOUD: Setting serial port login to use 8-bit character set..." - if [[ ! $(grep "^$langLatin1.ISO" /etc/locale.gen) ]]; then - echo "A2CLOUD: Generating locales..." - locs=$(IFS='' grep "^[^#]" /etc/locale.gen | while read -r thisLoc; do echo -n "$thisLoc, " ; done) - locISO=$(grep "$langLatin1.ISO" /usr/share/i18n/SUPPORTED | sort | head -1) - echo "locales locales/locales_to_be_generated multiselect $locs$locISO" | sudo debconf-set-selections - sudo rm /etc/locale.gen &> /dev/null - sudo dpkg-reconfigure -f noninteractive locales - else - echo "A2CLOUD: Locales have already been generated." - fi - # set LANG to ISO-8859 (8-bit) character set on TTY login - echo "${locISO%% *}" | sudo tee /usr/local/etc/a2cloud-lang > /dev/null - source /usr/local/etc/a2cloudrc - else - echo "A2CLOUD: Serial port login is already using 8-bit character set." - fi - - echo "A2CLOUD: Setting up baud command..." - sudo wget -qO /usr/local/bin/baud ivanx.com/a2cloud/setup/baud.txt - sudo chmod ugo+x /usr/local/bin/baud - - echo "A2CLOUD: Setting up term command..." - sudo wget -qO /usr/local/bin/term ivanx.com/a2cloud/setup/term.txt - sudo chmod ugo+x /usr/local/bin/term - - echo "A2CLOUD: Setting up usbgetty command..." - sudo wget -qO /usr/local/sbin/usbgetty ivanx.com/a2cloud/setup/usbgetty.txt - sudo chmod ugo+x /usr/local/sbin/usbgetty - - echo "A2CLOUD: Removing ttyUSB0 shell login..." - sudo sed -i "s/^\([^#].*ttyUSB0.*\)$//" /etc/inittab - - if [[ ! $(grep -e '-scanttyUSB' /etc/inittab) ]]; then - echo "A2CLOUD: Adding USB port shell login at 4800 bps..." - echo -e "\n\n#for USB-to-serial adapter\nT1:23:respawn:/usr/local/sbin/usbgetty -h -L -scanttyUSB 4800 vt100" | sudo tee -a /etc/inittab > /dev/null - sudo init q - sudo pkill -f "[g]etty.*ttyUSB" - else - echo "A2CLOUD: USB port shell login already added." - fi -fi - - -echo "A2CLOUD: Setting up USB port serial adapter handler..." -sudo wget -qO /usr/local/sbin/ttyusbhandler ivanx.com/a2cloud/setup/ttyusbhandler.txt -sudo chmod ugo+x /usr/local/sbin/ttyusbhandler - -if [[ ! -f /etc/udev/rules.d/50-usb.rules ]]; then - echo "A2CLOUD: Creating device rules for USB ports..." - udevLines= - if [[ $isRpi ]]; then - # assign ttyUSBupper, or ttyUSBupper_hubXX, for shell usb-to-serial adapter - # assign ttyUSBlower, or ttyUSBlower_hubXX, for ADTPro usb-to-serial adapter - # (A/A+ direct attach is always ttyUSBlower; - # hub attached to A/A+ will be ttyUSBupper on port 2, and ttyUSBlower on port 3) - udevLines+='KERNEL=="ttyUSB*", KERNELS=="1-1:1.0", SYMLINK+="ttyUSBlower", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBlower"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*1-1:1.0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBlower"\n' - udevLines+='KERNEL=="ttyUSB*", KERNELS=="1-1.2:1.0", SYMLINK+="ttyUSBupper", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBupper"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*1-1.2:1.0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBupper"\n' - udevLines+='KERNEL=="ttyUSB*", KERNELS=="1-1.3:1.0", SYMLINK+="ttyUSBlower", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBlower"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*1-1.3:1.0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBlower"\n' - for i in {1..25}; do - ii=$(printf %02d $i) - udevLines+='KERNEL=="ttyUSB*", KERNELS=="1-1.2.'$i':1.0", SYMLINK+="ttyUSBupper_hub'$ii'", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBupper_hub'$ii'"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*1-1.2.'$i':1.0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBupper_hub'$ii'"\n' - udevLines+='KERNEL=="ttyUSB*", KERNELS=="1-1.3.'$i':1.0", SYMLINK+="ttyUSBlower_hub'$ii'", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBlower_hub'$ii'"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*1-1.3.'$i':1.0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBlower_hub'$ii'"\n' - done - else - # on non-Pi installations, assign ttyUSBupper to ttyUSB0 and ttyUSBlower to ttyUSB1 - udevLines+='KERNEL=="ttyUSB0", SYMLINK+="ttyUSBupper", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBupper"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*ttyUSB0*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBupper"\n' - udevLines+='KERNEL=="ttyUSB1", SYMLINK+="ttyUSBlower", RUN+="/usr/local/sbin/ttyusbhandler add ttyUSBlower"\n' - udevLines+='ACTION=="remove", ENV{DEVPATH}=="*ttyUSB1*", RUN+="/usr/local/sbin/ttyusbhandler remove ttyUSBlower"\n' - fi - echo -e "$udevLines" | sudo tee /etc/udev/rules.d/50-usb.rules > /dev/null -else - echo "A2CLOUD: Device rules for USB ports already exist." -fi - - -if [[ $installCommTools ]]; then - - if [[ ! -f /usr/bin/curl ]]; then - echo "A2CLOUD: Installing curl..." - sudo apt-get -y install curl - sudo apt-get -y clean - else - echo "A2CLOUD: curl is already installed." - fi - - if [[ ! -f /usr/bin/sz ]]; then - echo "A2CLOUD: Installing rzsz for X/Y/Zmodem transfers..." - sudo apt-get -y install lrzsz - sudo apt-get -y clean - else - echo "A2CLOUD: rzsz is already installed." - fi - - if [[ ! -f /usr/bin/ftp ]]; then - echo "A2CLOUD: Installing ftp..." - sudo apt-get -y install ftp - sudo apt-get -y clean - else - echo "A2CLOUD: ftp is already installed." - fi - - if [[ ! -f /usr/local/bin/cftp ]]; then - echo "A2CLOUD: Installing cftp..." - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/cftp-rpi.tgz | sudo tar Pzx - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/cftp-debian7_x86.tgz | sudo tar Pzx - fi - fi - if [[ ! -f /usr/local/bin/cftp ]]; then - sudo apt-get -y install build-essential - sudo apt-get -y install ncurses-dev - sudo apt-get -y clean - rm -rf /tmp/a2cloud-install/cftp* &> /dev/null - mkdir -p /tmp/a2cloud-install/cftp - cd /tmp/a2cloud-install/cftp - wget -q -O cftp.tgz http://nih.at/cftp/cftp-0.12.tar.gz - tar zxf cftp.tgz - cd cftp-0.12 - ./configure - make - sudo make install - cd /tmp/a2cloud-install - rm -rf cftp - fi - else - echo "A2CLOUD: cftp is already installed." - fi - - if [[ ! -f /usr/bin/lynx ]]; then - echo "A2CLOUD: Installing lynx..." - sudo apt-get -y install lynx - sudo apt-get -y clean - else - echo "A2CLOUD: lynx is already installed." - fi - - if [[ ! -f /usr/bin/links ]]; then - echo "A2CLOUD: Installing links..." - sudo apt-get -y --force-yes install links - sudo apt-get -y clean - else - echo "A2CLOUD: links is already installed." - fi - - sudo wget -qO /usr/local/bin/a2news ivanx.com/a2cloud/setup/a2news.txt - sudo chmod ugo+x /usr/local/bin/a2news - if [[ ! -f /usr/bin/tin ]]; then - echo "A2CLOUD: Installing a2news/tin..." - sudo apt-get -y install tin - sudo apt-get -y clean - else - echo "A2CLOUD: a2news/tin is already installed." - fi - # have exim4 use IPv4 only to prevent log errors (IPv6 is off by default in Raspbian) - if [[ $(grep ' ; ::1' /etc/exim4/update-exim4.conf.conf) ]]; then - echo "A2CLOUD: Setting exim4 to use only IPv4 to prevent startup error messages..." - sudo sed -i 's/ ; ::1//' /etc/exim4/update-exim4.conf.conf - sudo update-exim4.conf - sudo rm /var/log/exim4/mainlog /var/log/exim4/paniclog &> /dev/null - fi - # restore exim4 log directory if occupied by a file put there by earlier A2CLOUD versions - if [[ -f /var/log/exim4 ]]; then - echo "A2CLOUD: Restoring exim4 log directory..." - sudo rm /var/log/exim4 - sudo mkdir /var/log/exim4 - sudo chown Debian-exim:adm /var/log/exim4 - sudo chmod 2750 /var/log/exim4 - fi - - sudo wget -qO /usr/local/bin/a2chat ivanx.com/a2cloud/setup/a2chat.txt - sudo chmod ugo+x /usr/local/bin/a2chat - if [[ ! -f /usr/bin/irssi ]]; then - echo "A2CLOUD: Installing a2chat/irssi..." - sudo apt-get -y install irssi - sudo apt-get -y clean - else - echo "A2CLOUD: a2chat/irssi is already installed." - fi - - if [[ ! -f /usr/bin/telnet ]]; then - echo "A2CLOUD: Installing telnet..." - sudo apt-get -y install telnet - sudo apt-get -y clean - else - echo "A2CLOUD: telnet is already installed." - fi - - if [[ ( ! -f /usr/bin/ttytter && ! -f /usr/local/bin/ttytter ) || ! -f "/usr/local/share/perl/5.14.2/Term/ReadLine/TTYtter.pm" ]]; then - echo "A2CLOUD: Installing TTYtter..." - sudo wget -qO /usr/local/bin/ttytter http://www.floodgap.com/software/ttytter/dist2/2.1.00.txt - sudo chmod ugo+x /usr/local/bin/ttytter - perlVersion=$(perl -e 'print $^V' | cut -c 2-) - if [[ ! -f "/usr/local/share/perl/$perlVersion/Term/ReadLine/TTYtter.pm" ]]; then - echo "A2CLOUD: Installing TTYtter readline module..." - if [[ $downloadBinaries && $perlVersion == "5.14.2" ]]; then - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/ttytter_readline-rpi.tgz | sudo tar Pzx - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/ttytter_readline-debian7_x86.tgz | sudo tar Pzx - fi - fi - if [[ ! -f "/usr/local/share/perl/$perlVersion/Term/ReadLine/TTYtter.pm" ]]; then - if [[ ! -f "/usr/local/lib/perl/$perlVersion/Term/ReadKey.pm" ]]; then - cd /tmp/a2cloud-install - wget -qO TermReadKey-2.31.tar.gz http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.31.tar.gz - tar zxf TermReadKey-2.31.tar.gz - cd TermReadKey-2.31 - perl Makefile.PL &> /dev/null - make &> /dev/null - sudo make install &> /dev/null - cd /tmp/a2cloud-install - rm -rf TermReadKey-2.31 - fi - cd /tmp/a2cloud-install - wget -qO Term-ReadLine-TTYtter-1.4.tar.gz http://www.cpan.org/authors/id/C/CK/CKAISER/Term-ReadLine-TTYtter-1.4.tar.gz - tar zxf Term-ReadLine-TTYtter-1.4.tar.gz - cd Term-ReadLine-TTYtter-1.4 - perl Makefile.PL &> /dev/null - make &> /dev/null - sudo make install &> /dev/null - cd /tmp/a2cloud-install - rm -rf Term-ReadLine-TTYtter-1.4 - fi - else - echo "A2CLOUD: TTYtter readline module is already installed." - fi - else - echo "A2CLOUD: TTYtter is already installed." - fi -fi - -if [[ $installA2Pi ]]; then - if [[ ! -f /sbin/a2pid ]]; then - echo "A2CLOUD: Installing Apple II Pi..." - cd /tmp/a2cloud-install - if ! grep 'schmenk.is-a-geek.com' /etc/apt/sources.list; then - echo "deb http://schmenk.is-a-geek.com/raspbian wheezy contrib" | sudo tee -a /etc/apt/sources.list > /dev/null - sudo apt-get -y update > /dev/null - fi - sudo apt-get -y --force-yes install a2pi - sudo apt-get -y clean - # wget -qO a2pi_armhf.deb schmenk.is-a-geek.com/tarfiles/a2pi_armhf.deb - # sudo dpkg -i a2pi_armhf.deb &> /dev/null - # rm a2pi_armhf.deb &> /dev/null - else - echo "A2CLOUD: Apple II Pi is already installed." - fi - if [[ ! $noA2PiExtras ]]; then - if [[ ! $(dpkg -l | grep libpcap0.8-dev) ]]; then - sudo apt-get -y install libpcap0.8-dev - sudo apt-get -y clean - fi - if [[ ! -f /usr/bin/gsport ]]; then - # echo "A2CLOUD: Updating package repositories to include Apple II Pi..." - # sudo apt-get -y update > /dev/null - echo "A2CLOUD: Installing Apple II Pi extras (GSport)..." - sudo apt-get -y --force-yes install apple2user - sudo apt-get -y clean - else - echo "A2CLOUD: Apple II Pi extras (GSport) are already installed." - fi - fi - sudo sed -i 's/( $SSH_CLIENT || $REMOTEHOST )/( $(tty | grep ttyUSB) || $(tty | grep ttyAMA) || $SSH_CLIENT || $REMOTEHOST )/' /usr/bin/gsport - if [[ $slot6 ]]; then - echo "A2CLOUD: Putting blank disks in GSport slot 6..." - sudo sed -i 's@^s6d1.*$@s6d1 = /usr/share/gsport/disks/slot6drive1.po@' /usr/share/gsport/config.txt - sudo sed -i 's@^s6d2.*$@s6d2 = /usr/share/gsport/disks/slot6drive2.po@' /usr/share/gsport/config.txt - sudo sed -i 's@^s6d1.*$@s6d1 = /usr/share/gsport/disks/slot6drive1.po@' /home/apple2/config.txt - sudo sed -i 's@^s6d2.*$@s6d2 = /usr/share/gsport/disks/slot6drive2.po@' /home/apple2/config.txt - if [[ ! -f /usr/share/gsport/disks/slot6drive1.po || ! -f /usr/share/gsport/disks/slot6drive2.po ]]; then - wget -qO- ivanx.com/a2cloud/files/slot6-gsport-rpi.tgz | sudo tar Pzx 2> /dev/null - fi - fi - - # set AppleTalk to turbo - if ! grep -q 'g_appletalk_turbo' /usr/share/gsport/config.txt; then - if grep -q 'bram1[00]' /usr/share/gsport/config.txt; then - sudo sed -i 's/^\(bram1\[00\]\)/g_appletalk_turbo = 1\n\n\1/' /usr/share/gsport/config.txt - else - echo -e '\ng_appletalk_turbo = 1' | sudo tee -a /usr/share/gsport/config.txt > /dev/null - fi - fi - sudo sed -i 's/^g_appletalk_turbo = 0/g_appletalk_turbo = 1/' /usr/share/gsport/config.txt - - # enable Uthernet - if ! grep -q 'g_ethernet[^_]' /usr/share/gsport/config.txt; then - if grep -q 'bram1[00]' /usr/share/gsport/config.txt; then - sudo sed -i 's/^\(bram1\[00\]\)/g_ethernet = 1\n\n\1/' /usr/share/gsport/config.txt - else - echo -e '\ng_ethernet = 1' | sudo tee -a /usr/share/gsport/config.txt > /dev/null - fi - fi - sudo sed -i 's/^g_ethernet = 0/g_ethernet = 1/' /usr/share/gsport/config.txt - -fi - -if [[ $installEmulators ]]; then - - # KEGS - if [[ ! -f /usr/local/bin/xkegs ]]; then - echo "A2CLOUD: Installing KEGS..." - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/kegs-rpi.tgz | sudo tar Pzx 2> /dev/null - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/kegs-debian7_x86.tgz | sudo tar Pzx - fi - fi - if [[ ! -f /usr/local/bin/xkegs ]]; then - echo "A2CLOUD: Building KEGS from source..." - sudo apt-get -y install build-essential &> /dev/null - sudo apt-get -y install libx11-dev libxext-dev xfonts-base &> /dev/null - sudo apt-get -y clean - mkdir -p /tmp/a2cloud-install/kegs - cd /tmp/a2cloud-install/kegs - wget -q -O kegs.tgz kegs.sourceforge.net/kegs.0.91.tar.gz - tar zxf kegs.tgz - cd kegs.0.91/src - rm vars 2> /dev/null - ln -s vars_x86linux vars - if [[ $isRpi ]]; then - sudo sed -i 's/march=pentium/march=armv6k/' vars_x86linux - fi - make &> /dev/null - gcc -o ../to_pro to_pro.c &> /dev/null - gcc -o ../partls partls.c &> /dev/null - sudo cp -P ../xkegs ../to_pro ../partls /usr/local/bin - sudo cp ../config.kegs /usr/local/lib - sudo chmod ugo+w /usr/local/lib/config.kegs - cd /tmp/a2cloud-install - rm -rf kegs - fi - - if [[ $slot6 ]]; then - echo "A2CLOUD: Putting blank disks in KEGS slot 6..." - sudo sed -i 's@^s6d1.*$@s6d1 = /usr/local/share/gsdisks/slot6drive1.po@' /usr/local/lib/config.kegs - sudo sed -i 's@^s6d2.*$@s6d2 = /usr/local/share/gsdisks/slot6drive2.po@' /usr/local/lib/config.kegs - if [[ ! -f /usr/local/share/gsdisks/slot6drive1.po || ! -f /usr/local/share/gsdisks/slot6drive2.po ]]; then - wget -qO- ivanx.com/a2cloud/files/slot6.tgz | sudo tar Pzx 2> /dev/null - fi - fi - else - echo "A2CLOUD: KEGS is already installed." - fi - echo "A2CLOUD: Updating KEGS launch and setup files..." - - sudo addgroup kegs &> /dev/null - sudo chgrp kegs /usr/local/bin/xkegs - sudo chmod u+s /usr/local/bin/xkegs - - sudo wget -qO /usr/local/bin/kegs ivanx.com/a2cloud/setup/kegs.txt - sudo chmod ugo+x /usr/local/bin/kegs - sudo wget -qO /usr/local/bin/kegs-setup ivanx.com/a2cloud/setup/kegs-setup-shell.txt - sudo chmod ugo+x /usr/local/bin/kegs-setup - - - # GSport, if non-RPi - if [[ ! $isRpi && ! -f /usr/local/bin/gsport ]]; then - echo "A2CLOUD: Installing GSport..." - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - sudo apt-get -y install libpcap0.8-dev &> /dev/null - sudo apt-get -y clean - if [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/gsport-debian7_x86.tgz | sudo tar Pzx 2> /dev/null - fi - fi - if [[ ! -f /usr/local/bin/gsport ]]; then - echo "A2CLOUD: Building GSport from source..." - sudo apt-get -y install build-essential &> /dev/null - sudo apt-get -y install libx11-dev libxext-dev xfonts-base libpcap0.8-dev &> /dev/null - sudo apt-get -y clean > /dev/null - mkdir -p /tmp/a2cloud-install/gsport - cd /tmp/a2cloud-install/gsport - wget -q -O gsport.tgz downloads.sourceforge.net/project/gsport/GSport-0.31/gsport_0.31.tar.gz - tar zxf gsport.tgz - cd gsport*/src - rm vars 2> /dev/null - ln -s vars_x86linux vars - make &> /dev/null - gcc -o ../to_pro to_pro.c &> /dev/null - gcc -o ../partls partls.c &> /dev/null - sudo cp -P ../gsportx ../to_pro ../partls /usr/local/bin - sudo cp ../config.txt /usr/local/lib - sudo chmod ugo+w /usr/local/lib/config.txt - make clean &> /dev/null - rm vars - cp vars_fbrpilinux vars - sed -i 's/-march=armv6/-march=i686/' vars - make &> /dev/null - sudo cp -P ../gsportfb /usr/local/bin - cd /usr/local/lib - sudo ln -s config.txt gsport_config.txt 2> /dev/null - cd /tmp/a2cloud-install - rm -rf gsport - fi - - if [[ $slot6 ]]; then - echo "A2CLOUD: Putting blank disks in GSport slot 6..." - sudo sed -i 's@^s6d1.*$@s6d1 = /usr/local/share/gsdisks/slot6drive1.po@' /usr/local/lib/config.txt - sudo sed -i 's@^s6d2.*$@s6d2 = /usr/local/share/gsdisks/slot6drive2.po@' /usr/local/lib/config.txt - if [[ ! -f /usr/local/share/gsdisks/slot6drive1.po || ! -f /usr/local/share/gsdisks/slot6drive2.po ]]; then - wget -qO- ivanx.com/a2cloud/files/slot6.tgz | sudo tar Pzx 2> /dev/null - fi - fi - - # enable AppleTalk - if ! grep -q 'g_appletalk_turbo' /usr/local/lib/config.txt; then - if grep -q 'bram1[00]' /usr/local/lib/config.txt; then - sudo sed -i 's/^\(bram1\[00\]\)/g_appletalk_turbo = 1\n\n\1/' /usr/local/lib/config.txt - else - echo -e '\ng_appletalk_turbo = 1' | sudo tee -a /usr/local/lib/config.txt > /dev/null - fi - fi - sudo sed -i 's/g_appletalk_turbo = 0/g_appletalk_turbo = 1/' /usr/local/lib/config.txt - - # enable Uthernet - if ! grep -q 'g_ethernet[^_]' /usr/local/lib/config.txt; then - if grep -q 'bram1[00]' /usr/local/lib/config.txt; then - sudo sed -i 's/^\(bram1\[00\]\)/g_ethernet = 1\n\n\1/' config.txt - else - echo -e '\ng_ethernet = 1' | sudo tee -a /usr/local/lib/config.txt > /dev/null - fi - fi - sudo sed -i 's/g_ethernet = 0/g_ethernet = 1/' /usr/local/lib/config.txt - else - [[ ! $isRpi ]] && echo "A2CLOUD: GSport is already installed." - fi - if [[ ! $isRpi ]]; then - echo "A2CLOUD: Updating GSport launch and setup files..." - - sudo addgroup gsport &> /dev/null - sudo chgrp gsport /usr/local/bin/gsportfb - sudo chmod u+s /usr/local/bin/gsportfb - sudo chgrp gsport /usr/local/bin/gsportx - sudo chmod u+s /usr/local/bin/gsportx - - sudo wget -qO /usr/local/bin/gsport ivanx.com/a2cloud/setup/gsport.txt - sudo chmod ugo+x /usr/local/bin/gsport - sudo wget -qO /usr/local/bin/gsport-setup ivanx.com/a2cloud/setup/gsport-setup-shell.txt - sudo chmod ugo+x /usr/local/bin/gsport-setup - fi - - - # LinApple - if [[ ! -f /usr/local/linapple/linapple ]]; then - echo "A2CLOUD: Installing LinApple..." - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/linapple-rpi.tgz | sudo tar Pzx - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/linapple-debian7_x86.tgz | sudo tar Pzx - fi - fi - if [[ ! -f /usr/local/linapple/linapple ]]; then - sudo apt-get -y install build-essential - sudo apt-get -y install libsdl1.2-dev libcurl4-openssl-dev zlib1g-dev libzip-dev - sudo apt-get -y clean - rm -rf /tmp/a2cloud-install/linapple* &> /dev/null - mkdir -p /tmp/a2cloud-install/linapple - cd /tmp/a2cloud-install/linapple - wget -q -O linapple.tar.bz2 downloads.sourceforge.net/project/linapple/linapple/linapple-2a/linapple-src_2a.tar.bz2 - tar jxf linapple.tar.bz2 - cd linapple-src_2a/src - # doesn't compile with gcc 4.7, so use older version - if (( $(g++ --version | head -1 | rev | cut -f 1 -d ' ' | rev | tr -d '.') >= 470 )); then - sudo apt-get -y install g++-4.6 - sudo apt-get -y clean - sed -i 's@CXX ?= c++@CXX = /usr/bin/g++-4.6@' Makefile - fi - make - sudo make install - cd /tmp/a2cloud-install - rm -rf linapple - fi - else - echo "A2CLOUD: LinApple is already installed." - fi - echo "A2CLOUD: Updating LinApple launch file..." - sudo wget -qO /usr/local/bin/linapple ivanx.com/a2cloud/setup/linapple.txt - sudo chmod ugo+x /usr/local/bin/linapple - -fi - -if [[ $installArchiveTools ]]; then - - if [[ ! -f /usr/local/bin/nulib2 || ! -f /usr/local/bin/sciibin || ! -f /usr/local/bin/usq ]]; then - - echo "A2CLOUD: Installing nulib2, sciibin, unblu, unbit, unexec, usq..." - - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/nulib2-rpi.tgz | sudo tar Pzx - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/nulib2-debian7_x86.tgz | sudo tar Pzx - fi - fi - if [[ ! -f /usr/local/bin/nulib2 ]]; then - sudo apt-get -y install build-essential - sudo apt-get -y install zlib1g-dev - sudo apt-get -y clean - - # install nulib2 - rm -rf nulib &> /dev/null - mkdir -p nulib - cd nulib - wget -qO nulib.tgz http://web.archive.org/web/20131031160750/http://www.nulib.com/downloads/nulibdist.tar.gz - tar zxf nulib.tgz - cd nufxlib* - ./configure - make - sudo make install - cd ../nulib2* - ./configure - make - sudo make install - cd /tmp/a2cloud-install - rm -rf nulib - fi - - if [[ ! -f /usr/local/bin/sciibin || ! -f /usr/local/bin/usq ]]; then - # install sciibin/unblu/unbit/unexec/usq - sudo apt-get -y install build-essential - sudo apt-get -y clean - rm -rf undoit &> /dev/null - mkdir -p undoit - cd undoit - wget -q http://web.archive.org/web/20110619163030/http://fadden.com/dl-apple2/undoit.zip - unzip undoit.zip - make - sudo mv sciibin unbit unblu unexec usq /usr/local/bin - cd /tmp/a2cloud-install - rm -rf undoit - fi - else - echo "A2CLOUD: nulib2, sciibin, unblu, unbit, unexec, usq are already installed." - fi - - echo "A2CLOUD: Setting up shk2image command..." - sudo wget -qO /usr/local/bin/shk2image ivanx.com/a2cloud/setup/shk2image.txt - sudo chmod ugo+x /usr/local/bin/shk2image - - # download and install The Unarchiver, for expanding apple.com disk images - # http://wakaba.c3.cx/s/apps/unarchiver.html - if [[ ! -f /usr/local/bin/unar ]]; then - echo "A2CLOUD: Installing The Unarchiver..." - cd /tmp/a2cloud-install - if [[ $downloadBinaries ]]; then - if [[ $isRpi || $isDebian ]]; then - sudo apt-get -y install libgnustep-base1.22 - sudo apt-get -y clean - if [[ $isRpi ]]; then - wget -qO- ivanx.com/a2cloud/files/unar-rpi.tgz | sudo tar Pzx - elif [[ $isDebian ]]; then - wget -qO- ivanx.com/a2cloud/files/unar-debian7_x86.tgz | sudo tar Pzx - fi - fi - fi - if [[ ! -f /usr/local/bin/unar ]]; then - sudo apt-get -y install build-essential - sudo apt-get -y install libgnustep-base-dev libz-dev libbz2-dev - sudo apt-get -y install libssl-dev libicu-dev unzip - sudo apt-get -y clean - rm -rf unar &> /dev/null - mkdir -p unar - cd unar - wget -q -nc http://theunarchiver.googlecode.com/files/unar1.7_src.zip - unzip -o unar1.7_src.zip - cd The\ Unarchiver/XADMaster - make -f Makefile.linux - sudo mv lsar unar /usr/local/bin - cd ../Extra - sudo mkdir -p /usr/local/man/man1 - sudo mv lsar.1 unar.1 /usr/local/man/man1 - cd /tmp/a2cloud-install - rm -rf unar - fi - sudo mandb &> /dev/null - else - echo "A2CLOUD: The Unarchiver is already installed." - fi -fi - -# add shortcuts to LXDE desktop and menu -if [[ -f /usr/bin/X ]]; then - - [[ -d /etc/xdg/lxsession/LXDE-pi ]] && lxde="lxde-pi" || lxde="lxde" - echo "A2CLOUD: Creating LXDE desktop and menu shortcuts..." - - # remove auto-open Terminal window from pre-1.8.0 - echo "A2CLOUD: removing auto-open LXDE terminal window (if present)..." - sudo rm /etc/xdg/autostart/lxterminal.desktop 2> /dev/null - - # create "AppleII" category - mkdir -p ~/.config/menus - if [[ ! -f ~/.config/menus/${lxde}-applications.menu ]]; then - mkdir -p ~/.config/menus - echo -e "\n\n A2CLOUD menu extension\n /etc/xdg/menus/${lxde}-applications.menu\n \n Apple II\n lxde-appleii.directory\n \n AppleII\n \n \n\n" > ~/.config/menus/${lxde}-applications.menu - else - grep -q AppleII ~/.config/menus/${lxde}-applications.menu || echo "A2CLOUD: LXDE child category file exists, not creating Apple II category." - fi - # create "Apple II" menu entry - sudo mkdir -p /usr/local/share/desktop-directories - echo -e "[Desktop Entry]\nName=Apple II\nComment=Programs and utilities related to the Apple II\nIcon=/usr/local/linapple/icon.bmp\nType=Directory\n" | sudo tee /usr/local/share/desktop-directories/lxde-appleii.directory > /dev/null - # create menu and desktop shortcuts - sudo mkdir -p /usr/local/share/applications - # create user desktop items folder - mkdir -p ~/Desktop - # GSport: - if [[ -f /usr/bin/gsport ]]; then - echo -e "[Desktop Entry]\nName=GSport\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/bin/gsport\nIcon=/usr/local/share/gsport32.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/gsport.desktop > ~/Desktop/gsport.desktop - elif [[ -f /usr/local/bin/gsport ]]; then - echo -e "[Desktop Entry]\nName=GSport\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/local/bin/gsport\nIcon=/usr/local/share/gsport32.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/gsport.desktop > ~/Desktop/gsport.desktop - fi - if [[ ! -f /usr/local/share/gsport32.ico ]]; then - sudo wget -qO /usr/local/share/gsport32.ico ivanx.com/a2cloud/files/gsport32.ico - fi - # KEGS: - if [[ -f /usr/local/bin/kegs ]]; then - echo -e "[Desktop Entry]\nName=KEGS\nComment=Apple IIgs Emulator\nExec=lxterminal -e /usr/local/bin/kegs\nIcon=/usr/local/share/kegsicon.png\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/kegs.desktop > /dev/null - [[ ! -f ~/Desktop/gsport.desktop ]] && cp /usr/local/share/applications/kegs.desktop ~/Desktop/kegs.desktop - fi - if [[ ! -f /usr/local/share/kegsicon.png ]]; then - sudo wget -qO /usr/local/share/kegsicon.png ivanx.com/a2cloud/files/kegsicon.png - fi - # LinApple: - if [[ -f /usr/local/bin/linapple ]]; then - echo -e "[Desktop Entry]\nName=LinApple\nComment=Apple IIe Emulator\nExec=lxterminal -e /usr/local/bin/linapple\nIcon=/usr/local/linapple/icon.bmp\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/linapple.desktop > ~/Desktop/linapple.desktop - fi - # ADTPro Server: - if [[ -f /usr/local/bin/adtpro.sh ]]; then - echo -e "[Desktop Entry]\nName=ADTPro Server\nComment=Floppy Transfer Utility\nExec=/usr/local/bin/adtpro.sh\nIcon=/usr/local/adtpro/lib/ADTPro.ico\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/local/share/applications/adtproserver.desktop > ~/Desktop/adtproserver.desktop - fi - # LXTerminal: - if [[ ! $(grep lxterminal.desktop /etc/xdg/lxpanel/profile/LXDE-pi/panels/panel 2> /dev/null) && ! -f ~/Desktop/lxterminal.desktop ]]; then - cp /usr/share/applications/lxterminal.desktop ~/Desktop/lxterminal.desktop - fi - # prevent PolicyKit error on GUI startup - sudo sed -i 's/^NotShowIn=GNOME;KDE;\?$/NotShowIn=GNOME;KDE;LXDE/' /etc/xdg/autostart/lxpolkit.desktop 2> /dev/null - sed -i 's/^NotShowIn=GNOME;KDE;\?$/NotShowIn=GNOME;KDE;LXDE/' /home/$USER/.config/autostart/lxpolkit.desktop 2> /dev/null -fi - - -# create A2CLOUD disk - -if [[ ( $updateADTPro || $createBootDisk ) && -f /usr/local/bin/acmd ]]; then - a2CloudDisk=/usr/local/adtpro/disks/A2CLOUD.PO -else - a2CloudDisk= -fi - -if [[ $a2CloudDisk ]]; then - echo - echo "A2CLOUD: Preparing A2CLOUD disk images..." - cd /tmp/a2cloud-install - a2CloudDisk140=${a2CloudDisk%%.*}.DSK - if [[ ! -f $a2CloudDisk && ! -f $a2CloudDisk140 ]]; then - makeA2CloudDisk=1 - else - [[ -f $a2CloudDisk ]] && echo "A2CLOUD: $a2CloudDisk already exists." - [[ -f $a2CloudDisk140 ]] && echo "A2CLOUD: $a2CloudDisk140 already exists." - echo " If you want a fresh copy, please move or delete as needed." - makeA2CloudDisk= - fi - - if [[ ! $makeA2CloudDisk ]]; then # not getting/building disks - - a2CloudDiskUpdated= - if [[ $updateADTPro && -f "$a2CloudDisk" ]]; then # does existing 800K disk need updating? - sudo pkill -f [A]DTPro - echo "A2CLOUD: Updating ADTPro and VDrive on 800K A2CLOUD disk..." - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE - | acmd -p "$a2CloudDisk" VEDRIVE SYS - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPROAUD - | acmd -p "$a2CloudDisk" ADTPROAUD SYS - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPROETH - | acmd -p "$a2CloudDisk" ADTPROETH SYS - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO.BIN - | acmd -p "$a2CloudDisk" ADTPRO.BIN BIN \$0800 - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPROAUD.BIN - | acmd -p "$a2CloudDisk" ADTPROAUD.BIN SYS \$0800 - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPROETH.BIN - | acmd -p "$a2CloudDisk" ADTPROETH.BIN SYS \$0800 - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE.CONFIG - | acmd -p "$a2CloudDisk" VEDRIVE.CONFIG BAS - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO - | acmd -p "$a2CloudDisk" ADTPRO SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE - | acmd -p "$a2CloudDisk" VSDRIVE SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE.LOW - | acmd -p "$a2CloudDisk" VSDRIVE.LOW SYS - a2CloudDiskUpdated=1 - fi - if [[ $updateADTPro && -f "$a2CloudDisk140" ]]; then # does existing 140K disk need updating? - sudo pkill -f [A]DTPro - echo "A2CLOUD: Updating ADTPro and VDrive on 140K A2CLOUD disk..." - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO.BIN - | acmd -p "$a2CloudDisk140" ADTPRO.BIN BIN \$0800 - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO - | acmd -p "$a2CloudDisk140" ADTPRO SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE - | acmd -p "$a2CloudDisk140" VSDRIVE SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE.LOW - | acmd -p "$a2CloudDisk140" VSDRIVE.LOW SYS - a2CloudDiskUpdated=1 - fi - if [[ $a2CloudDiskUpdated ]]; then - echo - echo "Your A2CLOUD boot disk images have been updated. You may want" - echo " to update your boot floppy with their current contents using ADTPro." - fi - echo - else # building or downloading disks - sudo pkill -f [A]DTPro - if [[ ! $buildA2CloudDisk ]]; then - echo "A2CLOUD: Downloading 800K disk image..." - wget -qO $a2CloudDisk ivanx.com/a2cloud/files/A2CLOUD.PO - echo "A2CLOUD: Downloading 140K disk image..." - wget -qO $a2CloudDisk140 ivanx.com/a2cloud/files/A2CLOUD.DSK - fi - - # build if we don't have a disk image - # (because download failed or -b argument was used) - if [[ ! -f $a2CloudDisk || ( $(wc -c $a2CloudDisk | cut -f 1 -d ' ') != "819200" ) ]]; then - - # start with a disk image - echo "A2CLOUD: Creating 800K disk image..." - cp /usr/local/adtpro/disks/ADTPRO-*PO $a2CloudDisk - acmd -n $a2CloudDisk A2CLOUD - - # ADTPro - echo "A2CLOUD: Preparing ADTPro..." - - acmd -d "$a2CloudDisk" BASIC - acmd -d "$a2CloudDisk" STARTUP.SYSTEM - acmd -d "$a2CloudDisk" ADTPRO - # start from ADTPro distribution image and replace BASIC.SYSTEM 1.4.1 with 1.5 - wget -qO Disk_3_of_7-SystemTools1.sea.bin http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2FDisk_3_of_7-SystemTools1.sea.bin - unar -k skip Disk_3_of_7-SystemTools1.sea.bin &> /dev/null - mv 'Disk 3 of 7-SystemTools1.sea' SystemTools1.dc42 - acmd -g SystemTools1.dc42 BASIC.SYSTEM - | acmd -p "$a2CloudDisk" BASIC.SYSTEM SYS - # use our startup program - wget -qO- ivanx.com/a2cloud/files/STARTUP.BAS | acmd -p "$a2CloudDisk" STARTUP BAS - - # VEDRIVE - echo "A2CLOUD: Copying VEDRIVE..." - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE - | acmd -p "$a2CloudDisk" VEDRIVE SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VEDRIVE.CONFIG - | acmd -p "$a2CloudDisk" VEDRIVE.CONFIG BAS - - # Apple System Utilities 3.1 support files - if [[ -f /usr/local/bin/unar ]]; then - echo "A2CLOUD: Downloading and copying System Utilities support files..." - cd /tmp/a2cloud-install - wget -qO Apple_II_System_Disk_3.2.sea.bin http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_II_Supplemental%2FApple_II_System_Disk_3.2.sea.bin - unar -k skip Apple_II_System_Disk_3.2.sea.bin &> /dev/null - dd if='Apple II System Disk 3.2.sea' of=A2SYSDISK32.PO bs=1 skip=84 count=819200 2> /dev/null - acmd -g A2SYSDISK32.PO UTIL.0 - | acmd -p "$a2CloudDisk" UTIL.0 BIN \$0900 - acmd -g A2SYSDISK32.PO UTIL.1 - | acmd -p "$a2CloudDisk" UTIL.1 BIN \$0E00 - acmd -g A2SYSDISK32.PO UTIL.2 - | acmd -p "$a2CloudDisk" UTIL.2 BIN \$B400 - else - echo "A2CLOUD: unar is not available; not installing System Utilities support files." - fi - - # ProTERM - echo "A2CLOUD: Downloading ProTERM..." - wget --user-agent="Mozilla/5.0 (wget_A2CLOUD; rv:1.13.4) Gecko/20100101 Firefox/4.0.1" -qO /tmp/a2cloud-install/pt31.shk http://lostclassics.apple2.info/download/InTrec/PT31A2GM2K9.SHK - mkdir -p /tmp/a2cloud-install/pt31 - cd /tmp/a2cloud-install/pt31 - nulib2 -xse ../pt31.shk > /dev/null - # IIc slot 1 patch for ProTERM from Hugh Hood - echo "A2CLOUD: Patching ProTERM for IIc printer port use..." - writecharsHex "PT3.CODE0#060000" 1638 "41.70.70.6C.65.20.49.49.63.2F.49.49.63.2B.20.50.72.69.6E.74.65.72.20.50.6F.72.74.20.20.20.20.20.06.07.10.41.70.70.6C.65.20.49.49.63.2F.49.49.63.2B.20.4D.6F.64.65.6D.20.50.6F.72.74.20.20.20.20.20.20.20.06.07.20" - echo "A2CLOUD: Copying ProTERM..." - for thisFile in /tmp/a2cloud-install/pt31/*; do - filenameUnix="${thisFile##*/}" - filename="${filenameUnix%%#*}" - filetype="${filenameUnix##*#}" - if [[ $filename != "PT3.DIAL" && $filename != "ProDOS" && $filename != "PT3.BACKUP" && $filename != "PT3.SYSTEM" ]]; then - acmd -p "$a2CloudDisk" $filename \$${filetype:0:2} \$${filetype:2:4} < $thisFile - fi - done - acmd -p "$a2CloudDisk" PT3.DIAL/PTD.SPACEBAR COM \$8002 < /tmp/a2cloud-install/pt31/PT3.DIAL/"PTD.SPACEBAR#598002" - echo "A2CLOUD: Adding 115200 baud macros for ProTERM..." - wget -qO PT3.IIC.MACRO ivanx.com/a2cloud/files/PT3.IIC.MACRO.txt - cat "PT3.GLOBAL#040000" | tr '\r' '\n' | sed ':a;N;$!ba;s/\n\*\nOPTION-f : Unused & available.\n\*/~~~/' | sed -e '/~~~/r PT3.IIC.MACRO' -e 's///' | tr '\n' '\r' | acmd -p "$a2CloudDisk" PT3.IIC.GLOBAL TXT - wget -qO PT3.IIE.MACRO ivanx.com/a2cloud/files/PT3.IIE.MACRO.txt - cat "PT3.GLOBAL#040000" | tr '\r' '\n' | sed ':a;N;$!ba;s/\n\*\nOPTION-f : Unused & available.\n\*/~~~/' | sed -e '/~~~/r PT3.IIE.MACRO' -e 's///' | tr '\n' '\r' | acmd -p "$a2CloudDisk" PT3.IIE.GLOBAL TXT - wget -qO PT3.IIGS.MACRO ivanx.com/a2cloud/files/PT3.IIGS.MACRO.txt - cat "PT3.GLOBAL#040000" | tr '\r' '\n' | sed ':a;N;$!ba;s/\n\*\nOPTION-h : Unused & available.\n\*\n\n\*\nOPTION-H : Unused & available.\n\*/~~~/' | sed -e '/~~~/r PT3.IIGS.MACRO' -e 's///' | tr '\n' '\r' | acmd -p "$a2CloudDisk" PT3.IIGS.GLOBAL TXT - acmd -p "$a2CloudDisk" PROTERM SYS < /tmp/a2cloud-install/pt31/"PT3.SYSTEM#ff2000" - cd /tmp/a2cloud-install - rm -rf /tmp/a2cloud-install/pt31 - - # Z-Link - echo "A2CLOUD: Downloading and copying Z-Link..." - cd /tmp/a2cloud-install - wget -qO /tmp/a2cloud-install/zlink.shk "ftp://ftp.gno.org/pub/apple2/prodos/comm/term/zLink91.shk" - nulib2 -p zlink.shk z.link.system | acmd -p "$a2CloudDisk" Z.LINK SYS - - # ShrinkIt - echo "A2CLOUD: Downloading and copying ShrinkIt..." - cd /tmp/a2cloud-install - wget -qO shrinkit.sdk http://web.archive.org/web/20131031160750/http://www.nulib.com/library/shrinkit.sdk - [[ ! -f shrinkit.sdk ]] && wget -qO shrinkit.sdk ivanx.com/a2cloud/files/shrinkit.sdk - nulib2 -xs shrinkit.sdk > /dev/null - acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT - | acmd -p "$a2CloudDisk" SHRINKIT SYS - acmd -g /tmp/a2cloud-install/SHRINKIT SHRINKIT.SYSTEM - | acmd -p "$a2CloudDisk" SHRINKIT.SYS SYS - acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.SHRINKIT - | acmd -p "$a2CloudDisk" IIPLUS.SHRINKIT SYS - acmd -g /tmp/a2cloud-install/SHRINKIT IIPLUS.UNSHRINK - | acmd -p "$a2CloudDisk" IIPLUS.UNSHRINK SYS - - # DSK2FILE - echo "A2CLOUD: Downloading and copying DSK2FILE..." - cd /tmp/a2cloud-install - wget -q -O dsk2file.shk http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip - nulib2 -p dsk2file.shk dsk2file58 | acmd -p "$a2CloudDisk" DSK2FILE SYS - - # Apple System Utilities 3.1 launch file - if [[ -f /usr/local/bin/unar ]]; then - echo "A2CLOUD: Copying System Utilities launch file..." - acmd -g A2SYSDISK32.PO SYSUTIL.SYSTEM - | acmd -p "$a2CloudDisk" SYSUTIL SYS - else - echo "A2CLOUD: unar is not available; not installing System Utilities." - fi - - # Filer - echo "A2CLOUD: Downloading and copying Filer..." - wget -qO /tmp/a2cloud-install/mmgr.prutil.sdk ftp://ftp.gno.org/pub/apple2/prodos/comm/term/modem.mgr/mmgr.prutil.sdk - cd /tmp/a2cloud-install - nulib2 -xs mmgr.prutil.sdk > /dev/null - acmd -g /tmp/a2cloud-install/MMGR FILER - | acmd -p "$a2CloudDisk" FILER SYS - - # ADTPRO launch - echo "A2CLOUD: Copying ADTPro launch file..." - acmd -g /usr/local/adtpro/disks/ADTPRO-*DSK ADTPRO - | acmd -p "$a2CloudDisk" ADTPRO SYS - - # VSDRIVE - if [[ ! $(acmd -ls "$a2CloudDisk" | grep '^VSDRIVE BIN') ]]; then - echo "A2CLOUD: Copying VSDRIVE..." - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE - | acmd -p "$a2CloudDisk" VSDRIVE SYS - acmd -g /usr/local/adtpro/disks/VDRIVE-*DSK VSDRIVE.LOW - | acmd -p "$a2CloudDisk" VSDRIVE.LOW BIN \$2000 - else - echo "A2CLOUD: VSDRIVE is already on the target disk image." - fi - - fi - - if [[ ! -f $a2CloudDisk140 || ( $(wc -c $a2CloudDisk140 | cut -f 1 -d ' ') != "143360" ) ]]; then - - echo "A2CLOUD: Creating 140K disk image..." - mkpo "$a2CloudDisk140" A2CLOUD - dd bs=256 count=1 of="$a2CloudDisk140" conv=notrunc 2> /dev/null < /usr/local/adtpro/disks/ADTPRO-*DSK - dd bs=256 count=1 of="$a2CloudDisk140" skip=14 seek=14 conv=notrunc 2> /dev/null < /usr/local/adtpro/disks/ADTPRO-*DSK - - acmd -g $a2CloudDisk BASIC.SYSTEM - | acmd -p $a2CloudDisk140 BASIC.SYSTEM SYS - acmd -g $a2CloudDisk PRODOS - | acmd -p $a2CloudDisk140 PRODOS SYS - acmd -g $a2CloudDisk STARTUP - | acmd -p $a2CloudDisk140 STARTUP BAS - acmd -g $a2CloudDisk ADTPRO.BIN - | acmd -p $a2CloudDisk140 ADTPRO.BIN BIN \$0800 - acmd -g $a2CloudDisk Z.LINK - | acmd -p $a2CloudDisk140 Z.LINK SYS - acmd -g $a2CloudDisk IIPLUS.SHRINKIT - | acmd -p $a2CloudDisk140 IIPLUS.SHRINKIT SYS - acmd -g $a2CloudDisk IIPLUS.UNSHRINK - | acmd -p $a2CloudDisk140 IIPLUS.UNSHRINK SYS - acmd -g $a2CloudDisk FILER - | acmd -p $a2CloudDisk140 FILER SYS - acmd -g $a2CloudDisk ADTPRO - | acmd -p $a2CloudDisk140 ADTPRO SYS - acmd -g $a2CloudDisk VSDRIVE - | acmd -p $a2CloudDisk140 VSDRIVE SYS - acmd -g $a2CloudDisk VSDRIVE.LOW - | acmd -p $a2CloudDisk140 VSDRIVE.LOW BIN \$2000 - - fi - - # A2PI - if [[ ! $(acmd -ls "$a2CloudDisk" | grep '^ A2PI BIN') ]]; then - echo "A2CLOUD: Downloading and copying A2PI client..." - mkdir -p /tmp/a2cloud-install/a2pi - cd /tmp/a2cloud-install/a2pi - wget -qO a2pi.deb http://schmenk.is-a-geek.com/tarfiles/a2pi_armhf.deb - # dpkg-deb --fsys-tarfile a2pi.deb | tar --strip-components=4 --wildcards -O -x ./usr/share/a2pi/A2PI*.PO > A2PI.PO - dpkg-deb --fsys-tarfile a2pi.deb | tar --strip-components=4 --wildcards -x ./usr/share/a2pi/A2PI*.PO - a2piImage=$(ls -1r A2PI*.PO | head -1) - mkdir a2pidisk - cppo -e "$a2piImage" a2pidisk &> /dev/null - mv a2pidisk/A2PI* a2pidisk/A2PI - cd a2pidisk/A2PI - rm PRODOS* *A3* BASIC.SYSTEM* - cd .. - nulib2 -a -r -e ../a2pi.shk A2PI &> /dev/null - cd .. - shk2image a2pi.shk $a2CloudDisk &> /dev/null - shk2image a2pi.shk $a2CloudDisk140 &> /dev/null - cd /tmp/a2cloud-install - rm -rf a2pi - else - echo "A2CLOUD: A2PI client is already on the target disk image." - fi - - if [[ -f /usr/local/adtpro/disks/Virtual.po && ! -L /usr/local/adtpro/disks/Virtual.po ]]; then - mv /usr/local/adtpro/disks/Virtual.po /usr/local/adtpro/disks/defaultVirtual.po &> /dev/null - vsd1 -f /usr/local/adtpro/disks/defaultVirtual.po - fi - if [[ -f /usr/local/adtpro/disks/Virtual2.po && ! -L /usr/local/adtpro/disks/Virtual2.po ]]; then - if [[ $(sha1sum /usr/local/adtpro/disks/Virtual2.po | cut -d ' ' -f 1) == "41c178f9f596f94ea7607624672552137dccade2" ]]; then - rm /usr/local/adtpro/disks/Virtual2.po - else - mv /usr/local/adtpro/disks/Virtual2.po /usr/local/adtpro/disks/defaultVirtual2.po &> /dev/null - fi - fi - vsd2 -f $a2CloudDisk - - # for compatibility with pre-1.6.7 - ln -s /usr/local/adtpro/disks/A2CLOUD.PO /usr/local/adtpro/disks/A2CLOUD.HDV - - echo - echo "Your A2CLOUD disk images are ready. They are called" - echo "A2CLOUD.DSK (140K) and A2CLOUD.PO (800K), and are stored in" - echo "/usr/local/adtpro/disks" - echo - echo "You can transfer to a floppy with ADTPro, or access" - echo "the 800K image with VSDRIVE at S2,D2." - echo - echo "See http://ivanx.com/a2cloud for more info." - echo - fi -fi - - - -# make new blank disk of specified size - -if [[ $newImageName ]]; then - echo "A2CLOUD: Creating new ${imageSize}K image for virtual drive 1 at" - echo " /usr/local/adtpro/disks/$newImageName..." - sudo pkill -f [A]DTPro - rm /usr/local/adtpro/disks/Virtual.po &> /dev/null - mkpo -b $(( $imageSize * 2 )) /usr/local/adtpro/disks/"$newImageName" $prodosVolName - vsd1 -f /usr/local/adtpro/disks/"$newImageName" -fi - -echo "wget -qO /tmp/a2cloud-setup ivanx.com/a2cloud/setup; source /tmp/a2cloud-setup" | sudo tee /usr/local/bin/a2cloud-setup > /dev/null -sudo chmod ugo+x /usr/local/bin/a2cloud-setup - -if [[ ! $restartPrompt ]]; then - adtpro-start 2> /dev/null #start ADTPro if not running and USB adapter attached -fi - -echo -echo "A2CLOUD is now ready!" -echo "See http://ivanx.com/a2cloud for instructions." - -sudo apt-get -y clean - -if [[ $restartPrompt ]]; then - echo - echo -n "Restart your $me now (not required, but recommended)? " - read - if [[ ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then - doRestart=1 - fi -fi - -cd "$origDir" -rm setup &> /dev/null -rm a2cloud-setup &> /dev/null -rm -rf /tmp/a2cloud-install &> /dev/null -if [[ -f /usr/local/bin/gsport || -f /usr/bin/gsport || -f /usr/local/bin/kegs ]]; then - sudo addgroup gsport &> /dev/null - sudo addgroup kegs &> /dev/null - sudo usermod -a -G audio,video,netdev,fuse,gsport,plugdev,kegs $USER &> /dev/null - [[ ! $noSetGroups ]] && { groups | grep -q 'kegs.*gsport\|gsport.*kegs' || exec sudo su -l $USER; } -fi -[[ $doRestart ]] && sudo shutdown -r now - -# version history: - -# future -- local links for everything -# email -# chromium - -# version history: - -# 1.8.1 -- set JAVA_HOME correctly for Java 8 (Pi, webupd8, Ubuntu for Pi 2B) -# A2PI 1.5 (PiDrive update) on A2CLOUD disk -# ADTPro 2.0.1 server, and 2.0.1 client on A2CLOUD disk - -# 1.8.0d-- √ creates shortcuts on desktop for GSport, KEGS, LinApple, ADTPro server on x86 -# √ adds LXTerminal to desktop for non-A2Pi version -# √ ProDOS instruction screen on GSOS install -# √ provide via downloaded program that is dd notrunc'd over PRODOS (instead of writeCharsHex) -# √ figure out why lines in autostart are supposed to start with @ (daemon; restarts command on crash) -# √ install AppleCommander-1.3.5.13id (so Spectrum installer will work) -# √ fix mouse not working in VirtualBox framebuffer -# √ requires uninstalling (or temporarily disabling, if possible) VirtualBox guest additions -# √ can be activated if vboxguest module is unloaded *while gsport is running* -# √ offer to uninstall vboxguestmodule if gsport is in run console -# √ rename slot6drive1 and 2 to not contain "-blank" in slot6.tgz and gsport and kegs (x86) archives -# √ add links browser -# √ fix webupd8team getting added twice to sources.list -# √ install GSport for non-Pi -# √ figure out how to replace Raspbian entry in OS json dynamically -# √ command "a2cloud-update rasppleii" to update raspple ii -# √ prevent samba update causing dialog to come up -# √ create rasppleii-update -# √ make rasppleii-update universal even for non-Raspple II installs -- it's just raspbian-update + a2cloud-update + a2server-update -# √ creates shortcuts on desktop for GSport, KEGS, LinApple, ADTPro server on Pi -# √ download gsport and kegs icons -# √ no longer opens terminal window (since icons exist) -# √ (remove /etc/xdg/autostart/lxterminal.desktop) -# √ create aliases for raspbian-update and rasppleii-update -# √ update A2CLOUD help file and aliases for GSport -# √ create raspbian-update -# √ update a2cloud-help -# √ update motd (vm, raspple ii/a2cloud-pi) for gsport -# √ see if shortcuts work in Raspple II 110 -# √ check for /etc/xdg/lxsession/LXDE-pi; if so: -# √ create ~/.config/menus/lxde-pi-applications.menu, with reference to /etc/xdg/menus/lxde-pi-applications.menu -# √ no xrandr VBOX0 on the Pi; remove it if present (a2cloud 1.7.x may have put it there) -# √ user groups for pi user not only apple2 -# √ gsport-setup and kegs post install text to say ctrl-F12 for reboot -# √ add "links" to motd and help -# √ put a -Xmx128m in acmd so gsport and kegs setup work on Pi A/A+ (256 MB) -# √ added 'disablesafemode' to NOOBS recovery.cmdline (also in raspbian-update) to make it work on (at least) my A+ -# √ option for GISK rather than clean setup for GSport on x86 -# √ provide actual command for clean GSOS + Spectrum install, which is what gsport runs if no HD available -# √ provide command for clean GSOS install for KEGS -# √ add Dave's preflight/postflight stuff (groups, ownership permissions) for gsport -# √ install libpcap0.8-dev as part of Apple II Pi, GSport install, and GSport launcher -# √ make kegs-setup -# √ make kegs splash text -# √ doesn't add VirtualBox 800x600 if installing on Pi -# √ stop xrandr from being added multiple times to autostart in VirtualBox -# √ only install vbox 800x600 if running in VirtualBox -# √ disable screen blanking in vbox console -# √ disable screensaver in vbox LXDE -# √ disable screen blanking in vbox LXDE -# √ don't create LXTerminal desktop shortcut if RPi -# √ -6 arg provides empty ProDOS disks in S6D1 and S6D2 to GSport to speed things up -# √ -6 arg provides empty ProDOS disks in S6D1 and S6D2 to KEGS to speed things up -# √ can test if password is "raspberry" or "apple2" and advise accordingly -# √ enable Uthernet by default in gsport-setup -# √ enable AppleTalk Turbo by default in gsport-setup -# √ make kegs run as root -# √ consolidate gsport-setup and kegs-setup -# √ gsport-setup is gsport, gsport-setup -k is kegs -# √ clean up KEGS/GSport installer sections to be consistent -# √ create kegs-setup placeholders that call gsport-setup -k -# √ gsport-setup only offer system disks/GSport if java/acmd are available -# √ suppress policykit error that appears after upgrade: -# √ http://www.raspberrypi.org/forums/viewtopic.php?t=98617 -# √ see if uninstalling vbox additions is really necessary (nope) - -# √ A2SERVER: creates symlink to /usr/local/etc/netatalk in /etc -# √ A2SERVER: -r no repo update option -# √ A2SERVER: can test if password is "raspberry" or "apple2" and advise accordingly -# √ A2SERVER: set AFP password to "apple2" -# √ A2SERVER: automated Windows Sharing install option -w -# √ A2SERVER: automate SMB password set -# √ A2SERVER: fix bug where turning off windows sharing then on again made it not restart at startup -# √ A2SERVER: turnkey (non-prompting) updater -# √ A2SERVER: show current and available versions on run -# √ A2SERVER: -v option to show version and exit -# √ A2SERVER: -h shows help -# √ A2SERVER: prefix status messages with A2SERVER: -# √ A2SERVER: fixed OS X connection problems by adding dhx2 uams files to rpi and x86 tarballs -# √ A2SERVER: set user password to "apple2" -# √ A2SERVER: support a2server-update rasppleii -# √ A2SERVER: automated netboot install option -b -# √ A2SERVER: deletes /tmp/a2server-packageReposUpdated at end -# √ A2SERVER: update help and aliases for raspbian-update -# √ A2SERVER: update a2server-setup rasppleii -# √ A2SERVER: add "a2server-update rasppleii" -# √ A2SERVER: disable screen blanking in Debian VM console -# √ A2SERVER: add raspbian-update and rasppleii-update - -# NOOBS: -# √ get photo B slide into all NOOBS slides (even non-a version) and also upload to online -# √ make NOOBS default to US keyboard (recovery.cmdline append lang=en keyboard=us) -# √ make NOOBS-lite 1.4.0+ that can install Raspple II from net, use for upgrade -# √ (change URL and default OS in noobs-master/recovery/config.h -# √ change "raspple" option to 'os' or '-os' -# √ remove silentinstall in raspbian-update -# √ add 'disablesafemode' to recovery.cmdline in Raspple II and Raspple II Lite - -# √ make raspbian-update NOOBS-aware, both for standard NOOBS and Raspple II - -# 1.7.2 -- manually triggers udev rules during startup if ttyusbhandler script didn't execute (which it doesn't in Raspbian 31-Jan-2015/Kernel 3.18) -# doesn't provide Java space warning if java is already installed -# A/A+ support (vsdrive on direct attach or hub port 3, console on hub port 2) - -# 1.7.1 -- full undoit (unblu/unexec/unbit/usq/sciibin) -# debian7_x86 and rpi binaries -# perl version for ttytter not hardcoded -# KEGS and LinApple support on debian_x86 -# kegs launch script creates additional symlink called ROM -# linapple launch script sets up framebuffer and udev mouse rule -# apt-get clean after all installs -# installer option to compile all rather than download binaries -# login message mentions A2SERVER if it is installed -# LXDE terminal window now in global autostart (opens for any user) -# LXDE desktop defaults to 800x600 if running in VirtualBox VM - -# 1.7.0 -- Java 8 - -# 1.6.9 -- ADTPro 2.0.0 -# new A2CLOUD disks with A2PI client 1.8 - -# 1.6.8 -- ADTPro 1.3.0 -# tests for adtpro existence with either adtpro.sh or ADTPro.html -# installs ttytter from its home page, not via apt-get (because it's in non-free, which is not enabled by default in debian) - -# 1.6.7 -- cppo installed from a2cloud directory on web server (a2server has symlink) -# fixed cppo -e bug that always created a resource fork file even if there is no resource fork -# shk2image leaves nothing behind in /tmp -# wildcard copy all files on A2PI disk except PRODOS/BASIC.SYSTEM/*A3* to A2CLOUD disks when building -# @ √ new A2CLOUD disks with A2PI client 1.4 -# % update before install for a2chat/a2news/kegs/kegs-setup/linapple/gsport/gsport-setup -# disables IPv6 for exim4 to properly prevent startup error messages; restores log folder if not there -# ^@ A2CLOUD.HDV is now A2CLOUD.PO (with symlink to A2CLOUD.HDV) -# √ renamed MACRO files on server to be .txt and moved to files -# ^@ √ new startup app on disk to make it easier to get to A2PI -# a2cloud-setup updates a2news/a2chat/kegs/kegs-setup/linapple wrappers -# added screen to a2cloud-help - -# 1.6.6 -- installs Screen -# installs curl if not installed (for ttytter) -# ttytter alias works correctly if run under Screen -# a2cloudrc is now downloaded rather than created by script -# LANG is now set in /usr/local/etc/a2cloud-lang rather than in a2cloudrc -# fixed bug which checked for nulib2 instead of unar when seeing if needing to compile -# opens terminal window in lxde on startup -# setup -v displays available and installed versions -# setup -y now bypasses all prompts; -n removed -# % setup exits properly whether run via source or shell -# moved cftp to files -# support for x86 Debian/Ubuntu: -# compiles binaries rather than downloads if not running on Pi -# gets and supports Oracle x86 Java if not on Pi -# installs X11 and LXDE if not installed -# ttyUSBupper is always ttyUSB0, ttyUSBlower is always ttyUSB1 -# adtpro.sh supports USB-to-serial on all architectures - -# 1.6.5 -- term command accepts mono/color/none as synonyms for vt100/pcansi/dumb -# minor reorganization of configuration of a2cloudrc and screenrc - -# 1.6.4 -- term command has -f argument to force action -# bash.bashrc now calls /usr/local/etc/a2cloudrc, which calls a2cloud-aliases -# support for screen command (preserves TERM environment variable in new screen) - -# 1.6.3 -- sets ttytter to use ssl, and also 7-bit on serial port login, and ansi -# if using TERM=pcansi. Also provides Term::ReadLine::TTYtter for -readline option -# revised command line options and prompt for installing all or selective -# added appleiipi-update command - -# 1.6.2 -- installs ISO-8859 (8-bit) character set for serial port login -# adds 'term' command for setting vt100 or ANSI emulation -# apt-get clean at end of A2CLOUD install -# installs sciibin and unblu -# a2cloud-update alias to a2cloud-setup -# 300 baud support by 'baud' -# prevents gsport (A2PI) from running when invoked from serial port -# cmd line option and prompt to install either all, or select individual -# revised intro language - -# 1.6.1 -- installs telnet and ttytter -# prevents exim4 error messages after Tin installation - -# 1.6.0 -- checks for ADTPro update -# updates ADTPro server and client software -# put adtpro version number into variable and removed hardcoding elsewhere -# asks for prodos volume name for new disk image; 8192 max -# fixed order of files on 140K disk to be consistent with 800K disk -# adtpro-start start now checks for USB adapter before starting -# restarts ADTPro server on vsd1/vsd2 after prompting -# created vsdsync alias to adtpro-restart; acmd warns if neeed -# acmd warns if vsd1/vsd2 changes, and advises vsdsync if so -# acmd now provides acmd help even on AppleCommander error - -# 1.6.0 beta - -#(unreleased) -# 1.5.3 -- gets motd from web -# prevents /var/log/exim4/paniclog from filling up -# sets password to apple2 -# shares /usr/local/adtpro/disks to AFP & SMB -# don't prompt for restart after install by default -# avahi-daemon installed -# backup server for shrinkit - -# 1.5.2 -- cleans up at end, downloads disks, full A2PI including extras, -# bug fixes, -h for options - -# 1.5.1 -- added dos2pro - -# 1.5 -- provides a2chat, a2news, kegs, linapple, a2pi - -# 1.23 -- support for new A2PI client - -# 1.22 -- downloads base gnustep library for unar/lsar, not full dev packages; -# will still download those and build if binary isn't available for some reason -# same goes for nulib2 and cftp. Should make for speedier install. -# adds A2PI client software to A2CLOUD disk -# disables console getty -# installs xrdp -# adds DSK2FILE to A2CLOUD disk - -# 1.7.2 -- manually triggers udev rules during startup if ttyusbhandler script didn't execute (which it doesn't in Raspbian 31-Jan-2015/Kernel 3.18) -# doesn't provide Java space warning if java is already installed -# A/A+ support (vsdrive on direct attach or hub port 3, console on hub port 2) - -# 1.7.1 -- full undoit (unblu/unexec/unbit/usq/sciibin) -# debian7_x86 and rpi binaries -# perl version for ttytter not hardcoded -# KEGS and LinApple support on debian_x86 -# kegs launch script creates additional symlink called ROM -# linapple launch script sets up framebuffer and udev mouse rule -# apt-get clean after all installs -# installer option to compile all rather than download binaries -# login message mentions A2SERVER if it is installed -# LXDE terminal window now in global autostart (opens for any user) -# LXDE desktop defaults to 800x600 if running in VirtualBox VM - -# 1.7.0 -- Java 8 - -# 1.6.9 -- ADTPro 2.0.0 -# new A2CLOUD disks with A2PI client 1.8 - -# 1.6.8 -- ADTPro 1.3.0 -# tests for adtpro existence with either adtpro.sh or ADTPro.html -# installs ttytter from its home page, not via apt-get (because it's in non-free, which is not enabled by default in debian) - -# 1.6.7 -- cppo installed from a2cloud directory on web server (a2server has symlink) -# fixed cppo -e bug that always created a resource fork file even if there is no resource fork -# shk2image leaves nothing behind in /tmp -# wildcard copy all files on A2PI disk except PRODOS/BASIC.SYSTEM/*A3* to A2CLOUD disks when building -# @ √ new A2CLOUD disks with A2PI client 1.4 -# % update before install for a2chat/a2news/kegs/kegs-setup/linapple/gsport/gsport-setup -# disables IPv6 for exim4 to properly prevent startup error messages; restores log folder if not there -# ^@ A2CLOUD.HDV is now A2CLOUD.PO (with symlink to A2CLOUD.HDV) -# √ renamed MACRO files on server to be .txt and moved to files -# ^@ √ new startup app on disk to make it easier to get to A2PI -# a2cloud-setup updates a2news/a2chat/kegs/kegs-setup/linapple wrappers -# added screen to a2cloud-help - -# 1.6.6 -- installs Screen -# installs curl if not installed (for ttytter) -# ttytter alias works correctly if run under Screen -# a2cloudrc is now downloaded rather than created by script -# LANG is now set in /usr/local/etc/a2cloud-lang rather than in a2cloudrc -# fixed bug which checked for nulib2 instead of unar when seeing if needing to compile -# opens terminal window in lxde on startup -# setup -v displays available and installed versions -# setup -y now bypasses all prompts; -n removed -# % setup exits properly whether run via source or shell -# moved cftp to files -# support for x86 Debian/Ubuntu: -# compiles binaries rather than downloads if not running on Pi -# gets and supports Oracle x86 Java if not on Pi -# installs X11 and LXDE if not installed -# ttyUSBupper is always ttyUSB0, ttyUSBlower is always ttyUSB1 -# adtpro.sh supports USB-to-serial on all architectures - -# 1.6.5 -- term command accepts mono/color/none as synonyms for vt100/pcansi/dumb -# minor reorganization of configuration of a2cloudrc and screenrc - -# 1.6.4 -- term command has -f argument to force action -# bash.bashrc now calls /usr/local/etc/a2cloudrc, which calls a2cloud-aliases -# support for screen command (preserves TERM environment variable in new screen) - -# 1.6.3 -- sets ttytter to use ssl, and also 7-bit on serial port login, and ansi -# if using TERM=pcansi. Also provides Term::ReadLine::TTYtter for -readline option -# revised command line options and prompt for installing all or selective -# added appleiipi-update command - -# 1.6.2 -- installs ISO-8859 (8-bit) character set for serial port login -# adds 'term' command for setting vt100 or ANSI emulation -# apt-get clean at end of A2CLOUD install -# installs sciibin and unblu -# a2cloud-update alias to a2cloud-setup -# 300 baud support by 'baud' -# prevents gsport (A2PI) from running when invoked from serial port -# cmd line option and prompt to install either all, or select individual -# revised intro language - -# 1.6.1 -- installs telnet and ttytter -# prevents exim4 error messages after Tin installation - -# 1.6.0 -- checks for ADTPro update -# updates ADTPro server and client software -# put adtpro version number into variable and removed hardcoding elsewhere -# asks for prodos volume name for new disk image; 8192 max -# fixed order of files on 140K disk to be consistent with 800K disk -# adtpro-start start now checks for USB adapter before starting -# restarts ADTPro server on vsd1/vsd2 after prompting -# created vsdsync alias to adtpro-restart; acmd warns if neeed -# acmd warns if vsd1/vsd2 changes, and advises vsdsync if so -# acmd now provides acmd help even on AppleCommander error - -# 1.6.0 beta - -#(unreleased) -# 1.5.3 -- gets motd from web -# prevents /var/log/exim4/paniclog from filling up -# sets password to apple2 -# shares /usr/local/adtpro/disks to AFP & SMB -# don't prompt for restart after install by default -# avahi-daemon installed -# backup server for shrinkit - -# 1.5.2 -- cleans up at end, downloads disks, full A2PI including extras, -# bug fixes, -h for options - -# 1.5.1 -- added dos2pro - -# 1.5 -- provides a2chat, a2news, kegs, linapple, a2pi - -# 1.23 -- support for new A2PI client - -# 1.22 -- downloads base gnustep library for unar/lsar, not full dev packages; -# will still download those and build if binary isn't available for some reason -# same goes for nulib2 and cftp. Should make for speedier install. -# adds A2PI client software to A2CLOUD disk -# disables console getty -# installs xrdp -# adds DSK2FILE to A2CLOUD disk diff --git a/docs/ivanx/setup/vsd.txt b/docs/ivanx/setup/vsd.txt deleted file mode 100644 index 1fff799..0000000 --- a/docs/ivanx/setup/vsd.txt +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -skipWarning= -drive= -if [[ $1 == "-1" || $1 == "-d1" ]]; then - shift -elif [[ $1 = "-2" || $1 == "-d2" ]]; then - drive=2 - shift -fi -if [[ ! $1 ]]; then - echo "virtual drive $(( drive ? 2 : 1 )): $(readlink /usr/local/adtpro/disks/Virtual${drive}.po)" -else - if [[ $1 == "-f" ]]; then - shift - skipWarning=1 - fi - if [[ ! -f $1 ]]; then - echo "Image file '$1' was not found." - elif [[ -f /usr/local/adtpro/disks/Virtual${drive}.po && ! -L /usr/local/adtpro/disks/Virtual${drive}.po ]]; then - echo "/usr/local/adtpro/disks/Virtual${drive}.po is an actual disk image" - echo "file, not a symbolic link. Please move or rename it, and try again." - else - rm /usr/local/adtpro/disks/Virtual${drive}.po &>/dev/null; - [[ ${1:0:1} != "/" ]] && pwd="$PWD/"; - ln -s "$pwd$1" /usr/local/adtpro/disks/Virtual${drive}.po - [[ $drive ]] && VSD2="$pwd$1" || VSD1="$pwd$1" - if [[ $(ps aux | grep [A]DTPro) ]]; then - if [[ ! $skipWarning ]]; then - echo "Please make sure you're not writing to either virtual drive on your Apple II." - echo -n " Press return when ready, or control-C to cancel..." - read - fi - sudo pkill -f [A]DTPro - while [[ $(ps aux | grep [A]DTPro) ]]; do sleep 1; done - /usr/local/bin/adtpro-start - fi - fi -fi - -unset drive -unset pwd