[Merge] lp:~snappy-dev/goget-ubuntu-touch/all-snaps into lp:goget-ubuntu-touch

Sergio Schvezov sergio.schvezov at ubuntu.com
Tue Mar 8 08:29:17 UTC 2016



Diff comments:

> 
> === modified file 'diskimage/bootloader.go'
> --- diskimage/bootloader.go	2015-12-12 01:20:22 +0000
> +++ diskimage/bootloader.go	2016-02-12 10:04:19 +0000
> @@ -89,21 +89,27 @@
>  	printOut("Setting up raw boot asset partitions for", imagePath, "...")
>  	var part int = partCount
>  
> -	for _, asset := range rawPartitions{
> +	pos := 0
> +	for _, asset := range rawPartitions {
>  		part += 1
>  
> -		size, err := strconv.Atoi(asset.Size)
> -		if err != nil {
> -			return err
> -		}
> -		size = size * 2
> -
>  		printOut("creating partition:", asset.Name)
> -
> -		opts := fmt.Sprintf("0:0:+%d", size)
> -		if err := exec.Command("sgdisk", "-a", "1", "-n", opts, imagePath).Run(); err != nil {
> +		// override position if specified, otherwise use the
> +		// previous position
> +		if asset.Pos > 0 {
> +			pos = asset.Pos
> +		}
> +
> +		// why * 2?

maybe it is 512 sized blocks for sgdisks

> +		size := asset.Size * 2
> +
> +		opts := fmt.Sprintf("%d:%d:+%d", part, pos, size)
> +		if output, err := exec.Command("sgdisk", "-a", "1", "-n", opts, imagePath).CombinedOutput(); err != nil {
> +			println(string(output))
>  			return err
>  		}
> +		// move postition forward
> +		pos += size
>  
>  		opts = fmt.Sprintf("%d:%s", part, asset.Name)
>  		if err := exec.Command("sgdisk", "-c", opts, imagePath).Run(); err != nil {


-- 
https://code.launchpad.net/~snappy-dev/goget-ubuntu-touch/all-snaps/+merge/275273
Your team Ubuntu Phablet Team is subscribed to branch lp:goget-ubuntu-touch.



More information about the Ubuntu-reviews mailing list