Re: re freezing powerpc
Ward Deng wrote:
> Eric, I am interested in helping on building a tftp image based Debian
> installation procedure for UltraSPARC. We are working with RedHat based
> UltraPenguin kernel which also supports 32-bit SPARC but most of us do
> not like to work with a hybrid system. Many developers suggested me
> try working on a pure Debian 32-bit system with UltraPenguin kernel. Since
> UltraPenguin is still a 32-bit system except the kernel itself, we think
> we can make it working.
>
> Since you have been the major developer for 32-bit Debian/SPARC installation
> related work, can you help give me some information and guidance? What I
> try to learn is how to merge a bootable image (I knew it is a.out format
> converted from ELF) with Debian installer.
>
> Kernel developers intended to provide a system supporting both 32-bit and
> 64-bit. We do not know what Debian SPARC developers think about this. Any
> ideas?
Hello ward,
if you can live with a full sparc32 system (including glibc), you can quickly
build a bootable system using actual bootdisks by replacing just the tftpboot
image with a new one based on ultralinux kernel.
To recreate the tftpboot image:
1. build your kernel
2. convert it to a.out using elftoaout (*) then rename it to tftpboot.img
3. get the system.map (uncompressed) & the root image (root.bin) files
4. then run piggyback (*) with all of these files :
# piggyback tftpboot.img system.map root.bin
5. finally, you can pad the resulting file to be 4-bytes aligned (some of
old sun4c workstations won't boot if using a not aligned tftp image, but
I don't think new ultrasparcs are buggy like that).
The file attached to this mail will do all the job. Call it with the
following parameters :
# tftpboot.sh kernel system.map root.bin
Unfortunately, I think other methods than netboot could not easily converted
to ultralinux since AFAIK you have to replace silo by a newer (0.7.something
on the rescue image), change the linux kernel and rebuild the drivers' disk.
However the boot-floppies package is not usable for sparc in its current
state. I'm starting to review the new code and fix it for the new set of
bootdisks I plan to release soon (after the release of the new glibc).
As soon as the package will be fixed I will let you know.
Hope this help.
(*) elftoaout & piggyback are available in the sparc-utils debian package.
PS: there could be a problem when installing modules since the ones in the
installation subsystem are for sparc32 2.0.33 kernel, but just skipping
this step should solve it ;)
--
Eric Delaunay | "La guerre justifie l'existence des militaires.
delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)
#! /bin/sh
# Boot Disk maker for TFTP prototcol.
# Eric Delaunay, February 1998.
# This is free software under the GNU General Public License.
# Abort on any non-zero return.
#set -e
#set -x
# Print a usage message and exit if the argument count is wrong.
if [ $# != 4 ]; then
echo "Usage: "$0" linux system.map root-image debian-version" 1>&2
cat 1>&2 << EOF
linux: the Linux kernel (may be compressed).
system.map: the map file (may by compressed).
root-image: a compressed disk image to load in ramdisk and mount as root.
debian-version: version of the Debian release.
EOF
exit -1
fi
# Set this to the location of the kernel
kernel=$1
# Set this to the location of the kernel map file
sysmap=$2
# Set this to the location of the root filesystem image
rootimage=$3
#Set this to the Debian version
debianversion=$4
# Make sure the files are available.
if [ -f $kernel -a -f $sysmap -a -f $rootimage ]; then
:
else
echo "Can't find files: $kernel, $sysmap, $rootimage" 1>&2
exit -1
fi
tmp=/var/tmp/tftpboot.$$
mkdir -p $tmp
# Do the actual work of making the kernel image bootable.
tftpimage=tftpboot.img
# 1/ uncompress it if needed
if file $kernel | grep gzip > /dev/null; then
zcat $kernel > $tmp/image
else
cp $kernel $tmp/image
fi
# 2/ convert it to aout format
if file $tmp/image | grep ELF > /dev/null; then
elftoaout -o $tftpimage $tmp/image
rm $tmp/image
else
mv $tmp/image $tftpimage
fi
# 3/ uncompress the system.map file if needed
if file $sysmap | grep gzip > /dev/null; then
zcat $sysmap > $tmp/system.map
sysmap=$tmp/system.map
fi
# 4/ append rootimage to the kernel
piggyback $tftpimage $sysmap $rootimage
size=`wc $tftpimage`
rem=`expr \( 4 - $size % 4 \) % 4
dd if=/dev/zero bs=1 count=$rem >> $tftpimage
ls -l $tftpimage
# cleanup
rm -fr $tmp
exit 0
Reply to: