summaryrefslogtreecommitdiff
path: root/frontends/kolibrios/tools/mkimg.sh
blob: 40197bbf827ce3502218fd66c4885f27020505f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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
7z x latest-distr.7z kolibrios/lib kolibri.lbl
rm -f latest-distr.7z
popd

cd $SVNDIR/contrib/sdk/sources/
for i in $LIBS; do
    cd $i
    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/bin/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"