diff --git a/.gitignore b/.gitignore index 4bc5f105..54136f89 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ wlutil/_command.sh *__pycache__ .doit.db* marshal-config.yaml +boards/default/distros/ubuntu/rootfs.img* .ropeproject *~ -*# \ No newline at end of file +*# diff --git a/boards/default/distros/ubuntu/Makefile b/boards/default/distros/ubuntu/Makefile new file mode 100644 index 00000000..ef8579f8 --- /dev/null +++ b/boards/default/distros/ubuntu/Makefile @@ -0,0 +1,14 @@ +RAWURL=https://cdimage.ubuntu.com/releases/20.04.5/release/ubuntu-20.04.5-preinstalled-server-riscv64+unmatched.img.xz +COMPIMG=rootfs.img.xz +NEWIMG=rootfs.img + +# Extract root partition without partition table +# NOTE: Offset must be adjusted for different base image +$(NEWIMG): $(COMPIMG) + xzcat -k $(COMPIMG) | dd of=$(NEWIMG) bs=512 skip=235554 + +$(COMPIMG): + curl $(RAWURL) -o $(COMPIMG) + +clean: + rm -f $(COMPIMG) $(RAWIMG) $(NEWIMG) diff --git a/boards/default/distros/ubuntu/__init__.py b/boards/default/distros/ubuntu/__init__.py new file mode 100644 index 00000000..4cd21798 --- /dev/null +++ b/boards/default/distros/ubuntu/__init__.py @@ -0,0 +1 @@ +from .ubuntu import * # NOQA diff --git a/boards/default/distros/ubuntu/overlay/.gitignore b/boards/default/distros/ubuntu/overlay/.gitignore new file mode 100644 index 00000000..8c93fc7a --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/.gitignore @@ -0,0 +1 @@ +etc/systemd/system/firesim.service diff --git a/boards/default/distros/ubuntu/overlay/etc/firesim/.gitignore b/boards/default/distros/ubuntu/overlay/etc/firesim/.gitignore new file mode 100644 index 00000000..fd1ff69a --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/etc/firesim/.gitignore @@ -0,0 +1,2 @@ +# This file is auto-generated by the build system +firesim.sh diff --git a/boards/default/distros/ubuntu/overlay/etc/fstab b/boards/default/distros/ubuntu/overlay/etc/fstab new file mode 100644 index 00000000..4534a1b0 --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/etc/fstab @@ -0,0 +1 @@ +LABEL=_/ / ext4 defaults,noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s 0 0 diff --git a/boards/default/distros/ubuntu/overlay/etc/systemd/system/default.target b/boards/default/distros/ubuntu/overlay/etc/systemd/system/default.target new file mode 120000 index 00000000..a853793b --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/etc/systemd/system/default.target @@ -0,0 +1 @@ +/etc/systemd/system/firesim.target \ No newline at end of file diff --git a/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target b/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target new file mode 100644 index 00000000..5f225f3b --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target @@ -0,0 +1,4 @@ +[Unit] +Requires=multi-user.target +After=multi-user.target +AllowIsolate=yes diff --git a/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target.wants/firesim.service b/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target.wants/firesim.service new file mode 120000 index 00000000..3e9d33d8 --- /dev/null +++ b/boards/default/distros/ubuntu/overlay/etc/systemd/system/firesim.target.wants/firesim.service @@ -0,0 +1 @@ +/etc/systemd/system/firesim.service \ No newline at end of file diff --git a/boards/default/distros/ubuntu/resize.sh b/boards/default/distros/ubuntu/resize.sh new file mode 100755 index 00000000..554d5328 --- /dev/null +++ b/boards/default/distros/ubuntu/resize.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Usage: ./resize.sh UBUNTU_IMAGE NEW_SIZE_IN_BYTES + +IMG=$1 +NEWSZ=$(numfmt --from=iec $2) +REALSZ=$(du --apparent-size -b $IMG | cut -f1) + +if [ $NEWSZ -le $REALSZ ]; then + echo "Target size smaller than current size (shrinking images not currently supported)" + exit +fi + +truncate -s $NEWSZ $IMG +e2fsck -f $IMG +resize2fs $IMG diff --git a/boards/default/distros/ubuntu/ubuntu.py b/boards/default/distros/ubuntu/ubuntu.py new file mode 100644 index 00000000..9af6bd27 --- /dev/null +++ b/boards/default/distros/ubuntu/ubuntu.py @@ -0,0 +1,110 @@ +import subprocess as sp +import shutil +import pathlib +import wlutil +import re + +serviceTemplate = """[Unit] +Requires=multi-user.target +After=multi-user.target +Before=firesim.target +Wants=firesim.target + +[Service] +ExecStart=/etc/firesim/{scriptName} {scriptArgs} +StandardOutput=journal+console""" + +# Some common directories for this module (all absolute paths) +ubuntu_dir = pathlib.Path(__file__).resolve().parent + +# Temporary overlay used for applying init scripts +overlay = ubuntu_dir / 'overlay' + + +# Ubuntu doesn't support any options +def hashOpts(opts): + return None + + +# Ubuntu doesn't support any options +def mergeOpts(base, new): + return base + + +def initOpts(cfg): + return + + +class Builder: + def __init__(self, opts): + return + + def getWorkload(self): + return { + 'name': 'ubuntu-base', + 'isDistro': True, + 'distro': { + 'name': 'ubuntu', + 'opts': {} + }, + 'workdir': ubuntu_dir, + 'builder': self, + 'img': ubuntu_dir / "rootfs.img" + } + + def buildBaseImage(self, task, changed): + wlutil.run(['make', "rootfs.img"], cwd=ubuntu_dir) + + def fileDeps(self): + return [] + + # Return True if the base image is up to date, or False if it needs to be + # rebuilt. + def upToDate(self): + def checkMake(): + retcode = sp.call('make -q rootfs.img', shell=True, cwd=ubuntu_dir) + if retcode == 0: + return True + else: + return False + return [(checkMake, ())] + + def generateBootScriptOverlay(self, script, args): + # How this works: + # The ubuntu repo has a pre-built overlay with all the systemd paths + # filled in and a custom boot target (firesim.target) that loads a + # custom service (firesim.service) that runs a script (/init.sh). We + # can change the default boot behavior by changing this script. + scriptDst = overlay / 'etc/firesim/firesim.sh' + if script is not None: + print("applying script: " + str(scriptDst)) + shutil.copy(script, scriptDst) + else: + scriptDst.unlink() + # Create a blank init script because overlays won't let us delete stuff + # Alternatively: we could consider replacing the default.target + # symlink to disable the firesim target entirely + scriptDst.touch() + + scriptDst.chmod(0o755) + + # Create the service script + if args is None: + serviceScript = serviceTemplate.format(scriptName='firesim.sh', scriptArgs='') + else: + serviceScript = serviceTemplate.format(scriptName='firesim.sh', scriptArgs=' '.join(args)) + + with open(overlay / 'etc/systemd/system/firesim.service', 'w') as f: + f.write(serviceScript) + + return overlay + + def stripUart(self, lines): + stripped = [] + pat = re.compile(r".*firesim.sh\[\d*\]: (.*\n)") + for line in lines: + match = pat.match(line) + if match: + stripped.append(match.group(1)) + + return stripped diff --git a/boards/firechip/base-workloads/fedora-base/linux-config b/boards/firechip/base-workloads/fedora-base/linux-config index 55ad3e47..ba4f8215 100644 --- a/boards/firechip/base-workloads/fedora-base/linux-config +++ b/boards/firechip/base-workloads/fedora-base/linux-config @@ -21,7 +21,7 @@ CONFIG_NR_CPUS=32 # CONFIG_PCI is not set # CONFIG_POWER_SUPPLY is not set # CONFIG_SCSI is not set -# CONFIG_SERIAL_SIFIVE is not set +CONFIG_SERIAL_SIFIVE=y # CONFIG_SOC_SIFIVE is not set # CONFIG_SPI is not set # CONFIG_USB_SUPPORT is not set @@ -56,7 +56,7 @@ CONFIG_INITRAMFS_COMPRESSION_NONE=y CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_RISCV_DMA_NONCOHERENT=y -CONFIG_RISCV_ISA_ZICBOM=y +CONFIG_RISCV_ISA_ZICBOM=0 CONFIG_RISCV_ROCC=y CONFIG_STACKPROTECTOR_PER_TASK=y CONFIG_TOOLCHAIN_HAS_ZICBOM=y diff --git a/boards/firechip/base-workloads/ubuntu-base.json b/boards/firechip/base-workloads/ubuntu-base.json new file mode 100644 index 00000000..d903c5c1 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base.json @@ -0,0 +1,21 @@ +{ + "name" : "ubuntu-base", + "guest-init": "initRepos.sh", + "rootfs-size": "8GB", + "distro" : { + "name" : "ubuntu", + "opts" : {} + }, + "overlay" : "overlay", + "linux" : { + "source" : "../../linux", + "config" : "linux-config", + "modules" : { + "icenet" : "../../drivers/icenet-driver", + "iceblk" : "../../drivers/iceblk-driver" + } + }, + "firmware" : { + "opensbi-src" : "../../firmware/opensbi" + } +} diff --git a/boards/firechip/base-workloads/ubuntu-base/README b/boards/firechip/base-workloads/ubuntu-base/README new file mode 100644 index 00000000..15d4c618 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/README @@ -0,0 +1,5 @@ +Ubuntu 20.04 support in Firesim + +First time setup notes: +- When running "./marshal build ubuntu-base.json" for the first time, the process MAY end in a login prompt for Ubuntu. Login with "root:firesim", and upon login, exit Qemu with CTRL-A+X +- Login with "root:firesim" when launching with Firemarshal/Firesim diff --git a/boards/firechip/base-workloads/ubuntu-base/initRepos.sh b/boards/firechip/base-workloads/ubuntu-base/initRepos.sh new file mode 100644 index 00000000..9d80627a --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/initRepos.sh @@ -0,0 +1,3 @@ +#!/bin/bash +dnf makecache +poweroff diff --git a/boards/firechip/base-workloads/ubuntu-base/linux-config b/boards/firechip/base-workloads/ubuntu-base/linux-config new file mode 100644 index 00000000..a1f2a2e9 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/linux-config @@ -0,0 +1,65 @@ +CONFIG_AS_VERSION=23900 +# CONFIG_ATA is not set +# CONFIG_BACKLIGHT_CLASS_DEVICE is not set +CONFIG_CMDLINE="console=ttyS0 console=ttySIF0,3686400 earlycon" +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_DEFAULT_HOSTNAME="ucb" +# CONFIG_DRM is not set +CONFIG_EXT2_FS=y +# CONFIG_FB is not set +# CONFIG_HID_GENERIC is not set +# CONFIG_HWMON is not set +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_COMPAT is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_LD_VERSION=23900 +# CONFIG_MMC is not set +CONFIG_NR_CPUS=32 +# CONFIG_NVMEM_SYSFS is not set +# CONFIG_PCI is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_SCSI is not set +CONFIG_SERIAL_SIFIVE=y +# CONFIG_SOC_SIFIVE is not set +# CONFIG_SPI is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_VHOST_MENU is not set +CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y +CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y +CONFIG_AS_HAS_INSN=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +# CONFIG_CMDLINE_EXTEND is not set +# CONFIG_CMDLINE_FALLBACK is not set +CONFIG_CMDLINE_FORCE=y +CONFIG_DMA_COHERENT_POOL=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_NONCOHERENT_MMAP=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_FONT_AUTOSELECT=y +# CONFIG_I2C_ALGOPCA is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_SMBUS is not set +# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set +# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set +# CONFIG_INITRAMFS_COMPRESSION_LZ4 is not set +# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set +# CONFIG_INITRAMFS_COMPRESSION_LZO is not set +CONFIG_INITRAMFS_COMPRESSION_NONE=y +# CONFIG_INITRAMFS_COMPRESSION_XZ is not set +# CONFIG_INITRAMFS_COMPRESSION_ZSTD is not set +# CONFIG_INITRAMFS_FORCE is not set +CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_RISCV_DMA_NONCOHERENT=y +CONFIG_RISCV_ISA_ZICBOM=0 +CONFIG_RISCV_ROCC=y +CONFIG_STACKPROTECTOR_PER_TASK=y +CONFIG_TOOLCHAIN_HAS_ZICBOM=y +CONFIG_TOOLCHAIN_HAS_ZIHINTPAUSE=y +CONFIG_BLK_DEV_DM=y +CONFIG_DM_MULTIPATH=y diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-dhcp.yaml b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-dhcp.yaml new file mode 100644 index 00000000..c5adf534 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-dhcp.yaml @@ -0,0 +1,13 @@ +network: + ethernets: + zz-all-en: + dhcp4: true + match: + name: en* + optional: true + zz-all-eth: + dhcp4: true + match: + name: eth* + optional: true + version: 2 diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-static.yaml b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-static.yaml new file mode 100644 index 00000000..3e7205b7 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/50-cloud-init-static.yaml @@ -0,0 +1,20 @@ +network: + ethernets: + zz-all-en: + match: + name: + en* + addresses: [172.16.52.86/24] + dhcp4: false + gateway4: [172.16.1.1] + nameservers: + addresses: [8.8.8.8, 8.8.4.4] + zz-all-eth: + match: + name: + eth* + addresses: [172.16.52.86/24] + dhcp4: false + nameservers: + addresses: [8.8.8.8, 8.8.4.4] + version: 2 diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/start-firesim-network.sh b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/start-firesim-network.sh new file mode 100755 index 00000000..f07c95e6 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/firesim/start-firesim-network.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +#mac=$(ifconfig | grep -o "..:..:..:..:..:..") +mac=$(cat /sys/class/net/eth0/address) +macpref=$(echo $mac | cut -c 1-8 -) +echo "mac prefix:" +echo $macpref +case "$macpref" in + "00:12:6d") + echo "this looks like FireSim. starting network" + machigh=$(echo $mac | cut -c 13-14 -) + maclow=$(echo $mac | cut -c 16-17 -) + # python3 ip.py /etc/firesim/50-cloud-init-static.yaml $((16#$machigh)) $((16#$maclow)) + cp /etc/firesim/50-cloud-init-static.yaml /etc/netplan/50-cloud-init.yaml + #echo IPADDR=172.16.$((16#$machigh)).$((16#$maclow)) >> /etc/sysconfig/network-scripts/ifcfg-eth0 + ;; + "52:54:00") + echo "this looks like not FireSim. exiting" + cp /etc/firesim/50-cloud-init-dhcp.yaml /etc/netplan/50-cloud-init.yaml + ;; +esac diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/issue b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/issue new file mode 100644 index 00000000..a1d45f22 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/issue @@ -0,0 +1 @@ +Ubuntu on Firesim diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/shadow b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/shadow new file mode 100644 index 00000000..ce331c28 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/shadow @@ -0,0 +1,26 @@ +root:$6$soQup5SHA01WBVl8$Ky6UdkSnYBXuW7HEbz0YPWy1/TwU.5BTq.zxrwJbL/su81Q7hCDSOFvMawnYoroWxqqHglPDbm0pUT15E/jWo.:17869:0:99999:7::: +bin:*:17725:0:99999:7::: +daemon:*:17725:0:99999:7::: +adm:*:17725:0:99999:7::: +lp:*:17725:0:99999:7::: +sync:*:17725:0:99999:7::: +shutdown:*:17725:0:99999:7::: +halt:*:17725:0:99999:7::: +mail:*:17725:0:99999:7::: +operator:*:17725:0:99999:7::: +games:*:17725:0:99999:7::: +ftp:*:17725:0:99999:7::: +nobody:*:17725:0:99999:7::: +dbus:!!:17819:::::: +systemd-coredump:!!:17819:::::: +systemd-network:!!:17819:::::: +systemd-resolve:!!:17819:::::: +tss:!!:17819:::::: +polkitd:!!:17819:::::: +rpc:!!:17819:0:99999:7::: +geoclue:!!:17819:::::: +kojibuilder:!!:17819:::::: +rpcuser:!!:17819:::::: +chrony:!!:17819:::::: +sshd:!!:17819:::::: +pesign:!!:17819:::::: diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/firesim-net.service b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/firesim-net.service new file mode 100644 index 00000000..0d3fc1e9 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/firesim-net.service @@ -0,0 +1,14 @@ +[Unit] +Description=FireSim NIC Bringup +After=local-fs.target +Wants=local-fs.target + +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +ExecStart=/etc/firesim/start-firesim-network.sh + +[Install] +WantedBy=network.target diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service new file mode 100644 index 00000000..c01632ec --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service @@ -0,0 +1,47 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty --noclear %I $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/boards/firechip/base-workloads/ubuntu-base/overlay/usr/lib/systemd/system/getty@.service b/boards/firechip/base-workloads/ubuntu-base/overlay/usr/lib/systemd/system/getty@.service new file mode 100644 index 00000000..b13acb20 --- /dev/null +++ b/boards/firechip/base-workloads/ubuntu-base/overlay/usr/lib/systemd/system/getty@.service @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# IgnoreOnIsolate causes issues with sulogin, if someone isolates +# rescue.target or starts rescue.service from multi-user.target or +# graphical.target. +Conflicts=rescue.service +Before=rescue.service + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/hvc0 + +[Service] +# the VT is cleared by TTYVTDisallocate +# The '-o' option value tells agetty to replace 'login' arguments with an +# option to preserve environment (-p), followed by '--' for safety, and then +# the entered username. +ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear %I $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION + +[Install] +WantedBy=getty.target +DefaultInstance=hvc0 diff --git a/docs/source/distros/Ubuntu.rst b/docs/source/distros/Ubuntu.rst new file mode 100644 index 00000000..d0d28109 --- /dev/null +++ b/docs/source/distros/Ubuntu.rst @@ -0,0 +1,16 @@ +.. _ubuntu-distro: + +The Ubuntu Distribution +============================= + +Ubuntu uses the SiFive HiFive Unmatched server image of Ubuntu 20.04 found `here +`_. + +First time setup notes: + +- When running ``./marshal build ubuntu-base.json`` for the first time, the process MAY end in a login prompt for Ubuntu. Login with ``root:firesim``, and upon login, exit Qemu with CTRL-A+X. + +- Login with ``root:firesim`` when launching with Firemarshal/Firesim. + +- If you need to install precompiled packages you can boot the image in QEMU and first run ``sudo apt update && sudo apt upgrade``. + Afterwards you can ``apt`` install anything you need. Make sure the rootfs size is large enough to run all the commands (default is 8GB).