diff --git a/boards/default/distros/fedoradev/.gitignore b/boards/default/distros/fedoradev/.gitignore new file mode 100644 index 00000000..292684fd --- /dev/null +++ b/boards/default/distros/fedoradev/.gitignore @@ -0,0 +1,2 @@ +rootfs.img +rootfs.img.xz diff --git a/boards/default/distros/fedoradev/Makefile b/boards/default/distros/fedoradev/Makefile new file mode 100644 index 00000000..016d68b1 --- /dev/null +++ b/boards/default/distros/fedoradev/Makefile @@ -0,0 +1,15 @@ +RAWURL=http://fedora.riscv.rocks/kojifiles/work/tasks/944/320944/Fedora-Developer-Rawhide-20200108.n.0-sda.raw.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=1007616 + +$(COMPIMG): + curl $(RAWURL) -o $(COMPIMG) + +clean: + rm -f $(COMPIMG) $(RAWIMG) $(NEWIMG) + diff --git a/boards/default/distros/fedoradev/__init__.py b/boards/default/distros/fedoradev/__init__.py new file mode 100644 index 00000000..71a8bb08 --- /dev/null +++ b/boards/default/distros/fedoradev/__init__.py @@ -0,0 +1 @@ +from .fedoradev import * # NOQA diff --git a/boards/default/distros/fedoradev/fedoradev.py b/boards/default/distros/fedoradev/fedoradev.py new file mode 100644 index 00000000..9e9e19ac --- /dev/null +++ b/boards/default/distros/fedoradev/fedoradev.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) +feddev_dir = pathlib.Path(__file__).resolve().parent + +# Temporary overlay used for applying init scripts +overlay = feddev_dir / 'overlay' + + +# Fedora doesn't support any options +def hashOpts(opts): + return None + + +# Fedora 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': 'fedoradev-base', + 'isDistro': True, + 'distro': { + 'name': 'fedoradev', + 'opts': {} + }, + 'workdir': feddev_dir, + 'builder': self, + 'img': feddev_dir / "rootfs.img" + } + + def buildBaseImage(self): + wlutil.run(['make', "rootfs.img"], cwd=feddev_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=feddev_dir) + if retcode == 0: + return True + else: + return False + return [(checkMake, ())] + + def generateBootScriptOverlay(self, script, args): + # How this works: + # The fedora 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/default/distros/fedoradev/overlay/.gitignore b/boards/default/distros/fedoradev/overlay/.gitignore new file mode 100644 index 00000000..8c93fc7a --- /dev/null +++ b/boards/default/distros/fedoradev/overlay/.gitignore @@ -0,0 +1 @@ +etc/systemd/system/firesim.service diff --git a/boards/default/distros/fedoradev/overlay/etc/firesim/.gitignore b/boards/default/distros/fedoradev/overlay/etc/firesim/.gitignore new file mode 100644 index 00000000..fd1ff69a --- /dev/null +++ b/boards/default/distros/fedoradev/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/fedoradev/overlay/etc/fstab b/boards/default/distros/fedoradev/overlay/etc/fstab new file mode 100644 index 00000000..4534a1b0 --- /dev/null +++ b/boards/default/distros/fedoradev/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/fedoradev/overlay/etc/systemd/system/default.target b/boards/default/distros/fedoradev/overlay/etc/systemd/system/default.target new file mode 120000 index 00000000..a853793b --- /dev/null +++ b/boards/default/distros/fedoradev/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/fedoradev/overlay/etc/systemd/system/firesim.target b/boards/default/distros/fedoradev/overlay/etc/systemd/system/firesim.target new file mode 100644 index 00000000..5f225f3b --- /dev/null +++ b/boards/default/distros/fedoradev/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/fedoradev/overlay/etc/systemd/system/firesim.target.wants/firesim.service b/boards/default/distros/fedoradev/overlay/etc/systemd/system/firesim.target.wants/firesim.service new file mode 120000 index 00000000..3e9d33d8 --- /dev/null +++ b/boards/default/distros/fedoradev/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/fedoradev/resize.sh b/boards/default/distros/fedoradev/resize.sh new file mode 100644 index 00000000..c52f3746 --- /dev/null +++ b/boards/default/distros/fedoradev/resize.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Usage: ./resize.sh FEDORA_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/firechip/base-workloads/fedoradev-base.json b/boards/firechip/base-workloads/fedoradev-base.json new file mode 100644 index 00000000..fbd7a902 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base.json @@ -0,0 +1,22 @@ +{ + "name": "fedoradev-base", + "guest-init": "initRepos.sh", + "distro": { + "name": "fedoradev", + "opts": {} + }, + "overlay": "overlay", + "linux": { + "source": "../../linux", + "config": "linux-config", + "modules": { + "icenet": "../../drivers/icenet-driver", + "iceblk": "../../drivers/iceblk-driver" + } + }, + "firmware": { + "use-bbl": false, + "bbl-src": "../../firmware/riscv-pk", + "opensbi-src": "../../firmware/opensbi" + } +} diff --git a/boards/firechip/base-workloads/fedoradev-base/initRepos.sh b/boards/firechip/base-workloads/fedoradev-base/initRepos.sh new file mode 100644 index 00000000..9d80627a --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/initRepos.sh @@ -0,0 +1,3 @@ +#!/bin/bash +dnf makecache +poweroff diff --git a/boards/firechip/base-workloads/fedoradev-base/linux-config b/boards/firechip/base-workloads/fedoradev-base/linux-config new file mode 100644 index 00000000..b578635a --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/linux-config @@ -0,0 +1,315 @@ +# CONFIG_ATA is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +# CONFIG_BPF_SYSCALL is not set +CONFIG_BRIDGE=y +# CONFIG_BUILD_BIN2C is not set +# CONFIG_CGROUP_SCHED is not set +# CONFIG_CHECKPOINT_RESTORE is not set +CONFIG_CMDLINE="console=hvc0 earlycon=sbi" +CONFIG_CMDLINE_FORCE=y +# CONFIG_CROSS_MEMORY_ATTACH is not set +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_ECHAINIV=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_HW is not set +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SHA256=y +# CONFIG_CRYPTO_USER_API_HASH is not set +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_DEFAULT_HOSTNAME="ucbvax" +CONFIG_DEVKMEM=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_DNOTIFY is not set +# CONFIG_DRM is not set +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_PERF_EVENTS=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +CONFIG_COMPAT_BRK=y +CONFIG_SLUB=y +CONFIG_SLAB_MERGE_DEFAULT=y +CONFIG_PROFILING=y +CONFIG_EXT2_FS=y +CONFIG_EXT4_DEBUG=y +CONFIG_EXT4_FS_SECURITY=y +# CONFIG_FB_CFB_COPYAREA is not set +# CONFIG_FB_CFB_FILLRECT is not set +# CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_HWMON is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_I2C is not set +# CONFIG_IKCONFIG is not set +# CONFIG_INET_DIAG is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_PNP is not set +CONFIG_JBD2_DEBUG=y +# CONFIG_KEYS is not set +CONFIG_MAILBOX=y +# CONFIG_MDIO_BUS is not set +# CONFIG_MDIO_DEVICE is not set +# CONFIG_MISC_FILESYSTEMS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_NETWORK_FILESYSTEMS is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_AGERE is not set +# CONFIG_NET_VENDOR_ALACRITECH is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMAZON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_AQUANTIA is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +# CONFIG_NET_VENDOR_AURORA is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EZCHIP is not set +# CONFIG_NET_VENDOR_HP is not set +# CONFIG_NET_VENDOR_HUAWEI is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NETRONOME is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_ROCKER is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_SOLARFLARE is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_PCIEPORTBUS is not set +# CONFIG_PCIE_XILINX is not set +# CONFIG_PHYLIB is not set +CONFIG_PM=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_RAS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SG_POOL is not set +# CONFIG_SOCK_CGROUP_DATA is not set +CONFIG_STACKTRACE=y +# CONFIG_SYNC_FILE is not set +# CONFIG_SYSVIPC is not set +CONFIG_THERMAL=y +# CONFIG_USB_SUPPORT is not set +# CONFIG_USER_NS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_VT is not set +# CONFIG_WIRELESS is not set +# CONFIG_WLAN is not set +# CONFIG_ACORN_PARTITION is not set +# CONFIG_AIX_PARTITION is not set +# CONFIG_ALTERA_MBOX is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set +# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set +# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set +# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set +# CONFIG_ARM_GIC_V3_ITS is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_ATMEL_PIT is not set +# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set +# CONFIG_BINARY_PRINTF is not set +CONFIG_BLK_DEBUG_FS=y +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_DAC960 is not set +CONFIG_BLK_DEV_RV_GENERIC=y +CONFIG_BOUNCE=y +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_CC_STACKPROTECTOR is not set +# CONFIG_CHASH is not set +CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set +# CONFIG_CMDLINE_PARTITION is not set +# CONFIG_COMMON_CLK_NXP is not set +# CONFIG_COMMON_CLK_PIC32 is not set +# CONFIG_COMMON_CLK_PXA is not set +# CONFIG_CPU_NO_EFFICIENT_FFS is not set +CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y +CONFIG_CROSS_COMPILE="riscv64-unknown-linux-gnu-" +# CONFIG_CRYPTO_MCRYPTD is not set +# CONFIG_CXL_AFU_DRIVER_OPS is not set +# CONFIG_CXL_BASE is not set +# CONFIG_CXL_LIB is not set +CONFIG_DEFAULT_CFQ=y +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_DMA_NOOP_OPS=y +# CONFIG_DMA_VIRT_OPS is not set +# CONFIG_DRM_LIB_RANDOM is not set +# CONFIG_DYNAMIC_DEBUG is not set +CONFIG_EARLY_PRINTK=y +# CONFIG_EM_TIMER_STI is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT2_FS_XATTR=y +# CONFIG_FB_AUO_K190X is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FIRMWARE_IN_KERNEL is not set +# CONFIG_FREEZER is not set +# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +# CONFIG_GCOV_KERNEL is not set +CONFIG_GENERIC_HANDLE_IRQ=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +# CONFIG_HAVE_ARCH_HASH is not set +# CONFIG_HAVE_ARCH_VMAP_STACK is not set +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_DMA_API_DEBUG=y +# CONFIG_HAVE_KPROBES is not set +CONFIG_HAVE_MEMBLOCK=y +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_HYPERV_TSCPAGE is not set +CONFIG_ICENET=y +CONFIG_ICENET_RING_SIZE=64 +# CONFIG_INET6_TUNNEL is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET_XFRM_TUNNEL is not set +CONFIG_IOSCHED_CFQ=y +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IOSCHED_NOOP=y +# CONFIG_IPV6_FOU is not set +# CONFIG_IPV6_FOU_TUNNEL is not set +# CONFIG_IPX is not set +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_ISA_BUS_API is not set +# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_LKDTM is not set +CONFIG_LLC=y +# CONFIG_MAC_PARTITION is not set +# CONFIG_MAILBOX_TEST is not set +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_RTSX_PCI is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_CADENCE is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_NET_PTP_CLASSIFY is not set +# CONFIG_NET_UDP_TUNNEL is not set +# CONFIG_NET_VENDOR_EXAR is not set +CONFIG_NO_BOOTMEM=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +# CONFIG_OSF_PARTITION is not set +CONFIG_PCI_BUS_ADDR_T_64BIT=y +# CONFIG_PCI_MSI_IRQ_DOMAIN is not set +# CONFIG_PLATFORM_MHU is not set +CONFIG_PM_CLK=y +# CONFIG_PM_DEBUG is not set +# CONFIG_PROBE_EVENTS is not set +# CONFIG_PROVE_RCU is not set +# CONFIG_QORIQ_THERMAL is not set +# CONFIG_QUOTACTL is not set +CONFIG_RISCV_INTC=y +CONFIG_RISCV_PLIC=y +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_SCHED_HRTICK is not set +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_SERIAL_8250_FSL is not set +# CONFIG_SERIAL_SIFIVE is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_SG_SPLIT is not set +# CONFIG_SH_TIMER_CMT is not set +# CONFIG_SH_TIMER_MTU2 is not set +# CONFIG_SH_TIMER_TMU is not set +# CONFIG_SIMPLE_PM_BUS is not set +# CONFIG_SOC_SIFIVE is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +CONFIG_STP=y +# CONFIG_STREAM_PARSER is not set +# CONFIG_SUNXI_SRAM is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_SYSTEM_DATA_VERIFICATION is not set +# CONFIG_SYSV68_PARTITION is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_TASKS_RCU is not set +# CONFIG_TEST_FIND_BIT is not set +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_GOV_BANG_BANG is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_OF=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THIN_ARCHIVES=y +# CONFIG_TORTURE_TEST is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_VGASTATE is not set +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_ZONE_DMA=y diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-dhcp b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-dhcp new file mode 100644 index 00000000..25272f5b --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-dhcp @@ -0,0 +1,3 @@ +DEVICE=eth0 +BOOTPROTO=dhcp +ONBOOT=on diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-static b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-static new file mode 100644 index 00000000..a35932cd --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/ifcfg-static @@ -0,0 +1,4 @@ +DEVICE=eth0 +BOOTPROTO=static +ONBOOT=on +PREFIX=16 diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/start-firesim-network.sh b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/start-firesim-network.sh new file mode 100644 index 00000000..39d6c4cf --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/firesim/start-firesim-network.sh @@ -0,0 +1,20 @@ +#!/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 -) + cp /etc/firesim/ifcfg-static /etc/sysconfig/network-scripts/ifcfg-eth0 + 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/ifcfg-dhcp /etc/sysconfig/network-scripts/ifcfg-eth0 + ;; +esac diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/issue b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/issue new file mode 100644 index 00000000..c107ce1b --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/issue @@ -0,0 +1,24 @@ +Welcome to the Fedora/RISC-V disk image +https://fedoraproject.org/wiki/Architectures/RISC-V + +Build date: Mon Oct 15 17:13:58 UTC 2018 + +Kernel \r on an \m (\l) + +The root password is ‘firesim’. + +To install new packages use 'dnf install ...' + +To upgrade disk image use 'dnf upgrade --best' + +If DNS isn’t working, try editing ‘/etc/yum.repos.d/fedora-riscv.repo’. + +For updates and latest information read: +https://fedorapeople.org/groups/risc-v/disk-images/readme.txt + +Fedora/RISC-V +------------- +Koji: http://fedora-riscv.tranquillity.se/koji/ +SCM: http://fedora-riscv.tranquillity.se:3000/ +Distribution rep.: http://fedora-riscv.tranquillity.se/repos-dist/ +Koji internal rep.: http://fedora-riscv.tranquillity.se/repos/ diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/shadow b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/shadow new file mode 100644 index 00000000..ce331c28 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-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/fedoradev-base/overlay/etc/systemd/system/firesim-net.service b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/firesim-net.service new file mode 100644 index 00000000..0d3fc1e9 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-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/fedoradev-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service new file mode 120000 index 00000000..7bfe0808 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/getty.target.wants/getty@hvc0.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/getty@.service \ No newline at end of file diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/network.target.wants/firesim-net.service b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/network.target.wants/firesim-net.service new file mode 120000 index 00000000..befaef14 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/systemd/system/network.target.wants/firesim-net.service @@ -0,0 +1 @@ +/etc/systemd/system/firesim-net.service \ No newline at end of file diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/etc/yum.repos.d/fedora-riscv.repo b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/yum.repos.d/fedora-riscv.repo new file mode 100644 index 00000000..b8f75687 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-base/overlay/etc/yum.repos.d/fedora-riscv.repo @@ -0,0 +1,17 @@ +[fedora-riscv] +name=Fedora RISC-V +baseurl=http://fedora.riscv.rocks/repos-dist/rawhide/latest/riscv64/ +enabled=1 +gpgcheck=0 + +[fedora-riscv-debuginfo] +name=Fedora RISC-V - Debug +baseurl=http://fedora.riscv.rocks/repos-dist/rawhide/latest/riscv64/debug/ +enabled=0 +gpgcheck=0 + +[fedora-riscv-source] +name=Fedora RISC-V - Source +baseurl=http://fedora.riscv.rocks/repos-dist/rawhide/latest/riscv64/latest/src/ +enabled=0 +gpgcheck=0 diff --git a/boards/firechip/base-workloads/fedoradev-base/overlay/usr/lib/systemd/system/getty@.service b/boards/firechip/base-workloads/fedoradev-base/overlay/usr/lib/systemd/system/getty@.service new file mode 100644 index 00000000..b13acb20 --- /dev/null +++ b/boards/firechip/base-workloads/fedoradev-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