Created
January 10, 2021 19:01
-
-
Save amcginlay/c17559503aac5a9203d49a105523a917 to your computer and use it in GitHub Desktop.
How to build a filesystem image from scratch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash # requires mtools package | |
dd if=/dev/zero of=test.img bs=1M count=2 | |
mkdosfs test.img | |
mdir -i test.img | |
echo "Hello" > simple.txt | |
mcopy -i test.img simple.txt ::/simple.txt | |
mmd -i test.img stuff | |
mdir -i test.img stuff | |
rm simple.txt | |
mcopy -i test.img ::/simple.txt simple.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment