Skip to content

Instantly share code, notes, and snippets.

@amcginlay
Created January 10, 2021 19:01
Show Gist options
  • Save amcginlay/c17559503aac5a9203d49a105523a917 to your computer and use it in GitHub Desktop.
Save amcginlay/c17559503aac5a9203d49a105523a917 to your computer and use it in GitHub Desktop.
How to build a filesystem image from scratch
#!/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