<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=BCCD%3AFossilScripts</id>
	<title>BCCD:FossilScripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cs.earlham.edu/index.php?action=history&amp;feed=atom&amp;title=BCCD%3AFossilScripts"/>
	<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=BCCD:FossilScripts&amp;action=history"/>
	<updated>2026-07-29T10:15:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.cs.earlham.edu/index.php?title=BCCD:FossilScripts&amp;diff=5445&amp;oldid=prev</id>
		<title>Gray at 22:32, 9 November 2005</title>
		<link rel="alternate" type="text/html" href="https://wiki.cs.earlham.edu/index.php?title=BCCD:FossilScripts&amp;diff=5445&amp;oldid=prev"/>
		<updated>2005-11-09T22:32:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;bbc_unfold script (unpacks the raw subsystems from the iso image)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
usage () {&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
Usage: bbc_unfold iso-file&lt;br /&gt;
&lt;br /&gt;
Take a LNX-BBC ISO file and unfold the four filesystems on the &lt;br /&gt;
disk so they can be examined or modified.  The four filesystems&lt;br /&gt;
created are:&lt;br /&gt;
&lt;br /&gt;
    bbc     This is a copy of the ISO9660 filesystem on the CD image.&lt;br /&gt;
            Exverything else is stored in here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    sing    This directory contains the contents of the compressed&lt;br /&gt;
            filesystem stored in the file singularity on the CD image.&lt;br /&gt;
            This is the final running root filesystem of a lnx-bbc&lt;br /&gt;
            system when it is running.  This is most of the data&lt;br /&gt;
            is the CD image.&lt;br /&gt;
&lt;br /&gt;
    lnx     This is a mounted FAT fileystem from the file lnx.img&lt;br /&gt;
            on the CD.  This is exactly the size of a 1.4MB floppy.&lt;br /&gt;
            When the lnx-bbc disc is booted, the system bios of the &lt;br /&gt;
            PC treats this file as a fake bootable floppy.  This&lt;br /&gt;
            contains the kernel, an initial ram disk root.bin, and&lt;br /&gt;
            a few other files to boot using syslinux.&lt;br /&gt;
&lt;br /&gt;
    root    This is a mount ext2 filesystem from the file root.bin&lt;br /&gt;
            contained in lnx.img.  This is the initial ramdisk&lt;br /&gt;
            root filesystem when the lnx-bbc boots.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    bbc_fold creates two mount points for lnx and root.  These &lt;br /&gt;
    mount points are visible with a &amp;#039;df&amp;#039;.  These filesystems should&lt;br /&gt;
    be unmounted with bbc_clean, bbc_fold, or bbc_isolinux when you&lt;br /&gt;
    are finished examing the lnx-bbc disc.&lt;br /&gt;
&lt;br /&gt;
EOF&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
die () {&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;Error: $1&amp;quot;;&lt;br /&gt;
    echo&lt;br /&gt;
    exit 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Get the ISO&lt;br /&gt;
for option in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
    case &amp;quot;$option&amp;quot; in&lt;br /&gt;
&lt;br /&gt;
        *)&lt;br /&gt;
            if test &amp;quot;x$iso&amp;quot; != x; then&lt;br /&gt;
                echo &amp;quot;Only specify one ISO file&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
                usage&lt;br /&gt;
                exit 1&lt;br /&gt;
            fi&lt;br /&gt;
            iso=&amp;quot;${option}&amp;quot; ;;&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if test &amp;quot;x$iso&amp;quot; = x; then&lt;br /&gt;
    echo &amp;quot;ISO file not specified.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    usage&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Mount the ISO image, make a copy of the contents and&lt;br /&gt;
# unmount the image.&lt;br /&gt;
#&lt;br /&gt;
echo &amp;quot;Mounting ISO image&amp;quot;&lt;br /&gt;
rm -rf bbc-iso&lt;br /&gt;
mkdir bbc-iso&lt;br /&gt;
sudo mount $iso bbc-iso -o loop || die &amp;quot;Cannot mount $iso as ISO9660&amp;quot;&lt;br /&gt;
rm -rf bbc&lt;br /&gt;
# cp -a bbc-iso bbc&lt;br /&gt;
rsync -HlpogDr bbc-iso bbc-tmp&lt;br /&gt;
mv bbc-tmp/bbc-iso bbc&lt;br /&gt;
rm -rf bbc-tmp&lt;br /&gt;
&lt;br /&gt;
sudo umount bbc-iso&lt;br /&gt;
rm -rf bbc-iso&lt;br /&gt;
&lt;br /&gt;
# Copy lnx.img floppy image from cd and mount as lnx&lt;br /&gt;
#&lt;br /&gt;
cp -f bbc/lnx.img .&lt;br /&gt;
mkdir -p lnx&lt;br /&gt;
sudo mount lnx.img lnx -o loop || die &amp;quot;Cannot mount lnx.img&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Copy root.bin initrd, uncompress, and mount as root&lt;br /&gt;
#&lt;br /&gt;
cp -f lnx/root.bin root.bin.gz  || die &amp;quot;Cannot find lnx/root.bin&amp;quot;&lt;br /&gt;
rm -rf root.bin&lt;br /&gt;
gzip -d root.bin.gz&lt;br /&gt;
mkdir -p root&lt;br /&gt;
sudo mount root.bin root -o loop || die &amp;quot;Cannot mount root.bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Decompress singularity&lt;br /&gt;
#&lt;br /&gt;
echo -n &amp;quot;Decompressing singularity...&amp;quot;&lt;br /&gt;
extract_compressed_fs bbc/singularity &amp;gt; sing.uncomp 2&amp;gt; /dev/null || \&lt;br /&gt;
    die &amp;quot;uncompressing singularity&amp;quot;&lt;br /&gt;
echo&lt;br /&gt;
&lt;br /&gt;
# Mount singularity as romfs, copy contents, and unmount image&lt;br /&gt;
#&lt;br /&gt;
rm -rf sing.romfs&lt;br /&gt;
mkdir sing.romfs&lt;br /&gt;
sudo mount sing.uncomp sing.romfs -o loop -t romfs || \&lt;br /&gt;
    die &amp;quot;Cannot mount singularity&amp;quot;&lt;br /&gt;
# cp -a sing.romfs sing&lt;br /&gt;
rsync -HlpogDr sing.romfs sing-tmp&lt;br /&gt;
mv sing-tmp/sing.romfs sing&lt;br /&gt;
rm -rf sing-tmp&lt;br /&gt;
&lt;br /&gt;
sudo umount sing.romfs&lt;br /&gt;
rm -rf sing.romfs sing.uncomp&lt;br /&gt;
&lt;br /&gt;
echo&lt;br /&gt;
df lnx root&lt;br /&gt;
echo&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;lnx-bbc unfolded as follows:&amp;quot;&lt;br /&gt;
echo&lt;br /&gt;
echo &amp;quot;   bbc      r/w copy of CDROM filesystem&amp;quot;&lt;br /&gt;
echo &amp;quot;   sing     r/w copy of singularity comrpessed r/o filesystem&amp;quot;&lt;br /&gt;
echo &amp;quot;   lnx      Mounted fat r/w el-toritto fake book floppy&amp;quot;&lt;br /&gt;
echo &amp;quot;   root     Mounted ext2 r/w initrd root filesystem on floppy&amp;quot;&lt;br /&gt;
echo&lt;br /&gt;
exit 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
bbc_fold  script that puts all of the pieces from unfold together into a new bootable image&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
usage () {&lt;br /&gt;
    cat &amp;lt;&amp;lt;EOF&lt;br /&gt;
Usage: bbc_fold iso-file&lt;br /&gt;
&lt;br /&gt;
Take the four directories created by bbc_unfold and fold them&lt;br /&gt;
back into a bootable LNX-BBC bootable image.&lt;br /&gt;
&lt;br /&gt;
EOF&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
die () {&lt;br /&gt;
    echo&lt;br /&gt;
    echo &amp;quot;Error: $1&amp;quot;;&lt;br /&gt;
    echo&lt;br /&gt;
    exit 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Get the ISO name&lt;br /&gt;
#&lt;br /&gt;
for option in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
    case &amp;quot;$option&amp;quot; in&lt;br /&gt;
&lt;br /&gt;
        *)&lt;br /&gt;
            if test &amp;quot;x$iso&amp;quot; != x; then&lt;br /&gt;
                echo &amp;quot;Only specify one ISO file&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
                usage&lt;br /&gt;
                exit 1&lt;br /&gt;
            fi&lt;br /&gt;
            iso=&amp;quot;${option}&amp;quot; ;;&lt;br /&gt;
    esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if test &amp;quot;x$iso&amp;quot; = x; then&lt;br /&gt;
    echo &amp;quot;ISO file not specified.&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
    usage&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Folding initrd root filesystem&amp;quot;&lt;br /&gt;
sudo umount root                || die &amp;quot;Cannot unmount root&amp;quot;&lt;br /&gt;
rm -rf root.bin.gz root&lt;br /&gt;
gzip -9 root.bin&lt;br /&gt;
mv root.bin.gz root.bin&lt;br /&gt;
sudo cp -f root.bin lnx&lt;br /&gt;
rm -rf root.bin&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Folding el toritto fake boot floppy&amp;quot;&lt;br /&gt;
sudo umount lnx                 || die &amp;quot;Cannot unmount lnx&amp;quot;&lt;br /&gt;
rm -rf lnx&lt;br /&gt;
sudo cp -f lnx.img bbc&lt;br /&gt;
rm -f lnx.img&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Generating new singularity&amp;quot;&lt;br /&gt;
sudo rm -rf bbc/singularity&lt;br /&gt;
genromfs -d sing -f sing.fs     || die &amp;quot;Cannot create romfs for singularity&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Compressing singularity...&amp;quot;&lt;br /&gt;
create_compressed_fs sing.fs 65536 &amp;gt; bbc/singularity 2&amp;gt; /dev/null || \&lt;br /&gt;
    die &amp;quot;Cannot compress romfs into singularity&amp;quot;&lt;br /&gt;
rm -rf sing.fs&lt;br /&gt;
&lt;br /&gt;
rm -rf $iso  || die &amp;quot;deleting old $iso&amp;quot;&lt;br /&gt;
mkisofs -v -d -N -D -R -T -c boot.catalog -b lnx.img -A &amp;quot;Linux&amp;quot; -V &amp;quot;LNX&amp;quot; -P &amp;quot;bbc-jeff&amp;quot; -o $iso bbc || die &amp;quot;mkisofs failed&amp;quot;&lt;br /&gt;
rm -rf sing bbc&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gray</name></author>
	</entry>
</feed>