From 84e1f148c2123c585dcf440ffc80455eaedeb440 Mon Sep 17 00:00:00 2001 From: WangRunji Date: Sun, 9 Sep 2018 03:02:42 +0800 Subject: [PATCH] Remove legacy env files. --- docker/.bash_aliases | 1 - docker/Dockerfile | 40 ---------------------------------------- docker/README.md | 18 ------------------ docker/entrypoint.sh | 19 ------------------- macOS-env/README.md | 16 ---------------- macOS-env/grub.rb | 31 ------------------------------- macOS-env/objconv.rb | 23 ----------------------- riscv-env/Dockerfile | 38 -------------------------------------- 8 files changed, 186 deletions(-) delete mode 100644 docker/.bash_aliases delete mode 100644 docker/Dockerfile delete mode 100644 docker/README.md delete mode 100755 docker/entrypoint.sh delete mode 100644 macOS-env/README.md delete mode 100644 macOS-env/grub.rb delete mode 100644 macOS-env/objconv.rb delete mode 100644 riscv-env/Dockerfile diff --git a/docker/.bash_aliases b/docker/.bash_aliases deleted file mode 100644 index 6ddc1be..0000000 --- a/docker/.bash_aliases +++ /dev/null @@ -1 +0,0 @@ -PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[1;35m\]<$IMAGE_NAME>\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 396f214..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM rustlang/rust:nightly - -ENV IMAGE_NAME=blog_os-docker - -RUN apt-get update && \ - apt-get install -q -y --no-install-recommends \ - nasm \ - binutils \ - grub-common \ - xorriso \ - grub-pc-bin && \ - apt-get autoremove -q -y && \ - apt-get clean -q -y && \ - rm -rf /var/lib/apt/lists/* && \ - cargo install xargo && \ - rustup component add rust-src - -ENV GOSU_VERSION 1.10 - -RUN set -ex; \ - \ - fetchDeps=' \ - ca-certificates \ - wget \ - '; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - \ - dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ - wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ - chmod +x /usr/local/bin/gosu; \ -# verify that the binary works - gosu nobody true; - -COPY entrypoint.sh /usr/local/bin/ -COPY .bash_aliases /etc/skel/ - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -CMD ["/bin/bash"] diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 3d28777..0000000 --- a/docker/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Building Blog OS using Docker -Inspired by [redox]. -You just need `git`, `make`, and `docker`. -It is beter to use a non-privileged user to run the `docker` command, which is usually achieved by adding the user to the `docker` group. - -## Run the container to build Blog OS -You can build the docker image using `make docker_build` and run it using `make docker_run`. - -## Run the container interactively -You can use the `make` target `docker_interactive` to get a shell in the container. - -## Clear the toolchain caches (Cargo & Rustup) -To clean the docker volumes used by the toolchain, you just need to run `make docker_clean`. - -[redox]: https://github.com/redox-os/redox - -## License -The source code is dual-licensed under MIT or the Apache License (Version 2.0). This excludes the `blog` directory. diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index f8abd58..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -USER_NAME=blogos -USER_UID=${LOCAL_UID:-9001} -USER_GID=${LOCAL_GID:-9001} - -groupadd --non-unique --gid $USER_GID $USER_NAME -useradd --non-unique --create-home --uid $USER_UID --gid $USER_GID $USER_NAME - -export HOME=/home/$USER_NAME - -TESTFILE=$RUSTUP_HOME/settings.toml -CACHED_UID=$(stat -c "%u" $TESTFILE) -CACHED_GID=$(stat -c "%g" $TESTFILE) - -if [ $CACHED_UID != $USER_UID ] || [ $USER_GID != $CACHED_GID ]; then - chown $USER_UID:$USER_GID -R $CARGO_HOME $RUSTUP_HOME -fi - -exec gosu $USER_NAME "$@" diff --git a/macOS-env/README.md b/macOS-env/README.md deleted file mode 100644 index 06fff74..0000000 --- a/macOS-env/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# MacOS environment - -``` bash -brew tap altkatz/homebrew-gcc_cross_compilers -brew install x64-elf-gcc -``` - -* x86_64_elf_*: - - -* grub.rb: - - -* objconv.rb: - - Change SHA256 \ No newline at end of file diff --git a/macOS-env/grub.rb b/macOS-env/grub.rb deleted file mode 100644 index fec68c6..0000000 --- a/macOS-env/grub.rb +++ /dev/null @@ -1,31 +0,0 @@ -class Grub < Formula - desc "GNU GRUB 2 targetting i386-elf" - homepage "https://www.gnu.org/software/grub/" - url "https://ftp.gnu.org/gnu/grub/grub-2.02.tar.xz" - version "2.02" - sha256 "810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f" - - depends_on "i386-elf-gcc" - - def install - mkdir "grub-build" do - system "../configure", - "--disable-nls", - "--disable-werror", - "--disable-efiemu", - "--target=i386-elf", - "--prefix=#{prefix}", - "TARGET_CC=i386-elf-gcc", - "TARGET_NM=i386-elf-nm", - "TARGET_OBJCOPY=i386-elf-objcopy", - "TARGET_RANLIB=i386-elf-ranlib", - "TARGET_STRIP=i386-elf-strip" - - system "make", "install" - end - end - - test do - system "grub-shell", "--version" - end -end \ No newline at end of file diff --git a/macOS-env/objconv.rb b/macOS-env/objconv.rb deleted file mode 100644 index 517b266..0000000 --- a/macOS-env/objconv.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Objconv < Formula - desc "Object file converter and disassembler" - homepage "http://www.agner.org/optimize/#objconv" - url "http://www.agner.org/optimize/objconv.zip" - version "2.44" - sha256 "f2c0c4cd6ff227e76ffed5796953cd9ae9eb228847ca9a14dba6392c573bb7a4" - def install - system "unzip", "source.zip", - "-dsrc" - # objconv doesn't have a Makefile, so we have to call - # the C++ compiler ourselves - system ENV.cxx, "-o", "objconv", - "-O2", - *Dir["src/*.cpp"], - "--prefix=#{prefix}" - bin.install "objconv" - end - - test do - system "#{bin}/objconv", "-h" - # TODO: write better tests - end -end diff --git a/riscv-env/Dockerfile b/riscv-env/Dockerfile deleted file mode 100644 index 69a1f2e..0000000 --- a/riscv-env/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# Environment for RustOS-RISCV - -# NOT ubuntu 18.04: libmpfr.so.4 error -FROM ubuntu:17.10 - -WORKDIR /rust - -# Rust toolchain bins -# https://github.com/riscv-rust/rust/releases/download/riscv-rust-1.26.0-1-dev/rust-1.26.0-dev-x86_64-unknown-linux-gnu.tar.xz -ADD rust-1.26.0-dev-x86_64-unknown-linux-gnu.tar.xz . - -# Rust src -# https://github.com/riscv-rust/rust/archive/riscv-rust-1.26.0-1-dev.zip -# with submodule: libcompiler_builtins, stdsimd -ADD rust-riscv-rust-1.26.0-1-dev.tar.gz . - -# RISCV32 toolchain -# From tencent cloud for OS2018: ssh 2015011279@140.143.187.14 -ADD rv32-toolchains-prebuild.tar.bz2 . - -# Dependencies -RUN apt-get update && apt-get install -q -y --no-install-recommends libssl1.0.0 libssh2-1 gcc make git libc6-dev \ - autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev -# Rust bins need this -RUN mkdir -p /gnu/store/n6acaivs0jwiwpidjr551dhdni5kgpcr-glibc-2.26.105-g0890d5379c/lib \ - && ln -s /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /gnu/store/n6acaivs0jwiwpidjr551dhdni5kgpcr-glibc-2.26.105-g0890d5379c/lib/ld-linux-x86-64.so.2 -# Install Rust toolchains -RUN ./rust-1.26.0-dev-x86_64-unknown-linux-gnu/install.sh && rm -rf ./rust-1.26.0-dev-x86_64-unknown-linux-gnu -# Install xargo -RUN apt-get install -q -y ca-certificates -RUN cargo install xargo -# Dependencies for qemu-system-riscv32 -RUN apt-get install -q -y libglib2.0-0 libjpeg8 libpng16-16 libnuma1 libpixman-1-0 libaio1 -# Env -ENV RISCV=/rust/install-rv32 -ENV PATH=~/.cargo/bin:$RISCV/bin:$PATH -ENV XARGO_RUST_SRC=/rust/rust-riscv-rust-1.26.0-1-dev/src -RUN ln -s ~/.cargo/bin/xargo /usr/local/bin/xargo \ No newline at end of file