Add graph driver registration

This commit is contained in:
Michael Crosby
2013-11-04 15:22:34 -08:00
parent 98c3693acf
commit 752bfba2c5
5 changed files with 82 additions and 19 deletions
+9 -1
View File
@@ -9,12 +9,20 @@ import (
"path"
)
func init() {
graphdriver.Register("aufs", Init)
}
type AufsDriver struct {
}
// New returns a new AUFS driver.
// An error is returned if AUFS is not supported.
func New() (*AufsDriver, error) {
func Init(root string) (graphdriver.Driver, error) {
// Try to load the aufs kernel module
if err := exec.Command("modprobe", "aufs").Run(); err != nil {
return nil, err
}
return &AufsDriver{}, nil
}