You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
netsurf/frontends/kolibrios/tools/mkimg.sh

56 lines
1.3 KiB

#!/bin/bash
set -x
SVNDIR=/opt/netsurf/kos32-gcc/env/kolibrios/
BINDIR=/opt/netsurf/kos32-gcc/env/bin
LIBS="libpng libjpeg"
DLL="libpng16.dll libjpeg.dll"
wget http://builds.kolibrios.org/eng/latest-distr.7z --directory-prefix=$BINDIR
pushd $PWD
cd $BINDIR
rm -rf kolibrios/lib kolibri.lbl kolibri.img
7z x latest-distr.7z kolibrios/lib kolibri.lbl kolibri.img
rm -f latest-distr.7z
cd $BINDIR/..
rm -f *.vdi
popd
cd $SVNDIR/contrib/sdk/sources/
PATH=/opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/bin/:$PATH
for i in $LIBS; do
cd $i
INSTALLDIR=/tmp LDFLAGS_CMD="-L../../sources/newlib -L/opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/lib" make
cd ..
done
for i in $DLL; do
cp ../bin/$i $BINDIR/kolibrios/lib/
done
######
# Create the VDI image from $BINDIR
# Use this as the VDI image in VirtualBox
######
FILENAME=bin.img
MOUNTPOINT=/mnt/temp
OUTPUT=/opt/netsurf/kos32-gcc/env/netsurf-$(date +%Y%m%d-%H%M%S).vdi
rm -f $FILENAME
rm -f $OUTPUT
sudo umount $MOUNTPOINT
dd if=/dev/urandom of=$FILENAME bs=32M count=4
/usr/sbin/mkfs.vfat $FILENAME
sudo mkdir -p $MOUNTPOINT
sudo mount -o loop $FILENAME $MOUNTPOINT
sudo cp -r /opt/netsurf/kos32-gcc/env/bin/* $MOUNTPOINT/
sudo umount $MOUNTPOINT
rm -f $OUTPUT
VBoxManage convertfromraw $FILENAME $OUTPUT --format=VDI
echo "VDI Image at : $OUTPUT : Mount it with KolibriOS"