-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
66 lines (54 loc) · 2.56 KB
/
Dockerfile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# By Andrew Paradi | Source at https://github.com/adrw/docker-cs350-os161
FROM debian:7
LABEL Andrew Paradi <[email protected]>
# sets up a Docker image according to the instructions on https://www.student.cs.uwaterloo.ca/~build/common/Install161NonCS.html
# preliminary setup
RUN apt-get update && \
apt-get install build-essential --yes && \
apt-get install wget --yes && \
apt-get install libncurses5-dev --yes
# step 1: downloads all of the files listed in the Step 1 table on the instructions page
WORKDIR /root/cs350
RUN bash -c "wget -r -l 1 -nd -nH -A gz --no-check-certificate https://www.student.cs.uwaterloo.ca/~cs350/common/Install161NonCS.html" && \
for file in $(ls *.tar.gz); do tar -xf $file; done; rm *.tar.gz && \
apt-get remove wget --yes
# step 2: install binutils for os161
WORKDIR /root/cs350/binutils-2.17+os161-2.0.1
RUN ./configure --nfp --disable-werror --target=mips-harvard-os161 --prefix=/root/sys161/tools && \
make && \
make install
# step 3: put sys161 stuff on the PATH
RUN mkdir /root/sys161/bin
ENV PATH /root/sys161/bin:/root/sys161/tools/bin:$PATH
RUN echo "export PATH=$PATH" > $HOME/.bashrc
# step 4: install GCC MIPS cross-compiler
WORKDIR /root/cs350/gcc-4.1.2+os161-2.0
RUN ./configure -nfp --disable-shared --disable-threads --disable-libmudflap --disable-libssp --target=mips-harvard-os161 --prefix=/root/sys161/tools && \
make && \
make install
# step 5: install GDB for os161
WORKDIR /root/cs350/gdb-6.6+os161-2.0
RUN ./configure --target=mips-harvard-os161 --prefix=/root/sys161/tools --disable-werror && \
make && \
make install
# step 6: install bmake for os161
WORKDIR /root/cs350/bmake
RUN ./boot-strap --prefix=/root/sys161/tools | sed '1,/Commands to install into \/root\/sys161\/tools\//d' | bash
# step 7: set up links for toolchain binaries
RUN mkdir --parents /root/sys161/bin
WORKDIR /root/sys161/tools/bin
RUN bash -c 'for i in mips-*; do ln -s /root/sys161/tools/bin/$i /root/sys161/bin/cs350-`echo $i | cut -d- -f4-`; done' && \
ln -s /root/sys161/tools/bin/bmake /root/sys161/bin/bmake
# step 8: install sys161
WORKDIR /root/cs350/sys161-1.99.06
RUN ./configure --prefix=/root/sys161 mipseb && \
make && \
make install && \
ln -s /root/sys161/share/examples/sys161/sys161.conf.sample /root/sys161/sys161.conf
# step 9: install os161
# extracting the archive should be done on the host side
VOLUME /root/cs350-os161
# cleanup
RUN bash -c "rm -rf /root/cs350; mkdir -p /root/cs350"
# make sure to start commands in the os161 folder
WORKDIR /root/cs350-os161