Install Stage 2 Nowadays 2012

From KiSS DP 558 STAGE2 WiKi
Jump to: navigation, search

Installing Stage2 nowadays (summer 2012)

Like I said before, I had never gotten around to installing Stage2 before, and doing so now turned out be a lot trickier than I thought it would be. Back in the old days, it may have been super easy. But now it seems the installation program is no longer capable of downloading files from Internet the way it automatically did before. The files are still there, on a Google site, but I am guessing the way Google hosts and delivers those files has changed to the point that the downloading software cannot handle it any more. And now that MartinB has apparently moved on to other things, I am not sure much maintenance is done to Stage2.

Blueyed1, here on MPC Club, got me on the right track, but it seems the download problems got even worse since he went through his installation. Or else my machine is just uniquely weird. In his case, only some files weren't downloaded, whereas, from what I can tell, no files at all were downloaded when I installed. (Already for the down2f.init script, I got a wget error message about the https url given by Google not being an http or ftp url.) Also, I wonder if he may have confused his scripts in his recount of how he solved it. He speaks of rerunning /bin/setup.init and I did that (with no success) until I took a look at what it contains: As the very first thing it erases your stage2 directory and everything in it (ouch). And the download problems don't occur until the very last thing of that script anyway, which is the call of another script. No, the script to run is clearly that second one: /hdd/stage2/down2f.init, only.


Here are the steps I eventually took to finish my installation of Stage2:

Step 1 (download iso)

First download Stage2, of course, and burn it on a CD (low speed). I went with the old and tried (1.1.7 based) "revision F". Though, if you are more adventurous, you might perhaps try a more recent (1.1.8 based) revision H (suggested by jebiveter).

Step 2 (download remaining stage 2 files)

You also need to manually download (into some convenient directory on your PC) all the files that the installation program will try, but miserably fail, to download. You can find them here. The ones you need are:

  • down2f.init - the script to do downloading and unpacking (or down2h.init for revision H).
  • All the tar files with names beginning with 'f' (or the ones beginning with 'h' for revision H).
  • stage2.ver perhaps.
  • initstage2f (or initstage2h for revision H) - the final version of the script that will be run every reboot. (You will, before any files have been downloaded, find a bare bones version of it - copied into the stage2 directory by the primary installation script setup.init - but this is only meant as a fallback.)

Note: initstage2f isn't visible in the file list, but it's available anyway from here!

Step 3 (edit the downloading & unpacking script file)

Now edit the downloading & unpacking script file, down2f.init (or down2h.init). If you are on Windows, don't use Notepad for this. Use something like Notepad++ allowing you to load and save Unix/Linux style text files. (On Linux, you can use any editor, of course.) Search for the few lines with "wget" in them and comment out those lines by preceding them with a '#' (or just delete them). Otherwise, if the script tries and fails to download a file (that you will have already provided by FTP), this file can be reset to zero contents. (At least that's what happened to me when wget complained about the url's.)

Step 4 (Start the installation)

Start the installation. (Put your Stage2 CD in your machine and reboot.) I chose partial upgrade to keep configuration settings. When it comes time to download stuff, the installation will grind to a halt. (There will probably be some error message on the LCD display.) At this point, reboot your DP-558 again, keeping the stop button on the machine pressed (for fail safe mode).

Step 5 (turn off FTP (and PCLINK))

If you hadn't before, turn off FTP (and PCLINK) in your KiSS setup menu. FTP should be available anyway thanks to the ftpd daemon that comes with Stage2 and is started within the initstage2f script each reboot. (Also note the IP of your KiSS machine, if don't already know it.) Now fire up your FTP client on your PC, connect to your DP-558, and copy all the files mentioned above into the stage2 directory there.

Step 6 (make initfile executable and execute

Open a command line window on your PC and give the command "telnet 192.168.0.xxx", where "192.168.0.xxx" is the IP of your DP-558. (I have it set to 192.168.0.200.) This should connect to your DP-558 and allow you to execute GNU/Linux commands there almost as on your own Linux PC. (This should work whether your PC is actually running Windows or Linux.)

First issue the command:

   chmod 777 /hdd/stage2/down2f.init

This will set the script file to be executable.

Then simply:

   /hdd/stage2/down2f.init

Step 8 (Watch for any errors)

Watch for any errors (in the command line window of your PC) and if there are any, try fixing them.
For f_libs.tar, I got "tar: Invalid gzip magic" and, sure enough, the contents of that tar file hadn't been unpacked. As it turns out, that file was only tarred but not gzipped (i.e. uncompressed; something must have gone wrong during late maintenance of that file), so while the installation script wouldn't touch it, it was still quite possible to unpack on my PC. What I did was just to copy the unpacked files via FTP from my PC to the lib/modules/2.4.17-uc0 directory under stage2.


After this, you should have a fully working Stage2 installation.


Once Stage2 is installed, all you need to do for the purpose of solving the problem of this thread, is, as specified by awi, to create a text file called hosts with the following contents (again, don't use Windows Notepad for this):

Code:

   xxx.xxx.xxx.xxx epg.kml.kiss-technology.com
   127.0.0.1 localhost

(where xxx.xxx.xxx.xxx is the local IP of the PC where you will be running Apache - or, once TinyStocks has added support on their site, the IP of TinyStocks, which I believe is 62.59.252.136.)

awl suggests placing this file directly in the /hdd directory, which is the "root" directory of what is shown in an FTP client connected to your DP-558. (I.e. outside all folders there.)

Then add a line at the end of the initstage2f script:

Code:

   /bin/cp /hdd/hosts /tmp

This will, on each reboot, copy the file hosts from the /hdd directory to /tmp, and, since there is already a symlink from /etc/hosts to /tmp/hosts, the system will then find your hosts file at /etc/hosts, the normal Unix/Linux location for this file.

Reboot.


Edit: Now that Cisco apparently will allow TinyStocks to use the epg.kml.kiss-technology.com domain, awi's fix may not be needed anymore, but I think it's still comforting to know we have this option, just in case.

Edit: Added link to download of the final initstage2f script, which will make the Stage2 web console work just fine.