-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkrootfs_rv64_ubuntu.sh
executable file
·47 lines (39 loc) · 1.01 KB
/
mkrootfs_rv64_ubuntu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Builds an RV64 Ubuntu rootfs.
set -eo pipefail
d=$(dirname "${BASH_SOURCE[0]}")
name=$1
distro=mantic
packages=(
build-essential
systemd-sysv
time
udev
bison
gawk
python3
gdb
file
vim
gosu
strace
libidn2-0
patchelf
sudo
)
packages=$(IFS=, && echo "${packages[*]}")
echo "MARCH = $MARCH MABI = $MABI"
MARCH=$MARCH MABI=$MABI mmdebstrap --include="$packages" \
--variant=minbase \
--architecture=riscv64 \
--components="main restricted multiverse universe" \
--customize-hook='chroot "$1" useradd -m -r -s /usr/bin/bash tester'\
--customize-hook='chroot "$1" passwd -d tester'\
--hook-dir=$(realpath --relative-to=$PWD $d/mmdebstrap_hooks) \
--skip=cleanup/reproducible \
--mode=unshare \
"${distro}" \
"${name}"