~wesley-wiedenmeier/curtin/fstab

« back to all changes in this revision

Viewing changes to tools/launch

  • Committer: Scott Moser
  • Date: 2016-06-24 20:12:49 UTC
  • mfrom: (395.1.2 trunk.whitespace)
  • Revision ID: smoser@ubuntu.com-20160624201249-72d2e99zet3uelii
tools/launch and tools/xkvm: whitespace cleanup and bash -x

remove trailing whitespace and '-x' on shebang line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash -x
 
1
#!/bin/bash
2
2
 
3
3
VERBOSITY=0
4
4
TEMP_D=""
15
15
    cat <<EOF
16
16
Usage: ${0##*/} [ options ] boot-image curtin install [args]
17
17
 
18
 
   boot the image 'boot-image', so that it will run 
 
18
   boot the image 'boot-image', so that it will run
19
19
      curtin install [args]
20
20
   after booting. 'curtin install [args]' can be any command'
21
 
  
 
21
 
22
22
   options:
23
23
           --add  F[:T] add file 'F' to the curtin archive at T
24
24
      -a | --append     append args to kernel cmdline (--kernel)
30
30
                        bsize <logical>[,<physical>][,<min_io_size>]
31
31
                        bsize defaults to 512b sector size
32
32
                        opts is a comma delimitted list of property=value
33
 
                        elements. Examine qemu-kvm -device scsi-hd,? for 
 
33
                        elements. Examine qemu-kvm -device scsi-hd,? for
34
34
                        details.
35
35
           --vnc D      use -vnc D (mutually exclusive with --silent)
36
36
           --uefi   N   enable uefi boot method, store nvram at N
193
193
    # starts a web service at 'port' that serves files in 'pubdir'
194
194
    # waits until it is verified to be lisenting at ip
195
195
    # if port is not provided, '$tries' random ports are tried.
196
 
    # 
 
196
    #
197
197
    # sets HTTP_PID and returns in _RET the port selected.
198
198
    local pubdir="$1" ip="$2" port="$3" tries="${4:-5}" i=""
199
199
    [ -z "$ip" ] && ip="localhost"
217
217
        [ "$port" = "random" ] && port=$(($pmin+($RANDOM%($pmax+1-$pmin))))
218
218
        debug 2 "trying http server $ip:$port"
219
219
        _start_http "$pubdir" "$ip" "$port" &&
220
 
            HTTP_PID="$_RET" && _RET="$port" && 
 
220
            HTTP_PID="$_RET" && _RET="$port" &&
221
221
            debug 1 "serving $pubdir at http://$ip:$port/ in pid $HTTP_PID" &&
222
222
            return 0
223
223
        ret=$?
285
285
        case "$cur" in
286
286
               --add) addfiles[${#addfiles[@]}]="$next"; shift;;
287
287
            -a|--append) uappend="$next"; shift;;
288
 
            -A|--arch) arch_hint="$next"; shift;;       
 
288
            -A|--arch) arch_hint="$next"; shift;;
289
289
            -d|--disk) disks[${#disks[@]}]="$next"; shift;;
290
290
            -h|--help) Usage ; exit 0;;
291
291
            -i|--initrd) initrd="$next"; shift;;
341
341
    if [ -n "$bios" ]; then
342
342
        bios_opts=(  -drive "if=pflash,format=raw,file=$bios" )
343
343
    elif [ -n "$uefi" ]; then
344
 
        case `lsb_release -sc` in 
 
344
        case `lsb_release -sc` in
345
345
            precise|trusty|vivid)
346
346
                # for non-split UEFI firmware, the code and
347
 
                # var space are in the same file.  We must 
 
347
                # var space are in the same file.  We must
348
348
                # make a copy so we can retain modifications.
349
349
                local ovmf_code="/usr/share/ovmf/OVMF.fd"
350
350
                local ovmf_var=$ovmf_code
408
408
        driver=$(echo $disk | awk -F: '{print $3}')
409
409
        bsize=$(echo $disk | awk -F: '{print $4}')
410
410
        devopts=$(echo $disk | awk -F: '{print $5}')
411
 
        
 
411
 
412
412
        if [ -z "${src}" ]; then
413
413
            error "Failed to provide disk source"
414
414
            exit 1
421
421
        if [ -z "${driver}" ]; then
422
422
            driver="virtio-blk"
423
423
        fi
424
 
        
 
424
 
425
425
        if [ -z "${bsize}" ]; then
426
426
            bsize="512"
427
427
        fi
453
453
 
454
454
        disk_args=( "${disk_args[@]}" "-device"
455
455
            "${driver},drive=drv${id},${bs_args}${devopts}" )
456
 
        
 
456
 
457
457
    done
458
458
 
459
459
    get_my_ip || { error "failed to get your ip. set IP_ADDR"; return 1; }
611
611
            #debug mode serial_args="-serial ${serial_log} -monitor stdio"
612
612
        fi
613
613
    fi
614
 
    # -monitor stdio 
615
 
    cmd=( 
 
614
    # -monitor stdio
 
615
    cmd=(
616
616
        xkvm "${pt[@]}" "${netargs[@]}" --
617
617
        "${bios_opts[@]}"
618
618
        -m ${mem} ${serial_args} ${video}