From 2d1c2001f594d420aba5c4f82470ffab9e4713f6 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 24 Mar 2015 10:33:23 +0800 Subject: [PATCH] Create the sfs root directory if missing Signed-off-by: Junjie Mao --- .gitignore | 1 + labcodes/lab8/Makefile | 3 +++ labcodes_answer/lab8_result/Makefile | 3 +++ 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 8621919..350a483 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ a.out *.log *.exe chytesting +disk0 \ No newline at end of file diff --git a/labcodes/lab8/Makefile b/labcodes/lab8/Makefile index d87f0a8..4aba038 100644 --- a/labcodes/lab8/Makefile +++ b/labcodes/lab8/Makefile @@ -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) diff --git a/labcodes_answer/lab8_result/Makefile b/labcodes_answer/lab8_result/Makefile index 0f28ca1..2ca4155 100644 --- a/labcodes_answer/lab8_result/Makefile +++ b/labcodes_answer/lab8_result/Makefile @@ -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)