2024-01-05 17:47:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-05 18:42:26 +00:00
|
|
|
set -ex
|
2024-01-05 17:47:00 +00:00
|
|
|
|
|
|
|
DISK_SIZE=10G
|
|
|
|
DISK_FILE=../out/alpine-rootfs.ext4
|
|
|
|
DISK_ROOT=../out/mount
|
|
|
|
|
|
|
|
# Allocate rootfs disk
|
|
|
|
fallocate -l "$DISK_SIZE" "$DISK_FILE"
|
2024-01-05 18:44:34 +00:00
|
|
|
mkfs.ext4 -F $DISK_FILE
|
2024-01-05 17:47:00 +00:00
|
|
|
|
|
|
|
# Mount rootfs to mount
|
|
|
|
mkdir -p $DISK_ROOT
|
|
|
|
|
|
|
|
sudo mount $DISK_FILE $DISK_ROOT
|
|
|
|
|
|
|
|
wget -O ../out/alpine-minirootfs-3.19.0-x86_64.tar.gz https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-minirootfs-3.19.0-x86_64.tar.gz
|
|
|
|
|
2024-01-05 18:43:42 +00:00
|
|
|
tar xvf ../out/alpine-minirootfs-3.19.0-x86_64.tar.gz --directory="$DISK_ROOT"
|
2024-01-05 17:47:00 +00:00
|
|
|
|
|
|
|
|
2024-01-05 18:42:26 +00:00
|
|
|
#sudo umount $DISK_ROOT
|
|
|
|
#rmdir $DISK_ROOT
|