This commit is contained in:
Jeremy Soller 2016-09-22 20:27:13 -06:00
parent c77fbdb69e
commit 421f046abb

View file

@ -177,7 +177,7 @@ $(BUILD)/initfs.rs: \
echo 'use collections::BTreeMap;' > $@ echo 'use collections::BTreeMap;' > $@
echo 'pub fn gen() -> BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> {' >> $@ echo 'pub fn gen() -> BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> {' >> $@
echo ' let mut files: BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> = BTreeMap::new();' >> $@ echo ' let mut files: BTreeMap<&'"'"'static [u8], (&'"'"'static [u8], bool)> = BTreeMap::new();' >> $@
for folder in `find initfs -type d`; do \ for folder in `find initfs -type d | sort`; do \
name=$$(echo $$folder | sed 's/initfs//' | cut -d '/' -f2-) ; \ name=$$(echo $$folder | sed 's/initfs//' | cut -d '/' -f2-) ; \
echo -n ' files.insert(b"'$$name'", (b"' >> $@ ; \ echo -n ' files.insert(b"'$$name'", (b"' >> $@ ; \
ls -1 $$folder | sort | awk 'NR > 1 {printf("\\n")} {printf("%s", $$0)}' >> $@ ; \ ls -1 $$folder | sort | awk 'NR > 1 {printf("\\n")} {printf("%s", $$0)}' >> $@ ; \