@@ -28,8 +28,6 @@ import (
2828 "github.com/docker/docker/pkg/fsutils"
2929 "github.com/docker/docker/pkg/idtools"
3030 "github.com/docker/docker/pkg/mount"
31- "github.com/docker/docker/pkg/parsers"
32- "github.com/docker/docker/pkg/parsers/kernel"
3331 "github.com/docker/go-units"
3432
3533 "github.com/opencontainers/runc/libcontainer/label"
@@ -116,27 +114,10 @@ func init() {
116114// If overlay filesystem is not supported on the host, graphdriver.ErrNotSupported is returned as error.
117115// If an overlay filesystem is not supported over an existing filesystem then error graphdriver.ErrIncompatibleFS is returned.
118116func Init (home string , options []string , uidMaps , gidMaps []idtools.IDMap ) (graphdriver.Driver , error ) {
119- opts , err := parseOptions (options )
120- if err != nil {
121- return nil , err
122- }
123-
124117 if err := supportsOverlay (); err != nil {
125118 return nil , graphdriver .ErrNotSupported
126119 }
127120
128- // require kernel 4.0.0 to ensure multiple lower dirs are supported
129- v , err := kernel .GetKernelVersion ()
130- if err != nil {
131- return nil , err
132- }
133- if kernel .CompareKernelVersion (* v , kernel.VersionInfo {Kernel : 4 , Major : 0 , Minor : 0 }) < 0 {
134- if ! opts .overrideKernelCheck {
135- return nil , graphdriver .ErrNotSupported
136- }
137- logrus .Warn ("Using pre-4.0.0 kernel for overlay2, mount failures may require kernel update" )
138- }
139-
140121 fsMagic , err := graphdriver .GetFSMagic (home )
141122 if err != nil {
142123 return nil , err
@@ -196,28 +177,6 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
196177 return d , nil
197178}
198179
199- func parseOptions (options []string ) (* overlayOptions , error ) {
200- o := & overlayOptions {}
201- for _ , option := range options {
202- key , val , err := parsers .ParseKeyValueOpt (option )
203- if err != nil {
204- return nil , err
205- }
206- key = strings .ToLower (key )
207- switch key {
208- case "overlay2.override_kernel_check" :
209- o .overrideKernelCheck , err = strconv .ParseBool (val )
210- if err != nil {
211- return nil , err
212- }
213-
214- default :
215- return nil , fmt .Errorf ("overlay2: Unknown option %s\n " , key )
216- }
217- }
218- return o , nil
219- }
220-
221180func supportsOverlay () error {
222181 // We can try to modprobe overlay first before looking at
223182 // proc/filesystems for when overlay is supported
0 commit comments