DSL Ideas and Suggestions :: Live / Embeddedness



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?

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.

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.

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

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:
Code Sample
# last ditch - try to mount KNOPPIX ci file from /dev/hda
if test -n "$FOUND_KNOPPIX"
then
else
echo "${BLUE}Assuming you're running from QEMU${NORMAL}"
echo "${BLUE}Performing last-ditch effort to use ${MAGENTA}/dev/hda${BLUE}...${NORMAL}"
echo "${BLUE}I'm not being clean or silent here, so there'll be an error or two..."
# try to mount /dev/hda as a cloop
$INSMOD modules/cloop.o file=/dev/hda
if mount -t iso9660 /dev/cloop /KNOPPIX
then
FOUND_KNOPPIX="/dev/hda"
echo "${GREEN}Success!${NORMAL}"
else
# try one more time, this time directly trying to mount /dev/hda
if mount -t iso9660 /dev/hda /KNOPPIX
then
FOUND_KNOPPIX="/dev/hda"
echo "${GREEN}Success!${NORMAL}"
else
echo "${RED}Failed..."
fi
fi
fi

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:

Code Sample
Tree:
autorun.inf - 23
index.html - 391
qemu.bat - 198
qemu.sh - 194
./KNOPPIX
./KNOPPIX/KNOPPIX - 50,158,212 bytes
./boot
./boot/isolinux
./boot/isolinux/
./boot/isolinux/boot.cat - 2,048
./boot/isolinux/boot.msg - 110
./boot/isolinux/f2 - 1,592
./boot/isolinux/f3 - 796
./boot/isolinux/german.kbd - 256
./boot/isolinux/isolinux.bin - 9,404
./boot/isolinux/isolinux.cfg - 1,993
./boot/isolinux/linux24 - 994,807
./boot/isolinux/logo.16 - 36,649
./boot/isolinux/minirt24.gz - 798,277
./qemu
./qemu/qemu - 1,085,736
./qemu/qemu.exe - 237,568
./qemu/SDL.dll - 122,368
./qemu/vgabios-cirrus.bin - 30,868
./qemu/linux_boot.bin - 512
./qemu/bios.bin - 65536


Code Sample
qemu.bat listing:
@echo off
qemu\qemu.exe -L qemu/ -kernel boot/isolinux/linux24 -initrd boot/isolinux/minirt24.gz -hda KNOPPIX/KNOPPIX -append "ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=788 quiet"


Code Sample
qemu.sh listing:
#!/bin/sh
qemu/qemu -L qemu/ -kernel boot/isolinux/linux24 -initrd boot/isolinux/minirt24.gz -hda KNOPPIX/KNOPPIX -append "ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=788 quiet"


Code Sample
autorun.inf listing:
[autorun]
open=qemu.bat


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!

Next Page...
original here.