Small script to bootstrap Haiku from Haiku.

It downloads the latest image, mounts it, copy files over the target partition, copy extra files, schedules installing optional packages on next reboot and runs makebootable.
Use with caution.

Grenoble rulz!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38000 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2010-08-10 10:03:11 +00:00
parent d79351ea5e
commit e7d5c75dce
1 changed files with 86 additions and 0 deletions

86
3rdparty/mmu_man/scripts/bootstrap-haiku.sh vendored Executable file
View File

@ -0,0 +1,86 @@
#!/bin/sh
cd "$(dirname "$0")"
DESTVOL=/haiku
LOOPVOL=/loopimg
warn () {
alert --warning "$*" "Ok"
}
error () {
alert --stop "$*" "Ok"
exit 1
}
log () {
echo "$*"
}
if [ ! -d "$DESTVOL" ]; then
error "$DESTVOL not mounted"
exit 1
fi
find_current_revision () {
log "Getting url of latest revision..."
tf=/tmp/haiku-files.org_raw_$$
wget -O $tf http://haiku-files.org/raw/ >/dev/null 2>&1 || error "wget error"
url="$(grep -m1 'http:.*nightly-.*gcc2hybrid-raw.zip' "$tf" | sed 's/.*href="//;s/".*//')"
test -n "$url" || error "cannot find latest build"
file="${url##*/}"
rm "$tf"
}
download_current_revision () {
#if [ ! -e "$file" ]; then
log "Downloading latest revision: $file"
wget -c "$url" || error "cannot download latest revision"
#fi
}
unzip_current_revision () {
if [ ! -e "haiku-nightly.image" ]; then
log "Unziping..."
unzip "$file"
fi
}
install_current_revision () {
mkdir -p "$LOOPVOL"
sync
mount -ro "$PWD/haiku-nightly.image" "$LOOPVOL" || error "mount"
sync
copyattr -r -d "$LOOPVOL"/* "$DESTVOL/"
sync
unmount "$LOOPVOL"
}
makebootable_install () {
log "Making the partition bootable..."
makebootable "$DESTVOL/"
}
customize_install () {
log "Copying files..."
copyattr -r -d files/* "$DESTVOL/"
}
find_current_revision
download_current_revision
#file=haiku-nightly-r37641-x86gcc2hybrid-raw.zip
unzip_current_revision
install_current_revision
makebootable_install
customize_install