File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ SLAVE_IMAGE = sonic-slave-$(USER)
48
48
SLAVE_DIR = sonic-slave
49
49
endif
50
50
51
- INSMOD_OVERLAY := sudo modprobe overlay
51
+ OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERROR: Module 'overlay' not loaded. Try running 'sudo modprobe overlay'."; exit 1)
52
+
52
53
DOCKER_RUN := docker run --rm=true --privileged \
53
54
-v $(PWD):/sonic \
54
55
-w /sonic \
@@ -94,13 +95,13 @@ SONIC_BUILD_INSTRUCTION := make \
94
95
.DEFAULT_GOAL := all
95
96
96
97
%::
98
+ @$(OVERLAY_MODULE_CHECK)
97
99
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
98
100
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
99
101
$(DOCKER_BASE_BUILD) ; }
100
102
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
101
103
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
102
104
$(DOCKER_BUILD) ; }
103
- @$(INSMOD_OVERLAY)
104
105
ifeq "$(KEEP_SLAVE_ON)" "yes"
105
106
ifdef SOURCE_FOLDER
106
107
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/$(USER)/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
@@ -116,13 +117,13 @@ sonic-slave-build :
116
117
$(DOCKER_BUILD)
117
118
118
119
sonic-slave-bash :
120
+ @$(OVERLAY_MODULE_CHECK)
119
121
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
120
122
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
121
123
$(DOCKER_BASE_BUILD) ; }
122
124
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
123
125
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
124
126
$(DOCKER_BUILD) ; }
125
- @$(INSMOD_OVERLAY)
126
127
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
127
128
128
129
showtag:
Original file line number Diff line number Diff line change @@ -47,21 +47,25 @@ To clone the code repository recursively, assuming git version 1.9 or newer:
47
47
48
48
To build SONiC installer image and docker images, run the following commands:
49
49
50
+ # Ensure the 'overlay' module is loaded on your development system
51
+ sudo modprobe overlay
52
+
53
+ # Enter the source directory
50
54
cd sonic-buildimage
51
55
52
56
# (Optional) Checkout a specific branch. By default, it uses master branch
53
57
git checkout [branch_name]
54
58
55
- # Execute make init once after cloning the repo, or fetched remote repo with submodule updates
59
+ # Execute make init once after cloning the repo, or after fetching remote repo with submodule updates
56
60
make init
57
61
58
62
# Execute make configure once to configure ASIC
59
63
make configure PLATFORM=[ASIC_VENDOR]
60
64
61
- # build debian stretch required targets (optional)
65
+ # Build Debian Stretch required targets (Manual execution optional; will also be executed as part of the build )
62
66
BLDENV=stretch make stretch
63
67
64
- # build SONiC image
68
+ # Build SONiC image
65
69
make all
66
70
67
71
** NOTE** :
You can’t perform that action at this time.
0 commit comments