~sergiusens/snappy/frameworkPath

« back to all changes in this revision

Viewing changes to partition/partition.go

  • Committer: Sergio Schvezov
  • Date: 2015-06-03 18:17:47 UTC
  • mfrom: (470.2.13 snappy)
  • Revision ID: sergio.schvezov@canonical.com-20150603181747-bjbbfu8jriq6hra5
trunkpdate

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        "io/ioutil"
27
27
        "os"
28
28
        "os/signal"
29
 
        "path"
 
29
        "path/filepath"
30
30
        "regexp"
31
31
        "sort"
32
32
        "strings"
452
452
        p := new(Partition)
453
453
 
454
454
        p.getPartitionDetails()
455
 
        p.hardwareSpecFile = path.Join(p.cacheDir(), hardwareSpecFile)
 
455
        p.hardwareSpecFile = filepath.Join(p.cacheDir(), hardwareSpecFile)
456
456
 
457
457
        return p
458
458
}
566
566
 
567
567
// Return full path to the main assets directory
568
568
func (p *Partition) assetsDir() string {
569
 
        return path.Join(p.cacheDir(), assetsDir)
 
569
        return filepath.Join(p.cacheDir(), assetsDir)
570
570
}
571
571
 
572
572
// Return the full path to the hardware-specific flash assets directory.
573
573
func (p *Partition) flashAssetsDir() string {
574
 
        return path.Join(p.cacheDir(), flashAssetsDir)
 
574
        return filepath.Join(p.cacheDir(), flashAssetsDir)
575
575
}
576
576
 
577
577
// MountTarget gets the full path to the mount target directory
578
578
func (p *Partition) MountTarget() string {
579
 
        return path.Join(p.cacheDir(), mountTarget)
 
579
        return filepath.Join(p.cacheDir(), mountTarget)
580
580
}
581
581
 
582
582
func (p *Partition) getPartitionDetails() (err error) {
769
769
        }
770
770
 
771
771
        for _, fs := range requiredChrootMounts {
772
 
                target := path.Join(p.MountTarget(), fs)
 
772
                target := filepath.Join(p.MountTarget(), fs)
773
773
 
774
774
                err := mountAndAddToGlobalMountList(mountEntry{source: fs,
775
775
                        target:    target,
783
783
        // Grub also requires access to both rootfs's when run from
784
784
        // within a chroot (to allow it to create menu entries for
785
785
        // both), so bindmount the real rootfs.
786
 
        targetInChroot := path.Join(p.MountTarget(), p.MountTarget())
 
786
        targetInChroot := filepath.Join(p.MountTarget(), p.MountTarget())
787
787
 
788
788
        // FIXME: we should really remove this after the unmount
789
789