Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on tomsrtbt.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/qemu.e>
#           or at <http://angg.twu.net/e/qemu.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.tomsrtbt»			(to "tomsrtbt")




#####
#
# tomsrtbt
# 2004dec23
#
#####

# «tomsrtbt»  (to ".tomsrtbt")
# http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz
#*
# Unpack the .tar.gz containg the 1.772 floppy image and other stuff
# (code-c-d "tomsrtbt" "~/usrc/tomsrtbt-2.0.103/")
# (find-tomsrtbtfile "")
# (find-tomsrtbtfile "tomsrtbt.FAQ" "telnet telnetd")
# (find-tomsrtbtfile "tomsrtbt.FAQ" "Virtually all 1.44 drives support 1.722")

rm -Rv ~/usrc/tomsrtbt-2.0.103/
mkdir 
tar -C ~/usrc/ -xvzf \
$S/http/www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz

#*
# Mount the floppy image.
# Where is the linux fs? It's not in a file, we'll need to dd it out...
# (find-fline "/tmp/toms/")
# (find-fline "/tmp/toms/rc.custom.gz")
# (find-fline "/tmp/toms/settings.s")
cd
sudo umount /tmp/toms/
rm -Rv      /tmp/toms/
mkdir       /tmp/toms/
sudo mount -o ro,loop ~/usrc/tomsrtbt-2.0.103/tomsrtbt.raw /tmp/toms/
cd          /tmp/toms/

#*
# Save the files in /tmp/toms/ so that it will be easier to work with
# them later. The sudo is needed because there is a 600 root:root file
# (find-fline "/tmp/toms/")
# (find-tomsrtbtfile "")

cd /tmp/toms/
sudo tar -cvz * > ~/usrc/tomsrtbt-2.0.103/tomsrtbt.fs1.tar.gz

#*
# Create a sparse 1G image
python =(<<'%%%'
image = open("/tmp/hda.img", 'w')
image.truncate(1024 * 1048576L)
image.close()
%%%)

#*
# Test that the bz2bzImage is really a linux kernel image
# The last lines are just to make qemu happy
qemu -monitor stdio \
     -kernel /tmp/toms/bz2bzImage \
     -m 64 -isa -n /tmp/my-qemu-ifup \
     -hda /tmp/hda.img

#*
# Emulate booting from the tomsrtbt floopy
cd ~/usrc/tomsrtbt-2.0.103/
qemu -m 64 -isa -n /etc/qemu-ifup \
  -monitor stdio \
  -fda tomsrtbt.raw

#*
# Extract the ramdisk image
# Settings taken from: (find-tomsrtbtfile "settings.s" "#AUTO#")
#
NM=tomsrtbt
PL=103
RZ=2380
RI=618
Z1=1682
OA=841
O1=867
O2=3443
Z2=1709
FR=53

# (find-tomsrtbtfile "")
# (find-tomsrtbtfile "unpack.s" "skip=")
# (find-tomsrtbtfile "settings.s" "RD=/dev/ram5")
cd ~/usrc/tomsrtbt-2.0.103/
NU=/dev/null
RAW=tomsrtbt.raw
 RD=tomsrtbt.fs2.raw
# dd bs=1k if=$1 skip=$O1 2>$NU|dd count=$Z2 2>$NU|bzip2 -d 2>$NU >$RD
dd bs=1k if=$RAW skip=$O1 2>$NU|dd count=$Z2 2>$NU|bzip2 -d 2>$NU >$RD

#*
# Mount tomsrtbt's ramdisk image
cd ~/usrc/tomsrtbt-2.0.103/
sudo umount /tmp/tomsfs/
rm -Rv      /tmp/tomsfs/
mkdir       /tmp/tomsfs/
sudo mount -o loop tomsrtbt.fs2.raw /tmp/tomsfs
cd          /tmp/tomsfs/

#*
# Pack the files from the ramdisk image for easier access later
# (find-fline "/tmp/tomsfs/")
# (find-tomsrtbtfile "")
cd /tmp/tomsfs/
tar -cvzf ~/usrc/tomsrtbt-2.0.103/tomsrtbt.fs2.tar.gz *

#*
# Umount the images
cd
sudo umount /tmp/toms/
sudo umount /tmp/tomsfs/

#*






#  Local Variables:
#  coding:               no-conversion
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: