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 *.log
*.exe *.exe
chytesting chytesting
disk0

+ 3
- 0
labcodes/lab8/Makefile View File

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

Loading…
Cancel
Save