#!/bin/bash . ../crosstool/cross-var LKERN=../kernel/dongle/linux-2.4.31 LGENFS=genext2fs-1.4/genext2fs OUTFILE=vomp-dongle # Create initial file system mkdir tofs/proc cp -a ../busybox/dongle/install fs cp -a tofs/* fs # Insert vompclient cp -fv ../client/vompclient fs cp -fv ../client/other/vdr.jpg fs cp -fv ../client/other/wallpaperNTSC.jpg fs cp -fv ../client/other/wallpaperPAL.jpg fs cp -fv ../lbox_border/lbox_border.o fs/lib/modules/2.4.31 # Get kernel files temp dir ready mkdir kernel_temp BOOT=${LKERN}/arch/ppc/boot CFILES=${BOOT}/common/{dummy,misc-common,ns16550,relocate,string,util,serial_stub}.o SFILES=${BOOT}/simple/{embed_config,head,misc-embedded}.o KFILE=${BOOT}/images/vmlinux.gz FILES=`sh -c "echo $CFILES $SFILES $KFILE ${BOOT}/lib/zlib.a ${BOOT}/ld.script"` cp $FILES kernel_temp # Check filesystem size RAMDISK_SIZE=`du -ks fs | cut -f 1` let RAMDISK_SIZE=$RAMDISK_SIZE+300 if [ $RAMDISK_SIZE -gt 4096 ] ; then echo "ramdisk too big" exit fi # Create the ramdisk out of the fs directory ${LGENFS} -d fs -b ${RAMDISK_SIZE} -D devtable ramdisk /bin/gzip ramdisk # Put it all together mkdir build_temp # make_dongle() - this is straight out of arch/ppc in the linux tree OBJCOPY=${CROSS}objcopy LD=${CROSS}ld $OBJCOPY -O elf32-powerpc \ --add-section=.ramdisk=ramdisk.gz \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ --add-section=.image=kernel_temp/vmlinux.gz \ --set-section-flags=.image=contents,alloc,load,readonly,data \ kernel_temp/dummy.o build_temp/image.o $LD -T kernel_temp/ld.script -Ttext 0x00400000 -Bstatic -o build_temp/zvmlinux.initrd \ kernel_temp/head.o kernel_temp/relocate.o kernel_temp/misc-embedded.o \ kernel_temp/misc-common.o kernel_temp/string.o kernel_temp/util.o kernel_temp/serial_stub.o \ kernel_temp/embed_config.o kernel_temp/ns16550.o build_temp/image.o \ kernel_temp/zlib.a $OBJCOPY -O elf32-powerpc build_temp/zvmlinux.initrd build_temp/zvmlinux.initrd \ -R .comment -R .stab -R .stabstr -R .sysmap ${LKERN}/arch/ppc/boot/utils/mktree build_temp/zvmlinux.initrd $OUTFILE # Clean up rm -f ramdisk.gz rm -rf build_temp rm -rf kernel_temp rm -rf fs # Install to tftp location if [ -d /diskless/tftp/mvp ] && [ -w /diskless/tftp/mvp ] then cp -v $OUTFILE /diskless/tftp/mvp fi if [ -d /diskless/tftp/wmvp ] && [ -w /diskless/tftp/wmvp ] then cp -v $OUTFILE /diskless/tftp/wmvp fi