16 lines
299 B
Bash
Executable File
16 lines
299 B
Bash
Executable File
#!/bin/bash
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "switching from $(id -un) to root"
|
|
exec sudo "$0" "$@"
|
|
fi
|
|
set -e
|
|
cd "$(dirname "$0")"
|
|
cd ..
|
|
echo $PWD
|
|
rm -rf ./outputs/root/
|
|
mkdir -p ./outputs/root/
|
|
debootstrap noble ./outputs/root http://archive.ubuntu.com/ubuntu
|
|
echo 'root filesystem created.'
|
|
|
|
|