firecracker-netns/rootf-kernel/alpine-rootfs.sh
RouxAntoine 970092d506
Oh my god what year is it?!
Signed-off-by: RouxAntoine <antoinroux@hotmail.fr>
2024-01-05 19:49:16 +01:00

25 lines
590 B
Bash
Executable File

#!/bin/bash
set -ex
DISK_SIZE=10G
DISK_FILE=../out/alpine-rootfs.ext4
DISK_ROOT=../out/mount
# Allocate rootfs disk
fallocate -l "$DISK_SIZE" "$DISK_FILE"
mkfs.ext4 -F $DISK_FILE
# 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
sudo tar xvf ../out/alpine-minirootfs-3.19.0-x86_64.tar.gz --directory="$DISK_ROOT"
rm ../out/alpine-minirootfs-3.19.0-x86_64.tar.gz
sudo umount $DISK_ROOT
rmdir $DISK_ROOT