ableos/repbuild/assets/mkfs.sh

51 lines
685 B
Bash
Raw Normal View History

2022-07-28 07:07:23 -05:00
set -eu
root_dir=root
img_file=img.ext2
user="Able"
# Create a test directory to convert to ext2.
mkdir -p "$root_dir"
mkdir -p "$root_dir/boot"
mkdir -p "$root_dir/system"
mkdir -p "$root_dir/system/bins"
mkdir -p "$root_dir/system/configs"
mkdir -p "$root_dir/shared"
mkdir -p "$root_dir/shared/bins"
mkdir -p "$root_dir/shared/configs"
mkdir -p "$root_dir/home"
mkdir -p "$root_dir/home/$user"
mkdir -p "$root_dir/home/$user/.trash"
mkdir -p "$root_dir/home/$user/bins"
mkdir -p "$root_dir/home/$user/configs"
# Build the userland here
mke2fs \
-L '' \
-N 0 \
-O ^64bit \
-d "$root_dir" \
-m 5 \
-r 1 \
-I 128 \
-t ext2 \
"$img_file" \
4M \
;