firecracker-netns/rootf-kernel/alpine-rootfs.sh
RouxAntoine 08a985cd8a
So my boss wanted this button ...
Signed-off-by: RouxAntoine <antoinroux@hotmail.fr>
2024-01-05 19:42:26 +01:00

25 lines
533 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 $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
tar xvf ../out/alpine-minirootfs-3.12.0-x86.tar.gz --directory="$DISK_ROOT"
#sudo umount $DISK_ROOT
#rmdir $DISK_ROOT