Live / EmbeddednessForum: DSL Ideas and Suggestions Topic: Live / Embeddedness started by: Fordi Posted by Fordi on Dec. 23 2004,00:22
Ok, I've been experimenting again.I think it may be possible, with a small patch to linuxrc, to have a live/embedded CD. QEMU appears to have the ability to have a kernel and initrd start at boot. I've tested this successfully, and it appears to start, but can't find the CD. That's fine. If mounted into QEMU with "-hda path/to/KNOPPIX", it is available. The only thing missing is a hack to linuxrc to check if /dev/hda *IS* in fact our KNOPPIX image, and mount it. This should probably be done first ("insmod modules/cloop.o file=/dev/hda" will fail if /dev/hda isn't a cloop image), checked and if working, mounted as /cdrom. Think about it... pop in a DSL disc and have DSL running inside windows without reboot (and able to access the remote computer.. in fact, using the -append parameter, you could pass the host ip to linuxrc, which could in turn add it to the hosts file as systemhost). Pop in the SAME disc and reboot, and DSL runs all the faster! Add to that that the USB and USB-Embedded images could be merged, and you've got a pretty nice idea, don't you think? Posted by Fordi on Dec. 23 2004,00:24
Why I haven't done this already and am posting with an idea rather than a new copy of linuxrc:Shell scripting, as I've said before, is not my forte. linuxrc scares me, to be honest. I'm getting better, good enough to modify things like mountci, but not THAT much better. Posted by cbagger01 on Dec. 23 2004,01:34
I agree.It's a great idea. I had been thinking about an "embedded" CD-R disk, but I never thought about an embedded/livecd combo. The "append" idea is also cool. It allows the user to access the host machine without knowing the raw ip address. I suppose if you want to take things a step further, you could provide both the ipaddress AND the true hostname of your systemhost computer and the user could talk to it by name. Posted by Fordi on Dec. 23 2004,03:53
Just a note:For space's sake, use upx to compress the QEMU binary; it's small, yeah, but smaller is better, and uncompressed data on the base CD == 2x data within KNOPPIX Posted by Fordi on Dec. 23 2004,04:54
I know I said I wasn't doing this, but I figured I'd go in and trudge about with my so-far-limited shell scripting knowledge, and here's the results.Inserted at line 528 of linuxrc from dsl 0.9.1:
This will, after checking EVERYTHING else, try loading from /dev/hda, thus assuming that you're booting from QEMU. And, yes, I've tested it. And yes, it does boot. All three (Embedded under linux, embedded under windows, and naitive as a liveCD) ways. Go me. ^_^ OH! the qemu stuff. starting from ~/dsldisc/ as root (mounted from the test iso), the tree and QEMU commands:
Please note that both qemu binaries have been compressed with upx --best Couldn't tell you why the windows version is smaller, but bonus on that. Still, the resulting CD is 51.172M in size. Hope y'all can fix that with a remaster. I'm not so inclined at the moment, as I've got a bunch of shiny new 3" CDs. Meanwhile, test it out for yourself. It'll be fun! Posted by cbagger01 on Dec. 23 2004,06:06
Excellent Job!If you can afford the bw, it would be a nice download from your existing myDSL web site. Maybe if the linux Qemu stuff was removed, it would fit on some 50MB business card CD-R disks. For me, the Win32 qemu is more useful (and smaller too!) because I am more likely to encounter a Winbox that can't/won't boot livecd or is cumbersome to leave the native OS for a quick task. If the chosen computer is already running Linux, chances are that the computer is already useful as-is and I would only need DSL as a "personal desktop" and USB drive is more useful than livecd for that purpose. Just a thought. Posted by Fordi on Dec. 23 2004,16:18
The DSL 0.9.1 embedded/live combination cd is now available on my site: < http://www.nolifeline.com/dsl-0.9.1-em.iso >I hunted around and found the smallest builds of qemu.exe and SDL.dll. They've been compressed with upx --best. I removed the linux embedded bit and merged qemu.bat into autorun.inf. In order to save space, I also removed index.html and swapped the old logo.16 in (I'm sorry. It was pretty, but it took space I needed.) I also ditched lost+found, as I can't see how it could possibly be used. I moved boot/isolinux/* to isolinux/* - a paltry 4k savings, but every byte counts at this point (If this is to be used by the DSL team in an offical capacity, I'd like to make it easy as possible to squeeze the remaster down. 68k is a hell of a lot easier than 1.7M).
All the files necessary to perform the embed mod are avaiable < here >. All you have to do is extract it to it's own folder, put the isolinux stuff and KNOPPIX in the right place (omitting minirt24.gz, which is already there), and build the disc. Posted by Fordi on Dec. 23 2004,20:27
Ok, one more time.embed-mods.tar.gz and dsl-0.9.1-em.iso have been changed. The iso now again contains the index.html; I didn't realize that removing it would be GPL violation (removal of the author ident... hehe.. oops). Both the ISO and the embed-mods now include a custom-built version of qemu. SDL is now statically linked and also built custom to include only those features required to run in a win32 environment. SDL, zlib and qemu were rebuilt with no debug data. All symbols have been stripped from the executable and it's been recompressed with UPX. All that work saved 29k. um. woot. I'm still about 30k over 50M, but I can honestly say, I've tried. Without a remaster, I simply can't fit an electric sausage in the iso ^_^. Meanwhile... < The ISO > < The files required to modify an existing DSL ISO to be Live/Embedded > Posted by Fordi on Dec. 24 2004,01:14
Ok, it took a bit of doing, but I got cbagger01's last suggestion in.
compile that thusly (using mingw):
It should come out to 3584 bytes.
Ok, now that I've posted all that, what it does: It allows QEMU to communicate with the host PC via either it's known hostname ("punquin" in my case) or by "syshost". You see the append line has also changed to include a definition of the emulated SB card. I haven't tested this (I'm doing my tests from my work (WinXP) computer via rdesktop, and while textmode works fine, using a mouse is a highly wonky). Still, seeing as the SB card isn't working at all without that line, it can't hurt to throw it in. Posted by cbagger01 on Dec. 24 2004,04:10
Wow!I was thinking more along the line of extracting the hostname and ip adress using the batch file, but creating your own C program works too. As for the 50.066MB ISO image, my guess is that most 50MB business card CD-R disks will work as long as your CD Burning software supports overburning. I am going to try and use Nero to burn me a copy with my old Imation 50MB CD-Rs. This will just be -too cool- if everything works out. Posted by cbagger01 on Dec. 24 2004,06:24
Update.The live /embedded iso that I downloaded tonight is working for me with the following observations: This Qemu build must be a little bit out of date. The arrow keys on the keyboard don't work in an Xterminal window and the network corruption bug still exists in this version. I suggest either rebuilding with post-0.6.1 latest sources that are newer than 11/21/2004 Or you could just use the exe & dll files from the dsl-embedded-0.9.1 zipfile but this will increase the *.iso size by about 600k I am guessing that it is possible to overburn a 50MB iso with an extra 660k on a business card CD-R disk. Also, sound doesn't seem to work, maybe audio was not enabled at the qemu commandline? Posted by tronik on Dec. 24 2004,06:35
I agree. This is amazing, and just what people in recent days have been ASKING (no wait, BEGGING, for) So...lets hope it continues... I hope after Christmas I get the chance to give it a spin =)
Posted by AwPhuch on Dec. 24 2004,07:06
So let me get this straight this will give you the ability to not only have the embedded version (running windows, with dsl inside), but if reboot it will run as the "LiveCD"?That would be too cool...talk about instant versatility..it would then double the usefullness of DSL! You guys absolutely ROCK! Brian AwPhuch Posted by cbagger01 on Dec. 24 2004,17:17
It's even better than that:Due to the autorun file inside the Live/Embedded CD disk, if you insert your DSL L/E CD in a computer running MSWindows, it will automatically start up DSL from inside a qemu window. Just add a short readme file to explain the important stuff (CTL-ALT to exit the window, CTL-ALT-F to go fullscreen, press the ALT or TAB key after re-entering the qemu window if the keyboard is "stuck", etc) and anyone with a newer computer can experience DSL out-of-the box. And yes, if you reboot with the CD inside the drive bay it will bootup into DSL natively like a normal livecd. Posted by Bryan (Fordi) on Dec. 24 2004,19:21
Oh, I haven't updated the iso from my latest changes, which include:-The C program to load from autorun -QEMU 0.6.1 - patched, stripped, statically linked and compressed -shortened ISO filesystem (everything in isolinux rather than boot/isolinux, qemu moved inside of isolinux to save another 4k) -consolidated f2 and f3 (saves 2048 bytes) -index.html is there, but autorun has been modded to include the contents of the index. Reason: I'm waiting for a response (from John or Robert) as to whether I'm violating GPL by moving the authors' page to a different format. -reduced minirt24.gz - now only 746k -linuxrc with network and /dev/hda mounting. Discovered QEMU has naitive ro cloop support (IE: insmod cloop.o is not necessary in linuxrc, nor is the attempt to mount /dev/hda under cloop.) -Total iso size=50.006M (ie: <6k over 50M disc. Should be good enough for overburn.) Yes! Squooging is done! Thing is, I'm not at home, nor do I have better-than-dial-up at the moment (I'm at my g/f's house). Thus, I shall not be updating the iso until at least monday. Posted by ypx on Jan. 03 2005,15:36
Wow, what a great idea... it deserve to be added as a choice in your mydsl maker, but i guess that's allready planned
|