~franz-hsieh/+junk/stella-dash-helper

« back to all changes in this revision

Viewing changes to bin/dash-manager

  • Committer: Franz Hsieh (Franz)
  • Date: 2014-07-31 02:32:18 UTC
  • Revision ID: franz.hsieh@canonical.com-20140731023218-so7rpzu25otfb7yc
Tags: 1.3
* Use [[ ... ]] condition check to reduce errors 
* bin/dash-manager:
  - Remove dash-merge-delta stage, this will be
    called in dash-create-recovery.
  - Call get_dash_target instead of using /dev/sda
* bin/dash-create-recovery
  - Add dash-merge-delta before create recovery.
  - Remove redundant code pieces
* bin/dash-create-disk
  - Remove redundant code pieces
* lib/common.sh
  - Add get_dash_target to find first hard disk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#STAMPS
22
22
dash_create_disk_done=dash-create-disk-done
23
23
dash_install_delta_done=dash-install-delta-done
24
 
dash_merge_delta_done=dash-merge-delta-done
25
24
dash_create_recovery_done=dash-create-recovery-done
26
25
 
27
26
check_stamp()
54
53
post_create_disk()
55
54
{
56
55
    # prompt user to remove removable media
57
 
    if [ -f /tmp/.no_reboot ]; then
 
56
    if [[ -f /tmp/.no_reboot ]]; then
58
57
        prompt_switch_terminal "Dash create disk done"
59
58
        exit 0
60
59
    fi
77
76
    # we don't need stamps anymore
78
77
    clean_stamps
79
78
 
80
 
    if [ -f /tmp/.no_reboot ]; then
 
79
    if [[ -f /tmp/.no_reboot ]]; then
81
80
        prompt_switch_terminal "Dash create recovery done"
82
81
        exit 0
83
82
    fi
144
143
        break
145
144
    fi
146
145
 
147
 
    # STAGE-3 merge image patch
148
 
    # It depends on dash-install-delta is done
149
 
    if check_stamp $dash_install_delta_done &&
150
 
        ! check_stamp $dash_merge_delta_done; then
151
 
        dash-merge-delta
152
 
        touch_stamp $dash_install_delta_done
153
 
    fi
154
 
 
155
 
    # STAGE-4 create recovery partition
 
146
    # STAGE-3 create recovery partition
156
147
    if check_stamp $dash_create_disk_done; then
157
148
        dash-create-recovery
158
149
        touch_stamp $dash_create_disk_done