Update Dockerfile with buildroot info.

This commit is contained in:
Kunlin Han 2024-03-24 19:22:13 -07:00
parent f45bdc1a65
commit 5f3b8cc868
6 changed files with 6389 additions and 3 deletions

View File

@ -4,6 +4,8 @@ FROM wallysoc/ubuntu_wally
# assume 4 threads are available to speed up # assume 4 threads are available to speed up
ARG NUM_THREADS=4 ARG NUM_THREADS=4
ENV RISCV=/opt/riscv ENV RISCV=/opt/riscv
ENV PATH="$PATH:${RISCV}/bin"
ENV MANPATH="$MANPATH:${RISCV}/share/man"
WORKDIR /opt/riscv WORKDIR /opt/riscv
@ -63,17 +65,21 @@ RUN opam init -y --disable-sandboxing && \
cd sail-riscv && \ cd sail-riscv && \
ARCH=RV32 make c_emulator/riscv_sim_RV32 && \ ARCH=RV32 make c_emulator/riscv_sim_RV32 && \
ARCH=RV64 make c_emulator/riscv_sim_RV64 && \ ARCH=RV64 make c_emulator/riscv_sim_RV64 && \
ln -s ${RISCV}/sail-riscv/c_emulator/riscv_sim_RV64 ${RISCV}/bin/riscv_sim_RV64 && \ cp ${RISCV}/sail-riscv/c_emulator/riscv_sim_RV64 ${RISCV}/bin/riscv_sim_RV64 && \
ln -s ${RISCV}/sail-riscv/c_emulator/riscv_sim_RV32 ${RISCV}/bin/riscv_sim_RV32 && \ cp ${RISCV}/sail-riscv/c_emulator/riscv_sim_RV32 ${RISCV}/bin/riscv_sim_RV32 && \
rm -rf ${RISCV}/sail-riscv rm -rf ${RISCV}/sail-riscv
COPY ./wally /opt/riscv/wally_buildroot
# Buildroot # Buildroot
RUN git clone https://github.com/buildroot/buildroot.git && \ RUN git clone https://github.com/buildroot/buildroot.git && \
cd buildroot && \ cd buildroot && \
git checkout 2021.05 && \ git checkout 2021.05 && \
# cp -r /opt/riscv/riscv-wally/linux/buildroot-config-src/wally ./board && \ # cp -r /opt/riscv/riscv-wally/linux/buildroot-config-src/wally ./board && \
# cp ./board/wally/main.config .config && \ # cp ./board/wally/main.config .config && \
wget https://raw.githubusercontent.com/openhwgroup/cvw/main/linux/buildroot-config-src/wally/main.config -o .config && \ cp -r /opt/riscv/wally_buildroot ./board/wally && \
cp ./board/wally/main.config .config && \
# wget https://raw.githubusercontent.com/openhwgroup/cvw/main/linux/buildroot-config-src/wally/main.config -O .config && \
make --jobs ${NUM_THREADS} make --jobs ${NUM_THREADS}
RUN pip3 install --no-cache-dir \ RUN pip3 install --no-cache-dir \

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
echo "Hello this ~/.profile is meant to demonstrate running some basic commands on Wally."
echo "I am $(whoami)"
echo "And I am on $(hostname)"
touch myFile.txt
echo "Hello World!" > myFile.txt
echo "And farewell!" >> myFile.txt
mkdir myDir
mv myFile.txt myDir
echo "Created myFile.txt and moved it to myDir. It contains:"
cat myDir/myFile.txt
touch myScript.sh
echo "echo \"Hello this is another example script\"" > myScript.sh
chmod +x myScript.sh
echo "Created myScript.sh. Running it yields:"
./myScript.sh
cd myDir
ln -s ../myScript.sh symLinkToMyScript.sh
echo "Created symLinkToMyScript.sh. Running it yields:"
./symLinkToMyScript.sh
echo "Now let's remove all these example files and scripts"
cd /
rm -r myDir
rm myScript.sh
echo "Here is disk usage:"
df -h
echo "And here are the current processes:"
ps
echo "And finally a login prompt."
login

View File

@ -0,0 +1,41 @@
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a
::sysinit:/sbin/swapon -a
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS
# (commented out) Put a getty on the serial port
#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL
# Actually no, let's automatically login
console::respawn:-/bin/sh
# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r