Add graph driver registration

Upstream-commit: 752bfba2c5d6030d6fe3d615d0c2afd2696e7b20
Component: engine
This commit is contained in:
Michael Crosby
2013-11-04 15:22:34 -08:00
parent 4092fc1017
commit 14efe59bac
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
}