This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ASG 7.502 on Toshiba Magnia SG30

I know, I know, this little box hasn't seen any love here in quite a few years, 3 since the last post about a SG20 as far as I saw in my searches.

That being said, it's still a perfect box for running ASG and replacing a standard router for a little more speed and control.  I actually have a couple of these servers and wanted to re-purpose them from their original Red-Hat installs.  For those not familiar with the box, it's a small headless server that was made for SOHO environments as a "all in one" box.  The headless part makes installing an OS on it challenging, and more so because I do not have the 8 pin serial cable for it's console access.

I took a look at shorewall on an Ubuntu 9.10 install and IPCop that was tailored for the SG series and wasn't super impressed with either.  Came across ASG and decided to take a deeper look into what was needed to get it working on my SG30.  Turns out, not much at all needs to be done...

The original install was done on a netbook using a USB to IDE adapter and a USB cd-rom, tried to keep it generic and simple so I wouldn't have any problems.  After I installed it, it took a little tweak in one file to make it boot & become accessible from the WebGUI:

/etc/modules.conf (Modified):

alias eth0 8139too
alias eth1 e100


This was added so that the shutdown command actually powers the box off completely;

/etc/rc.d/rc0.d/S10halt (Modified): (Lines besides those between double remarks are for finding location of addition)
fi


##Added for Toshiba SG LCD panel shutdown
echo -e "\033X"  > /dev/ttyS0
echo -ne "\033"  > /dev/ttyS0
echo -ne "8q"  > /dev/ttyS0
##End of add for Toshiba SG LCD
exec /sbin/halt -i -d -p -f >/dev/null 2>&1 &

# for more safety:
exit 1


Then to keep the LCD clean, I created the following files;

/etc/rc.d/sglcd_startup (Added): (Symbolic link from /etc/rc.d/rc3.d/S00sglcd_startup)
echo -ne "\033X" > /dev/ttyS0

echo -n "   Booting...   " > /dev/ttyS0


/etc/rc.d/sglcd_booted (Added): (Symbolic link from /etc/rc.d/rc3.d/S99sglcd_booted)
sleep 20

echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0
sleep 5
echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0
sleep 5
echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0
sleep 5
echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0
sleep 5
echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0
sleep 20
echo -ne "\033X" > /dev/ttyS0
echo -n "Astaro  Home Use" > /dev/ttyS0
echo -ne "\nSecurity Gateway" > /dev/ttyS0


/etc/rc.d/sglcd_shutdown (Added): (Symbolic link from /etc/rc.d/rc0.d/S00sglcd_shutdown)
echo -ne "\033X" > /dev/ttyS0

echo -ne "Shutting Down...\n" > /dev/ttyS0


/etc/rc.d/sglcd_restart (Added): (Symbolic link from /etc/rc.d/rc6.d/S00sglcd_restart)
echo -ne "\033X" > /dev/ttyS0

echo -n "  Restarting... " > /dev/ttyS0


The "booted" script has a few sleep commands and then sends the same info to the LCD panel a few times.  Reason for this in the booting process it looks like a program is probing the serial ports and it causes strings of junk to appear.  With the sleep commands, you will get some junk, but it will be gone in a few seconds.  Otherwise these are just for aesthetics only, this way I can at least visibly see when it's booting, restarting, or powering off.

One other thing I did do was modify the menu.lst file for startup so that the console will be redirected to the back serial port. (Just in case I do ever order up the cable or if others need it) Here's the changes I made to it:
# To enable serial console please uncomment the following two lines.

# You may also want to add a line like 'console=ttyS0,38400' to the
# 'kernel' lines below
serial --unit=1 --speed=115200
terminal --timeout=0 serial

title  Astaro Security Gateway V7
root (hd0,0)
kernel /boot/vmlinuz root=/dev/disk/by-label/root vga=normal video=ofonly nosmp noapic acpi=off splash=silent console=ttyS1,115200
initrd /boot/initrd

title  Astaro Security Gateway V7 (previous)
root (hd0,0)
kernel /boot/vmlinuz.previous root=/dev/disk/by-label/root vga=normal video=ofonly nosmp noapic acpi=off splash=silent console=ttyS1,115200
initrd /boot/initrd.previous

title  Astaro Security Gateway V7 (rescue)
root (hd0,0)
kernel /boot/vmlinuz root=/dev/disk/by-label/root vga=normal video=ofonly nosmp nolapic noapic acpi=off splash=silent console=ttyS1,115200
initrd /boot/initrd


To make sure I have an easy way to recover this system I made a disk image of it using dd.  The image is only 1.4GB and restores to the HDD quickly, also if others would like to load it on their SG30, it has minimal modifications to the original install and shouldn't cause a problem with updates and such. Also, the  In the future I'll probably be tweaking the LCD files and possibly adding some backup routines for mirroring the HDD.

I would be willing to share my HDD image with anyone here that would like it, but I won't post any links in here unless the moderators and such around here give me the green flag to do so.  The image itself is of the system IMMEDIATELY after the initial install and before the system has rebooted after that.  I basically found the files I needed to change, did another fresh install and modified the files I listed above to have a good baseline to work from. Basically as it would have been installed locally on the machine instead of a netbook, with as little modifications as possible to have a clean appearing machine.

So mods, is it a violation of any rules to share such an image?  Just want to make sure...

Also of note, the system is nice and responsive, and although I haven't loaded it yet and am still getting familiar with everything, I think it will be just fine for my 30MB cable connection.  Idle CPU is around 2-4% and uses 50-60% of memory after bootup, not too bad.  I did install the 7.503 and the 7.504 updates with no troubles, took less then 5 minutes to install and start the reboot for 7.504.  

Anyone else still using these things? [:$]

Ohhh, and this is my first post.. Be gentle... [:D]


This thread was automatically locked due to age.
  • SG20 does not have a serial port. The guy from wildsong.biz says how he set up a serial on it his SG20.

    But no, I never used Astaro not even sure what it is. My Linux is fairly limited and about 5 years forgotten. Setting up the SG20 with the Ubuntu 10.04 taught me alot and I am currently upgrading the other SG20 from 7.04 to 7.10 which worked, but now going to 8.04. The only thing is the LCD works really good on the currently 7.10 version and I don't want to loose it. The 10.04 is pretty limited. I am using the 10.04 for a file server and the 7.10 for more of a backup web server right now. Thought about downloading your Ubuntu 9.10 on that link you gave me, but not sure. I might, if you don't mind, if I can not get this 7.10 to 8.04 upgrade to work. Does your LCD panel work pretty good?
  • Yup! My LCD panel works pretty well.  I've just used the old lcd binaries included from a SG30 image and supplanted the rest of it with some fancy echo commands in startup scripts.  The startup and shutdown work just fine though you might need to modify the pre-canned scripts for them.

    Pretty sure if you look at the 3.0.1 rpms on that media share site you can find the LCD software and I'm thinking they'd work fine with the SG20 lcd as well.  If not, I might be able to scrounge up the SG20 lcd files, let me know.

    And feel free to download anything you want from there! I put it up so there'd be *some* site left out there with SG files! [:)]
  • Awesome!

    I will download your version and check it out! If it will go on a 20GB HDD.
    I have a few things for the SG20 on my site:
    HTTP at mytinytown.com The Ubuntu 10.04 is about 6.7 GB so I can not host it, the updated 7.10 is 6GB right now (I just realized I had a few GBs of programs left on it this whoel time. I will clean it off and make a new backup) so I can not host it either. Both the above version work really nice, web servers, files servers, MySQL, Webmin, of course, no GUI. The LCD files were found on the SG20 group on Yahoo and built this way.
    Magnia LCD - Wildsong Wiki

    There is 1 other site with SG files, but the TIB image is corrupt and his mail form does not work.

    What program did you use to make the disk image?
  • So it's been a while since I've posted in here!!!  I started a project recently on the old SG30, namely updating it to ASG 8.1 as well as moving over to a compact flash drive for my boot device. (Simple CF to IDE adapter)

    Well, the CF is another story and I think I got a bad CF card itself.  It refeuses to partition or anything on any of my systems.   Also does a lot of other strange stuff but that's a post for a different thread when I'm not crabby about it. [:)]

    In short I took a different route when developing this install.  I thought it may be helpful for more people if I didn't provided a pre-canned disk image.  This time I decided to modify the installer CD directly.  I used "asg-8.102-2.1.iso" for my base and modified it to work with a headless system over the serial port.

    After a few bumps I think I've got it all worked out!  Everything gets redirected to the serial port and the boot up screens are modified to show which keys to use for the F1 and F4 stuff at boot.  Once I used a normal HDD it took right off and did it's thing.

    There were a number of changes I did so I'll be making a new thread for the details on what was needed.  Once I get it done I think I'll just add it to the previous share.  This time it should be MUCH easier for people to use it as long as they have a null modem cable for it and a USB cd-rom.  It even pulled my old config right from a USB flash drive as it was supposed to do after the first boot!

    And for what it's worth, performance on it seems to be quite good.  Mine has 1GB of ram in it, and I've never seen it use swap space on v7 so this will be a good test on those minimum specs... (I know they say a 1.5ghz CPU is recommended but 1.2ghz isn't too far off the mark)

    Anyone here still looking for a use for one of these boxes??? [:D]
  • Hi, fwiw an SSD should be MUCH more stable than a CF card.

    Barry
  • Would love to do a SSD!  Problem is that this thing only has IDE on it and the SSD option is about $100 vs about $35 for the CF setup...  For such an old box I'd hate to be dumping much more $$ into it.  I'm going to keep the logging levels down and the stored data to a minimum.  Also, it's currently on the normal 40GB HDD so I'll have something to compare it to when I get it all figured out.

    I used to have a random error with ASG v7 that would cause me to get journal errors on the console after running for a few weeks.  I thought it was the HDD going bad, but it does it with 3 that I know are good.  I'm thinking it was a remanant from doing the install on my netbook previously.  That's why I wanted to do just a cd-rom modification this time, I'll know the system hardware was detected correctly.

  • Anyone here still looking for a use for one of these boxes??? [:D]


    How much are you wanting?
  • So it's been a while since I've posted in here!!!  I started a project recently on the old SG30, namely updating it to ASG 8.1 as well as moving over to a compact flash drive for my boot device. (Simple CF to IDE adapter)

    Well, the CF is another story and I think I got a bad CF card itself.  It refeuses to partition or anything on any of my systems.   Also does a lot of other strange stuff but that's a post for a different thread when I'm not crabby about it. [:)]

    In short I took a different route when developing this install.  I thought it may be helpful for more people if I didn't provided a pre-canned disk image.  This time I decided to modify the installer CD directly.  I used "asg-8.102-2.1.iso" for my base and modified it to work with a headless system over the serial port.

    After a few bumps I think I've got it all worked out!  Everything gets redirected to the serial port and the boot up screens are modified to show which keys to use for the F1 and F4 stuff at boot.  Once I used a normal HDD it took right off and did it's thing.

    There were a number of changes I did so I'll be making a new thread for the details on what was needed.  Once I get it done I think I'll just add it to the previous share.  This time it should be MUCH easier for people to use it as long as they have a null modem cable for it and a USB cd-rom.  It even pulled my old config right from a USB flash drive as it was supposed to do after the first boot!

    And for what it's worth, performance on it seems to be quite good.  Mine has 1GB of ram in it, and I've never seen it use swap space on v7 so this will be a good test on those minimum specs... (I know they say a 1.5ghz CPU is recommended but 1.2ghz isn't too far off the mark)

    Anyone here still looking for a use for one of these boxes??? [:D]


    heck ya man....you got an image i can try?..  Got some documentaiton as to how to make it work?

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • Heh, almost done with a completely modified CD to load onto a SG30.  The disc will work through the serial console 100% and after installation it automatically installs the required files for the LCD to work properly.  It's been a bit of work, but this will make restoring from a backup a much less daunting task in the future.

    I'll post more later tonight!
  • How much are you wanting?


    Well, more so I was looking to gauge interest in those that had these lying around.  As an older box it's a great utility to me as a nice firewall but little use in any task that requires a good amount of horsepower.  I have a feeling that this box would do far worse if it didn't have NICs with decent linux support.  Honestly I'd probably feel bad taking $$ for it.. [:D]  If you have a dead one though, I do have a second for parts, it does some odd things with its IDE interface at times.  (Might be a good candidate to see how an OS would run on it over a USB adapter)



    And on to a little sneak peek into what the CD will do and entail. (I'll make a new thread when done and will probably cut and paste a lot of this over there)

    It will be a completely contained installer based off the asg-8.102-2.1.iso with some modifications to make it usable on the SG30.  Namely the syslinux boot loader has been modified to work with a serial console.  (All console communications are at 115200,8,N,1) 

    There are also several other modifications of the CD boot process that allow the installer to work over a serial redirected console.  In the middle of the boot process before the installer starts it actually drops you to a bash prompt so you can make any modifications you'd like before launching the installer.  

    Someone posted how to make a bootable flash drive to install astaro from. I gave it a quick shot and didn't have much success with it on the SG30.  It does support the boot from it so I'd guess with a little work it could be done.  People may want to try and monkey with this, so the shell will allow you to get around the following restriction...

    In the installer on a regular console you can switch between virtual terminals for the log and a shell prompt,  the modifications I made render those screens unusable.  By dropping to the shell prompt it will allow users to copy those files and others to make any other changes before going into the installer.  If you have no modifications to make or are ready to launch the installer you simply type "exit" to continue. (This is all displayed to the user at install time as well)

    Support for the ethernet devices is already baked in but needed some modules loaded for them.  Otherwise the rest of the hardware works out of the box with no modifications.

    After it's installed on first boot I've inserted a script that will setup the rest of the system.  The S00sglcd.boot file is responsible for setting the system up and displaying the boot message on the LCD screen at startup.  It extracts a tar archive to /sa2 on the file system.  Inside that folder are a few LCD files and also a RPM that needs to be installed for the LCD to work.  Inside that folder are also numerous LCD related start up scripts that get copied and linked in /etc/init.d.  

    Basically at boot it quickly checks for 3 files on the system and if they're not there, it performs the needed action to install it.  It does this at each boot so if Astaro makes changes to that portion of the system, it should be able to recover itself after a reboot.

    The included files and extras take up about 1.6MB on the hard drive so space shouldn't be an issue.

    After your booted up you'll notice the LCD displaying the time and date, you can also press the soft button to get a switch view showing active ports on the back panel.  The power button is also functional and will power the system off safely.  When a power off is requested from the web admin portal it will send the needed commands to the LCD controller to power the box off as well.  The LCD will show things like restarting and shutdown sequences, nothing crazy but it's not just sitting there displaying "BIOS POST!" the whole time.

    Some of the boot process and LCD usage is logged, the front power button being a notable one.  When a shutdown is initiated from the panel it places an entry in the Device Agent log.  (Accessible from web admin)  Also a few other things are logged there at startup, basically what the scripts see as the system comes to life.  Previously with v7 the NICs took forever to come to life and there is a portion that confirms connectivity before bringing the LCD to life.  On top of that astaro's LCD probe threw garbage on the LCD display and hung the LCD app from Toshiba.  Mostly this is just a "wait" state in the startup script to make sure the NICs are alive before reporting on the LCD that the system is "up."

    Here's a sample of what makes it into the log: (With some info removed obviously)

    Installing Toshiba Magnia LCD support files...
    sa2/
    sa2/conf/
    sa2/bin/
    sa2/triggers/
    sa2/conf/lcdkbd/
    sa2/triggers/shutdown/
    sa2/conf/lcdkbd.conf
    sa2/bin/setlcd
    sa2/bin/setlcdq
    sa2/bin/isclrpasswd
    sa2/bin/lcdkbd
    sa2/triggers/shutdown/10lcdkbd
    sa2/rpms/
    sa2/rpms/compat-libstdc++-7.3-2.96.110.i386.rpm
    sa2/rpms/lcdkbdMW-2.4.2-1.i386.rpm
    sa2/init_d-script-backups/
    sa2/conf/lcdkbd/000lcdkbd.lcd
    sa2/conf/lcdkbd/mezzanine.lcd
    sa2/conf/lcdkbd/tst.lcd
    sa2/sg20_customization.pdf
    sa2/bin/shutdown
    sa2/init_d-script-backups/sglcd_shutdown
    sa2/init_d-script-backups/sglcd_restart
    sa2/init_d-script-backups/sglcd_poweroff
    sa2/init_d-script-backups/sglcd_booted
    sa2/init_d-script-backups/S00boot.sglcd
    sa2/init_d-script-backups/sglcd_startup

    Installing Toshiba Magnia RPMs... (For LCD support)
    Preparing...                ##################################################
    compat-libstdc++            ##################################################

    --Loading Toshiba Magnia SG processes at at Wed Mar 16 00:14:35 CDT 2011--

    eth devices not up count 1 at Wed Mar 16 00:14:35 CDT 2011
    eth devices not up count 2 at Wed Mar 16 00:14:36 CDT 2011
    eth devices not up count 3 at Wed Mar 16 00:14:37 CDT 2011
    eth devices not up count 4 at Wed Mar 16 00:14:38 CDT 2011
    eth devices not up count 5 at Wed Mar 16 00:14:39 CDT 2011
    eth devices not up count 6 at Wed Mar 16 00:14:40 CDT 2011
    eth devices not up count 7 at Wed Mar 16 00:14:41 CDT 2011
    eth devices not up count 8 at Wed Mar 16 00:14:42 CDT 2011
    eth devices not up count 9 at Wed Mar 16 00:14:43 CDT 2011
    eth devices not up count 10 at Wed Mar 16 00:14:44 CDT 2011
    eth devices not up count 11 at Wed Mar 16 00:14:45 CDT 2011
    eth devices up at Wed Mar 16 00:14:46 CDT 2011

    eth0      Link encap:Ethernet  HWaddr 00:10:C6:XX:XX:XX
              inet addr:X.X.X.X  Bcast:X.X.X.X  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:76 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:7907 (7.7 Kb)  TX bytes:7657 (7.4 Kb)
              Interrupt:7 Base address:0x2f00

    eth1      Link encap:Ethernet  HWaddr 00:10:C6:XX:XX:XX
              inet addr:X.X.X.X  Bcast:255.255.255.255  Mask:255.255.252.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:318 errors:0 dropped:0 overruns:0 frame:0
              TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:21041 (20.5 Kb)  TX bytes:915 (915.0 b)

    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:507 errors:0 dropped:0 overruns:0 frame:0
              TX packets:507 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:141241 (137.9 Kb)  TX bytes:141241 (137.9 Kb)


    IPs to be pinged: 
    X.X.X.X
    X.X.X.X


    PING X.X.X.X (X.X.X.X) 56(84) bytes of data.
    64 bytes from X.X.X.X: icmp_seq=1 ttl=64 time=0.194 ms

    --- X.X.X.X ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.194/0.194/0.194/0.000 ms
    Host 10.0.10.253 results - Dead: 0, Check Count: 1


    Booting lcdkbd (Toshiba LCD application) now at Wed Mar 16 00:15:13 CDT 2011


    --All Toshiba Magnia SG processes loaded at Wed Mar 16 00:15:17 CDT 2011--



    Well, that all started as a sneak peek but got pretty long! [:)]   To install it you'll need a USB cd-rom and a serial cable to bring up a console with.  I used this one: For only $1.74 each when QTY 50+ purchased - 6ft MDIN8M/DB25M Cable for Mac+/Modem - Beige | Apple Cables with a null modem cable between it and my computer, works great! 
    If you have console redirection turned off, I've gotten into the bios on this before by pulling it apart and running it outside the case with the hard drive daughter-board  removed.  This let me plug a PS2 keyboard and a PCI video card into it and change boot settings.  Kinda extreme, but I like to tinker and it comes apart easily.  It might be on by default as well if you do a cmos reset on it, not sure on this.

    From cold boot to a login prompt on the serial shell is a little over 2 minutes.  After the shell is alive the NICs are fully alive about 30 seconds later.  After 4 minutes or so the system is settled in and below 20% CPU usage.  Times might vary here but they should stay under 5 minutes easily.  30 seconds of delay are from BIOS post, and I could probably take out 10 seconds of waits in my scripts, but overall I think 4 minutes to usable isn't bad.

    Would love to make this installable without the serial cable!  But for an automated install I'd need an oem.data hash... [H]