3 . ../crosstool/cross-var
5 LKERN=../kernel/dongle/linux-2.4.31
6 LGENFS=genext2fs-1.4/genext2fs
9 # Create initial file system
12 cp -a ../busybox/dongle/install fs
17 cp -fv ../client/vompclient fs
18 cp -fv ../client/other/*.jpg fs
19 cp -fv ../lbox_border/lbox_border.o fs/lib/modules/2.4.31
21 # Get kernel files temp dir ready
24 BOOT=${LKERN}/arch/ppc/boot
25 CFILES=${BOOT}/common/{dummy,misc-common,ns16550,relocate,string,util,serial_stub}.o
26 SFILES=${BOOT}/simple/{embed_config,head,misc-embedded}.o
27 KFILE=${BOOT}/images/vmlinux.gz
28 FILES=`sh -c "echo $CFILES $SFILES $KFILE ${BOOT}/lib/zlib.a ${BOOT}/ld.script"`
31 # Check filesystem size
33 RAMDISK_SIZE=`du -ks fs | cut -f 1`
34 let RAMDISK_SIZE=$RAMDISK_SIZE+300
35 if [ $RAMDISK_SIZE -gt 4096 ] ; then
36 echo "ramdisk too big"
40 # Create the ramdisk out of the fs directory
42 ${LGENFS} -d fs -b ${RAMDISK_SIZE} -D devtable ramdisk
49 # make_dongle() - this is straight out of arch/ppc in the linux tree
51 OBJCOPY=${CROSS}objcopy
54 $OBJCOPY -O elf32-powerpc \
55 --add-section=.ramdisk=ramdisk.gz \
56 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
57 --add-section=.image=kernel_temp/vmlinux.gz \
58 --set-section-flags=.image=contents,alloc,load,readonly,data \
59 kernel_temp/dummy.o build_temp/image.o
61 $LD -T kernel_temp/ld.script -Ttext 0x00400000 -Bstatic -o build_temp/zvmlinux.initrd \
62 kernel_temp/head.o kernel_temp/relocate.o kernel_temp/misc-embedded.o \
63 kernel_temp/misc-common.o kernel_temp/string.o kernel_temp/util.o kernel_temp/serial_stub.o \
64 kernel_temp/embed_config.o kernel_temp/ns16550.o build_temp/image.o \
67 $OBJCOPY -O elf32-powerpc build_temp/zvmlinux.initrd build_temp/zvmlinux.initrd \
68 -R .comment -R .stab -R .stabstr -R .sysmap
70 ${LKERN}/arch/ppc/boot/utils/mktree build_temp/zvmlinux.initrd $OUTFILE
79 # Install to tftp location
81 if [ -d /diskless/tftp/mvp ] && [ -w /diskless/tftp/mvp ]
83 cp -v $OUTFILE /diskless/tftp/mvp
86 if [ -d /diskless/tftp/wmvp ] && [ -w /diskless/tftp/wmvp ]
88 cp -v $OUTFILE /diskless/tftp/wmvp