docs/ikteam: Delete most files.
[haiku.git] / 3rdparty / mmu_man / scripts / bootstrap-haiku.sh
blob0885f134b4e86abcf1a2d9da7224a31aeeb5f18a
1 #!/bin/sh
3 cd "$(dirname "$0")"
5 DESTVOL=/haiku
6 LOOPVOL=/loopimg
8 warn () {
9 alert --warning "$*" "Ok"
12 error () {
13 alert --stop "$*" "Ok"
14 exit 1
17 log () {
18 echo "$*"
22 if [ ! -d "$DESTVOL" ]; then
23 error "$DESTVOL not mounted"
24 exit 1
28 find_current_revision () {
29 log "Getting url of latest revision..."
30 tf=/tmp/haiku-files.org_raw_$$
31 wget -O $tf http://haiku-files.org/raw/ >/dev/null 2>&1 || error "wget error"
32 url="$(grep -m1 'http:.*nightly-.*gcc2hybrid-raw.zip' "$tf" | sed 's/.*href="//;s/".*//')"
33 test -n "$url" || error "cannot find latest build"
34 file="${url##*/}"
35 rm "$tf"
39 download_current_revision () {
40 #if [ ! -e "$file" ]; then
41 log "Downloading latest revision: $file"
42 wget -c "$url" || error "cannot download latest revision"
43 #fi
47 unzip_current_revision () {
48 if [ ! -e "haiku-nightly.image" ]; then
49 log "Unziping..."
50 unzip "$file"
55 install_current_revision () {
56 mkdir -p "$LOOPVOL"
57 sync
58 mount -ro "$PWD/haiku-nightly.image" "$LOOPVOL" || error "mount"
59 sync
61 copyattr -r -d "$LOOPVOL"/* "$DESTVOL/"
62 sync
63 unmount "$LOOPVOL"
67 makebootable_install () {
68 log "Making the partition bootable..."
69 makebootable "$DESTVOL/"
73 customize_install () {
74 log "Copying files..."
75 copyattr -r -d files/* "$DESTVOL/"
80 find_current_revision
81 download_current_revision
82 #file=haiku-nightly-r37641-x86gcc2hybrid-raw.zip
83 unzip_current_revision
84 install_current_revision
85 makebootable_install
86 customize_install