diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-08 02:52:49 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-11-13 20:52:53 +0100 |
commit | 7dacac37a697f63d45b0d23071a0861582138d1d (patch) | |
tree | 208d1289d99c23f3bdb6129119bca311b9d79622 | |
parent | 5e77d1d8d7b75b22a2dd6c4d35df7fc742aa706c (diff) |
adkinstall: add sgi o2 support
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
-rw-r--r-- | package/adkinstall/src/adkinstall | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/package/adkinstall/src/adkinstall b/package/adkinstall/src/adkinstall index 2aadca4e6..9211bed88 100644 --- a/package/adkinstall/src/adkinstall +++ b/package/adkinstall/src/adkinstall @@ -25,6 +25,16 @@ EOF exit 1 } +function sgi-o2-help { + cat >&2 <<EOF +Syntax: adkinstall <archive> + -d: create data partition + -f: filesystem (default ext4) + -h: help text +EOF + exit 1 +} + function ibm-x40-help { cat >&2 <<EOF Syntax: adkinstall <archive> @@ -54,6 +64,31 @@ EOF } case $target { +(sgi-o2) + cfgfssize=32768 + data= + fs=ext4 + while getopts "f:d:" ch; do + case $ch in + d) + data=$OPTARG + ;; + f) + fs=$OPTARG + ;; + *) + sgi-o2-help + exit 1 + ;; + esac + done + shift $((OPTIND - 1)) + if [ -z $1 ];then + sgi-o2-help + else + archive=$1 + fi + ;; (ibm-x40) cfgfssize=32768 data= @@ -277,6 +312,47 @@ function fix_perm { } case $target { +(sgi-o2) + get_max_size /dev/sda + create_label /dev/sda + if [ -z $data ];then + create_partition /dev/sda ext2 16385 $rootsize + create_partition /dev/sda ext2 $(($rootsize+1)) $(($maxsize-1)) + set_boot_flag /dev/sda 1 + change_part_type /dev/sda 2 88 + else + datasize=$(($data*1024*2)) + echo datasize is: $datasize + echo create partition from 16385 to $(($rootsize-$datasize)) + create_partition /dev/sda ext2 16385 $(($rootsize-$datasize)) + echo create partition from $(($rootsize-$datasize+1)) to $(($maxsize-$cfgfssize-1)) + create_partition /dev/sda ext2 $(($rootsize-$datasize+1)) $(($maxsize-$cfgfssize-1)) + echo create partition from $(($maxsize-$cfgfssize)) to $(($maxsize-1)) + create_partition /dev/sda ext2 $(($maxsize-$cfgfssize)) $(($maxsize-1)) + set_boot_flag /dev/sda 1 + change_part_type /dev/sda 3 88 + + fi + partprobe /dev/sda + sync + sleep 2 + if [ -z $data ];then + create_filesystem /dev/sda $fs 1 + else + create_filesystem /dev/sda $fs 1 + create_filesystem /dev/sda $fs 2 + fi + mdev -s + mount_fs /dev/sda 1 $fs /mnt + extract_archive $archive /mnt + if [ ! -z $data ];then + echo creating data dir and fstab entry + mkdir /mnt/data + echo "/dev/sda2 /data ext4 rw 0 0" >> /mnt/etc/fstab + fi + fix_perm /mnt + umount /mnt + ;; (ibm-x40) get_max_size /dev/sda create_label /dev/sda |