Browse Source

Create the sfs root directory if missing

Signed-off-by: Junjie Mao <junjie.mao@hotmail.com>
main
Junjie Mao 9 years ago
parent
commit
2d1c2001f5
3 changed files with 7 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -0
      labcodes/lab8/Makefile
  3. +3
    -0
      labcodes_answer/lab8_result/Makefile

+ 1
- 0
.gitignore View File

@ -18,3 +18,4 @@ a.out
*.log
*.exe
chytesting
disk0

+ 3
- 0
labcodes/lab8/Makefile View File

@ -273,6 +273,9 @@ $(foreach p,$(USER_BINS),$(eval $(call fscopy,$(p),$(SFSROOT)$(SLASH))))
$(SFSROOT):
if [ ! -d "$(SFSROOT)" ]; then mkdir $(SFSROOT); fi
$(SFSROOT):
$(V)$(MKDIR) $@
$(SFSIMG): $(SFSROOT) $(SFSBINS) | $(call totarget,mksfs)
$(V)dd if=/dev/zero of=$@ bs=1M count=128
@$(call totarget,mksfs) $@ $(SFSROOT)

+ 3
- 0
labcodes_answer/lab8_result/Makefile View File

@ -261,6 +261,9 @@ endef
$(foreach p,$(USER_BINS),$(eval $(call fscopy,$(p),$(SFSROOT)$(SLASH))))
$(SFSROOT):
$(V)$(MKDIR) $@
$(SFSIMG): $(SFSROOT) $(SFSBINS) | $(call totarget,mksfs)
$(V)dd if=/dev/zero of=$@ bs=1M count=128
@$(call totarget,mksfs) $@ $(SFSROOT)

Loading…
Cancel
Save