Changeset 23270


Ignore:
Timestamp:
Sep 5, 2013, 1:11:10 AM (6 years ago)
Author:
tobayer
Message:

[titan] tobayer01 skins: optimize control files

Location:
ipk/source.sh4
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.sh4/titanskins_tobayer01/CONTROL/postinst

    r13990 r23270  
    11#!/bin/sh
    2 TMP=/tmp/.titanskin
    3 echo "successfully installed"
    42
    5 echo "now you can choose the new skin...."
    6 if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
    7         SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    8         FREE=`expr $SPACE - 100`
    9         echo new freespace size $FREE kb
     3releaseversion=22775
     4plugin_short="tobayer01"
     5plugin_type="skin"
     6plugin_target="/var/usr/local/share/titan/skin"
     7
     8plugin_dir="$plugin_target/$plugin_short"
     9plugin="$plugin_short $plugin_type"
     10
     11imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`;
     12
     13
     14### MAIN ###
     15
     16sync
     17SPACE=`getfreespace $plugin_target`
     18FREE=`expr $SPACE - 100`
     19echo
     20echo "New free space: ${FREE}kB"
     21
     22
     23if [ "$imageversion" -gt "$releaseversion" ]; then
     24        echo "Successfully installed $plugin (non-release version)."
     25        # ==> rm skin_release.xml
     26        rm $plugin_dir/skin_release.xml
    1027else
    11         echo "syncing disk"
    12         sync
     28        echo "Successfully installed $plugin (release version)."
     29        # ==> mv skin_release.xml skin.xml"
     30        mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml
    1331fi
    1432
  • ipk/source.sh4/titanskins_tobayer01/CONTROL/postrm

    r12781 r23270  
    11#!/bin/sh
    2 TMP=/tmp/.skin
    32
    4 PLUGINDIR=/var/usr/local/share/titan/skin/tobayer01
    5 rm -r /var/usr/local/share/titan/skin/tobayer01
     3plugin_short="tobayer01"
     4plugin_type="skin"
     5plugin_target="/var/usr/local/share/titan/skin"
    66
    7 echo "successfully removed"
    8 if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
    9         SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    10         FREE=`expr $SPACE - 100`
    11         echo new freespace size $FREE kb
    12 else
    13         echo "syncing disk"
    14         sync
    15 fi
     7plugin_dir="$plugin_target/$plugin_short"
     8plugin="$plugin_short $plugin_type"
     9
     10
     11### MAIN ###
     12
     13rm -rf $plugin_dir
     14
     15sync
     16SPACE=`getfreespace $plugin_target`
     17FREE=`expr $SPACE - 100`
     18echo "New free space: ${FREE}kB"
     19echo
     20echo "Successfully removed $plugin."
     21
    1622exit 0
  • ipk/source.sh4/titanskins_tobayer01/CONTROL/preinst

    r18447 r23270  
    11#!/bin/sh
    2 #
    3 TMP=/tmp/.titanskin
    4 echo "syncing disk"
    5 sync
    62
    7 model=`cat /etc/model`
    8 echo""
    9 echo "Checking your Boxtype...."
    10 echo "Some Plugins will not work correctly on your $model!"
    11 echo ""
    12 if [ "$model" = "" ]; then
    13         echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
     3plugin_size=2300
     4plugin_short="tobayer01"
     5plugin_type="skin"
     6plugin_target="/var/usr/local/share/titan/skin"
     7
     8plugin_dir="$plugin_target/$plugin_short"
     9plugin="$plugin_short $plugin_type"
     10
     11
     12### MAIN ###
     13
     14# Is this check for anything useful???
     15#model=`cat /etc/model`
     16#echo -n "Checking box type..."
     17#if [ "$model" = "" ]; then
     18#       echo "......[FAILED]"
     19#       echo
     20#       echo "Sorry, $plugin is not available for the $model!"
     21#       echo "Aborting installation..."
     22#       exit 1
     23#else
     24#       echo "......[OK]"
     25#fi
     26
     27
     28echo -n "Checking installation directory..."
     29if [ ! -d $plugin_target ]; then
     30        echo "......[FAILED]"
     31        echo
     32        echo "'$plugin_target' not found!"
    1433        echo "Aborting installation..."
    1534        exit 1
    1635else
    17         echo "Boxtype: $model OK"
     36#       echo "......[OK]"
     37        echo
    1838fi
    1939
    20 if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
    21         SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    22         FREE=`expr $SPACE - 100`
    23         SIZE=1050
    24         echo "checking freespace"
    25         echo package size $SIZE kb
    26         echo freespace size $FREE kb
    27         if  [ "$FREE" -lt "$SIZE" ]; then
    28                 echo "sorry no freespace left on device"
    29                 exit 1
    30         else
    31                 echo ok         
    32         fi
     40
     41sync
     42SPACE=`getfreespace $plugin_target`
     43FREE=`expr $SPACE - 100`
     44echo -n "Checking free space (${plugin_size}/${FREE}kB)..."
     45if [ "$FREE" -lt "$plugin_size" ]; then
     46        echo "......[FAILED]"
     47        echo
     48        echo "Not enough free space in $plugin_target!"
     49        echo "Aborting installation..."
     50        exit 1
    3351else
    34         echo "syncing disk"
    35         sync
     52#       echo "......[OK]"
     53        echo
    3654fi
    3755
    38 buildgroup=`cat /etc/.buildgroup`
    39 echo "checking OS"       
    40 if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then               
    41         echo ---------------------------                 
    42         echo DONT USE this IPK Package!!                 
    43         echo ---                 
    44         echo Only for $buildgroup Image!!               
    45         echo ---------------------------                 
    46         exit 1           
    47 fi
    48  
    49 echo "installing tobayer01 skin ..."
     56
     57# Is this check for anything useful???
     58#buildgroup=`cat /etc/.buildgroup`
     59#echo -n "Checking image type..."
     60#if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
     61#       echo "......[FAILED]"
     62#       echo
     63#       echo "Sorry, $plugin is not available for this image type!"
     64#       echo "Aborting installation..."
     65#       exit 1
     66#else
     67#       echo "......[OK]"
     68#fi
     69
     70
     71rm -rf $plugin_dir
     72
     73#echo -n "Installing $plugin..."
     74#echo "......[OK]"
    5075
    5176exit 0
  • ipk/source.sh4/titanskins_tobayer01/CONTROL/prerm

    r12781 r23270  
    11#!/bin/sh
    2 TMP=/tmp/.titanskin
    3 if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
    4         SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    5         FREE=`expr $SPACE - 100`
    6         echo new freespace size $FREE kb
    7 else
    8         echo "syncing disk"
    9         sync
    10 fi
    11 echo "removing tobayer01 skin"
     2
     3plugin_short="tobayer01"
     4plugin_type="skin"
     5plugin_target="/var/usr/local/share/titan/skin"
     6
     7plugin_dir="$plugin_target/$plugin_short"
     8plugin="$plugin_short $plugin_type"
     9
     10
     11### MAIN ###
     12
     13sync
     14SPACE=`getfreespace $plugin_target`
     15FREE=`expr $SPACE - 100`
     16echo "Old free space: ${FREE}kB"
     17
    1218exit 0
  • ipk/source.sh4/titanskins_tobayer01/var/usr/local/share/titan/skin/tobayer01/skin.xml

    r23214 r23270  
     1### skin.xml for non-release images
     2
    13<screen name="autores" font="font1" charspace="-1" fontsize="30" fontcol="fontcol" posx="50" posy="650" width="120" height="40" bgcol="bgcol_grey" halign="center" valign="middle" bordercol="bordercol" bordersize="1">
    24</screen>
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst

    r23248 r23270  
    1212
    1313
    14 ### FUNCTIONS ###
    15 
    16 RES_COL=60                                                                      # column number to place the status
    17 
    18 echo_success() {                                                        # function to print the OK status
    19         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    20 }
    21 
    22 echo_failure() {                                                        # function to print the FAILED status
    23         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    24 }
    25 
    26 
    27 
    2814### MAIN ###
    2915
     
    3218FREE=`expr $SPACE - 100`
    3319echo
    34 echo "New free space: $FREE kB"
     20echo "New free space: ${FREE}kB"
    3521
    3622
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm

    r23248 r23270  
    99
    1010
    11 ### FUNCTIONS ###
    12 
    13 RES_COL=60                                                                      # column number to place the status
    14 
    15 echo_success() {                                                        # function to print the OK status
    16         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    17 }
    18 
    19 echo_failure() {                                                        # function to print the FAILED status
    20         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    21 }
    22 
    23 
    24 
    2511### MAIN ###
    2612
     
    3016SPACE=`getfreespace $plugin_target`
    3117FREE=`expr $SPACE - 100`
     18echo "New free space: ${FREE}kB"
    3219echo
    33 echo "New free space: $FREE kB"
    34 
    3520echo "Successfully removed $plugin."
    3621
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst

    r23248 r23270  
    99plugin="$plugin_short $plugin_type"
    1010
    11 model=`cat /etc/model`
    12 buildgroup=`cat /etc/.buildgroup`
    13 
    14 
    15 ### FUNCTIONS ###
    16 
    17 RES_COL=60                                                                      # column number to place the status
    18 
    19 echo_success() {                                                        # function to print the OK status
    20         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    21 }
    22 
    23 echo_failure() {                                                        # function to print the FAILED status
    24         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    25 }
    26 
    27 
    2811
    2912### MAIN ###
    3013
    31 msg="Checking box type..."
    32 if [ "$model" = "" ]; then
    33         echo_failure "$msg"
     14# Is this check for anything useful???
     15#model=`cat /etc/model`
     16#echo -n "Checking box type..."
     17#if [ "$model" = "" ]; then
     18#       echo "......[FAILED]"
     19#       echo
     20#       echo "Sorry, $plugin is not available for the $model!"
     21#       echo "Aborting installation..."
     22#       exit 1
     23#else
     24#       echo "......[OK]"
     25#fi
     26
     27
     28echo -n "Checking installation directory..."
     29if [ ! -d $plugin_target ]; then
     30        echo "......[FAILED]"
    3431        echo
    35         echo "Sorry, $plugin is not available for the $model!"
     32        echo "'$plugin_target' not found!"
    3633        echo "Aborting installation..."
    3734        exit 1
    3835else
    39         echo_success "$msg"
    40 fi
    41 
    42 
    43 msg="Checking installation directory..."
    44 if [ ! -d $plugin_target ]; then
    45         echo_failure "$msg"
     36#       echo "......[OK]"
    4637        echo
    47         echo "Sorry, $plugin_target not found!"
    48         echo "Aborting installation..."
    49         exit 1
    50 else
    51         echo_success "$msg"
    5238fi
    5339
     
    5642SPACE=`getfreespace $plugin_target`
    5743FREE=`expr $SPACE - 100`
    58 msg="Checking free space ($plugin_size in $FREE kB)..."
     44echo -n "Checking free space (${plugin_size}/${FREE}kB)..."
    5945if [ "$FREE" -lt "$plugin_size" ]; then
    60         echo_failure "$msg"
     46        echo "......[FAILED]"
    6147        echo
    62         echo "Sorry, not enough free space in $plugin_target!"
     48        echo "Not enough free space in $plugin_target!"
    6349        echo "Aborting installation..."
    6450        exit 1
    6551else
    66         echo_success "$msg"
     52#       echo "......[OK]"
     53        echo
    6754fi
    6855
    6956
    70 msg="Checking image type..."
    71 if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
    72         echo_failure "$msg"
    73         echo
    74         echo "Sorry, $plugin is not available for this image type!"
    75         echo "Aborting installation..."
    76         exit 1
    77 else
    78         echo_success "$msg"
    79 fi
     57# Is this check for anything useful???
     58#buildgroup=`cat /etc/.buildgroup`
     59#echo -n "Checking image type..."
     60#if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
     61#       echo "......[FAILED]"
     62#       echo
     63#       echo "Sorry, $plugin is not available for this image type!"
     64#       echo "Aborting installation..."
     65#       exit 1
     66#else
     67#       echo "......[OK]"
     68#fi
    8069
    8170
    8271rm -rf $plugin_dir
    8372
    84 msg="Installing $plugin..."
    85 echo_success "$msg"
     73#echo -n "Installing $plugin..."
     74#echo "......[OK]"
    8675
    8776exit 0
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm

    r23248 r23270  
    99
    1010
    11 ### FUNCTIONS ###
    12 
    13 RES_COL=60                                                                      # column number to place the status
    14 
    15 echo_success() {                                                        # function to print the OK status
    16         printf "%-${RES_COL}s%s\n" "$1" "[  OK  ]"
    17 }
    18 
    19 echo_failure() {                                                        # function to print the FAILED status
    20         printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
    21 }
    22 
    23 
    24 
    2511### MAIN ###
    2612
     
    2814SPACE=`getfreespace $plugin_target`
    2915FREE=`expr $SPACE - 100`
    30 echo "Old free space: $FREE kB"
    31 
    32 
    33 msg="Removing $plugin..."
    34 echo_success "$msg"
     16echo "Old free space: ${FREE}kB"
    3517
    3618exit 0
Note: See TracChangeset for help on using the changeset viewer.