summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2014-12-26 15:46:10 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2014-12-26 15:46:10 +0100
commit6a7c5ff345b197c1d5f0f845adb2bb0da9690075 (patch)
tree133b7c7fde6834f5c66df5c279725e9dc9532deb /scripts
parent14cd662cfebfcc6a36f476a616ce902a4963d3b5 (diff)
parent790bc1fc6d8870891f665714dbd7eb7ca11448e7 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-rb532.sh100
-rwxr-xr-xscripts/install-rpi.sh139
-rwxr-xr-xscripts/install-solidrun.sh143
-rwxr-xr-xscripts/install.sh2
4 files changed, 1 insertions, 383 deletions
diff --git a/scripts/install-rb532.sh b/scripts/install-rb532.sh
deleted file mode 100755
index 152ad8fa1..000000000
--- a/scripts/install-rb532.sh
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ $(id -u) -ne 0 ];then
- printf "Installation is only possible as root\n"
- exit 1
-fi
-
-f=0
-for tool in parted sfdisk mkfs.ext4 tune2fs;do
- if ! which $tool >/dev/null; then
- echo "Checking if $tool is installed... failed"
- f=1
- fi
-done
-if [ $f -eq 1 ];then exit 1;fi
-
-if [ -z $1 ];then
- printf "Please give your compact flash device as first parameter\n"
- exit 1
-else
- if [ -z $2 ];then
- printf "Please give your install tar archive as second parameter\n"
- exit 2
- fi
- if [ -f $2 ];then
- printf "Installing $2 on $1\n"
- else
- printf "$2 is not a file, Exiting\n"
- exit 1
- fi
- if [ -b $1 ];then
- printf "Using $1 as CF disk for installation\n"
- echo "WARNING: This will destroy all data on $1 - type Yes to continue!"
- read y
- if [ "$y" = "Yes" ];then
- env LC_ALL=C sfdisk -l $1 2>&1 |grep 'No medium'
- if [ $? -eq 0 ];then
- echo "No medium found"
- exit 1
- else
- printf "Starting with installation\n"
- fi
- else
- printf "Exiting.\n"
- exit 1
- fi
- else
- printf "Sorry $1 is not a block device\n"
- exit 1
- fi
-fi
-
-
-if [ $(mount | grep $1| wc -l) -ne 0 ];then
- printf "Block device $1 is in use, please umount first.\n"
- exit 1
-fi
-
-printf "Create partition and filesystem for rb532\n"
-rootpart=${1}2
-parted -s $1 mklabel msdos >/dev/null 2>&1
-sleep 2
-maxsize=$(env LC_ALL=C parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
-rootsize=$(($maxsize-2))
-
-parted -s $1 unit cyl mkpart primary ext2 0 2 >/dev/null 2>&1
-parted -s $1 unit cyl mkpart primary ext2 2 $rootsize >/dev/null 2>&1
-parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize >/dev/null 2>&1
-parted -s $1 set 1 boot on >/dev/null 2>&1
-sfdisk --change-id $1 1 27 >/dev/null 2>&1
-sfdisk --change-id $1 3 88 >/dev/null 2>&1
-sleep 1
-mkfs.ext4 -q -O ^huge_file ${1}2
-tune2fs -c 0 -i 0 -m 1 ${rootpart} >/dev/null 2>&1
-if [ $? -eq 0 ];then
- printf "Successfully disabled filesystem checks on ${rootpart}\n"
-else
- printf "Disabling filesystem checks failed, Exiting.\n"
- exit 1
-fi
-
-tmp=$(mktemp -d)
-mount -t ext4 ${rootpart} $tmp
-printf "Extracting install archive\n"
-tar -C $tmp -xzpf $2
-dd if=$tmp/boot/kernel of=${1}1 bs=2048 >/dev/null 2>&1
-if [ $? -eq 0 ];then
- printf "Installation of kernel successful.\n"
- rm $tmp/boot/kernel
-else
- printf "Installation of kernel failed.\n"
-fi
-printf "Fixing permissions\n"
-chmod 1777 $tmp/tmp
-chmod 4755 $tmp/bin/busybox
-umount $tmp
-printf "Successfully installed.\n"
-exit 0
diff --git a/scripts/install-rpi.sh b/scripts/install-rpi.sh
deleted file mode 100755
index ae4deff94..000000000
--- a/scripts/install-rpi.sh
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ $(id -u) -ne 0 ];then
- echo "Installation is only possible as root"
- exit 1
-fi
-
-f=0
-for tool in parted sfdisk mkfs.vfat mkfs.ext4;do
- if ! which $tool >/dev/null; then
- echo "Checking if $tool is installed... failed"
- f=1
- fi
-done
-if [ $f -eq 1 ];then exit 1;fi
-
-datadir=0
-keep=0
-while getopts "dk" ch; do
- case $ch in
- d)
- datadir=1
- ;;
- k)
- keep=1
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-if [ -z $1 ];then
- echo "Please give your SD card device as first parameter"
- exit 1
-else
- if [ -z $2 ];then
- echo "Please give your install tar archive as second parameter"
- exit 1
- fi
- if [ -f $2 ];then
- echo "Installing $2 on $1"
- else
- echo "$2 is not a file, exiting"
- exit 1
- fi
- if [ -b $1 ];then
- echo "Using $1 as SD card disk for installation"
- echo "WARNING: This will destroy all data on $1 - type Yes to continue!"
- read y
- if [ "$y" = "Yes" ];then
- env LC_ALL=C sfdisk -l $1 2>&1 |grep 'No medium'
- if [ $? -eq 0 ];then
- echo "No medium found"
- exit 1
- else
- echo "Starting with installation"
- fi
- else
- echo "Exiting."
- exit 1
- fi
- else
- echo "Sorry $1 is not a block device"
- exit 1
- fi
-fi
-
-
-if [ $(mount | grep $1| wc -l) -ne 0 ];then
- echo "Block device $1 is in use, please umount first"
- exit 1
-fi
-
-echo "Wiping existing partitions"
-dd if=/dev/zero of=$1 bs=512 count=1 >/dev/null 2>&1
-sync
-
-echo "Create partition and filesystem for raspberry pi"
-rootpart=${1}2
-parted -s $1 mklabel msdos
-sleep 2
-maxsize=$(env LC_ALL=C parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
-
-if [ $datadir -eq 0 ];then
- rootsize=$(($maxsize-2))
-else
- rootsize=$(($maxsize-34))
- datasize=$(($maxsize-2))
-fi
-
-parted -s $1 unit cyl mkpart primary fat32 -- 0 16
-if [ $datadir -eq 0 ];then
- parted -s $1 unit cyl mkpart primary ext2 -- 16 $rootsize
- parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
- sfdisk --change-id $1 3 88 >/dev/null 2>&1
-else
- parted -s $1 unit cyl mkpart primary ext2 -- 16 $rootsize
- parted -s $1 unit cyl mkpart primary ext2 $rootsize $datasize
- parted -s $1 unit cyl mkpart primary fat32 $datasize $maxsize
- parted -s $1 set 1 boot on
- sfdisk --change-id $1 4 88 >/dev/null 2>&1
-fi
-sleep 2
-mkfs.vfat ${1}1 >/dev/null
-mkfs.ext4 -F -q -O ^huge_file ${1}2
-if [ $datadir -eq 1 ];then
- if [ $keep -eq 0 ];then
- mkfs.ext4 -F -q -O ^huge_file ${1}3
- fi
-fi
-sync
-sleep 2
-
-tmp=$(mktemp -d)
-mount -t ext4 ${rootpart} $tmp
-mkdir $tmp/boot
-if [ $datadir -eq 1 ];then
- if [ $keep -eq 0 ];then
- mkdir $tmp/data
- mount -t ext4 ${1}3 $tmp/data
- mkdir $tmp/data/mpd $tmp/data/xbmc
- umount $tmp/data
- fi
-fi
-mount -t vfat ${1}1 $tmp/boot
-sleep 1
-echo "Extracting install archive"
-tar -C $tmp -xzpf $2
-echo "Fixing permissions"
-chmod 1777 $tmp/tmp
-chmod 4755 $tmp/bin/busybox
-if [ $datadir -eq 1 ];then
- echo "/dev/mmcblk0p3 /data ext4 rw 0 0" >>$tmp/etc/fstab
-fi
-umount $tmp/boot
-umount $tmp
-echo "Successfully installed."
-exit 0
diff --git a/scripts/install-solidrun.sh b/scripts/install-solidrun.sh
deleted file mode 100755
index 0a360a3e4..000000000
--- a/scripts/install-solidrun.sh
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ $(id -u) -ne 0 ];then
- echo "Installation is only possible as root"
- exit 1
-fi
-
-f=0
-for tool in parted sfdisk mkfs.ext4;do
- if ! which $tool >/dev/null; then
- echo "Checking if $tool is installed... failed"
- f=1
- fi
-done
-if [ $f -eq 1 ];then exit 1;fi
-
-datadir=0
-keep=0
-while getopts "dk" ch; do
- case $ch in
- d)
- datadir=1
- ;;
- k)
- keep=1
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-if [ -z $1 ];then
- echo "Please give your SD card device as first parameter"
- exit 1
-else
- if [ -z $2 ];then
- echo "Please give your install tar archive as second parameter"
- exit 1
- fi
- if [ -f $2 ];then
- echo "Installing $2 on $1"
- else
- echo "$2 is not a file, exiting"
- exit 1
- fi
- if [ -z $3 ];then
- echo "Please give your firmware directory as third parameter"
- exit 1
- fi
- if [ ! -d $3 ];then
- echo "$3 is not a directory, exiting"
- exit 1
- fi
- if [ -b $1 ];then
- echo "Using $1 as SD card disk for installation"
- echo "WARNING: This will destroy all data on $1 - type Yes to continue!"
- read y
- if [ "$y" = "Yes" ];then
- env LC_ALL=C sfdisk -l $1 2>&1 |grep 'No medium'
- if [ $? -eq 0 ];then
- echo "No medium found"
- exit 1
- else
- echo "Starting with installation"
- fi
- else
- echo "Exiting."
- exit 1
- fi
- else
- echo "Sorry $1 is not a block device"
- exit 1
- fi
-fi
-
-if [ $(mount | grep $1| wc -l) -ne 0 ];then
- echo "Block device $1 is in use, please umount first"
- exit 1
-fi
-
-maxsize=$(env LC_ALL=C parted $1 -s unit s print |awk '/^Disk/ { print $3 }'|sed -e 's/s//')
-maxsize=$(($maxsize-1))
-
-if [ $datadir -eq 0 ];then
- rootsize=$(($maxsize-32768))
- rootsizeend=$(($rootsize+1))
-else
- rootsize=$(($maxsize-32768-131072))
- rootsizeend=$(($rootsize+1))
- datasize=$(($maxsize-32768))
- datasizeend=$(($datasize+1))
-fi
-
-echo "Install bootloader for cubox-i/hummingboard"
-parted -s $1 mklabel msdos >/dev/null 2>&1
-dd if=${3}/SPL of=${1} bs=1K seek=1 >/dev/null 2>&1
-dd if=${3}/u-boot.img of=${1} bs=1K seek=42 >/dev/null 2>&1
-if [ $datadir -eq 0 ];then
- parted -a optimal -s $1 unit s mkpart primary ext2 -- 2048 $rootsize >/dev/null 2>&1
- parted -a optimal -s $1 unit s mkpart primary fat32 -- $rootsizeend $maxsize
- sfdisk --change-id $1 2 88 >/dev/null 2>&1
-else
- parted -a optimal -s $1 unit s mkpart primary ext2 -- 2048 $rootsize
- parted -a optimal -s $1 unit s mkpart primary ext2 -- $rootsizeend $datasize
- parted -a optimal -s $1 unit s mkpart primary fat32 -- $datasizeend $maxsize
- sfdisk --change-id $1 3 88
-
-fi
-
-echo "Creating filesystem"
-mkfs.ext4 -F -q -O ^huge_file ${1}1
-sync
-if [ $datadir -eq 1 ];then
- if [ $keep -eq 0 ];then
- mkfs.ext4 -F -q -O ^huge_file ${1}2
- fi
-fi
-
-tmp=$(mktemp -d)
-mount -t ext4 ${1}1 $tmp
-
-if [ $datadir -eq 1 ];then
- if [ $keep -eq 0 ];then
- mkdir $tmp/data
- mount -t ext4 ${1}2 $tmp/data
- mkdir $tmp/data/mpd $tmp/data/xbmc
- umount $tmp/data
- fi
-fi
-
-echo "Extracting install archive"
-tar -C $tmp -xzpf $2
-if [ $datadir -eq 1 ];then
- echo "/dev/mmcblk0p2 /data ext4 rw 0 0" >>$tmp/etc/fstab
-fi
-echo "Fixing permissions"
-chmod 1777 $tmp/tmp
-chmod 4755 $tmp/bin/busybox
-cp ${3}/*.dtb $tmp/boot/
-umount $tmp
-echo "Successfully installed."
-exit 0
diff --git a/scripts/install.sh b/scripts/install.sh
index cdaca5833..0cdc43fa8 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -511,7 +511,7 @@ case $target {
(( quiet )) || print Extracting installation archive...
mount_fs "$rootpart" "$R" ext4
-gzip -dc "$src" | (cd "$R"; tar -xpf -)
+xz -d "$src" | (cd "$R"; tar -xpf -)
if (( datafssz )); then
mkdir -m0755 "$R"/data