-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arch Linux: don't make
build
dir in Dockerfile
- Loading branch information
Showing
2 changed files
with
20 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
FROM archlinux:latest | ||
LABEL maintainer "TAKANO Mitsuhiro <[email protected]>" | ||
|
||
ENV BUILD_DIR=/build-kernel/build | ||
|
||
RUN mkdir /build-kernel | ||
RUN mkdir /build-kernel/build | ||
RUN mkdir /build-kernel/zst-pkg | ||
|
||
RUN yes | pacman -Sy git | ||
|
||
RUN yes | pacman -S asp base-devel | ||
RUN yes | pacman -S pacman-contrib | ||
RUN pacman-db-upgrade | ||
RUN pacman -Syyu --noconfirm | ||
|
||
RUN pacman -S --noconfirm git | ||
RUN pacman -S --noconfirm asp base-devel | ||
RUN pacman -S --noconfirm pacman-contrib | ||
RUN pacman -Scc | ||
|
||
RUN useradd takano32 | ||
RUN mkdir /build-kernel | ||
RUN mkdir /home/takano32 | ||
RUN chown -R takano32.takano32 /build-kernel /home/takano32 | ||
RUN echo "takano32 ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/takano32 | ||
ENV SUDO="sudo -u takano32" | ||
|
||
RUN cd $BUILD_DIR && $SUDO asp update linux | ||
RUN cd $BUILD_DIR && $SUDO asp export linux | ||
RUN cd $BUILD_DIR/linux && $SUDO updpkgsums | ||
RUN cd $BUILD_DIR/linux && yes | $SUDO makepkg -seo | ||
RUN $SUDO git config --global http.version HTTP/1.1 | ||
RUN $SUDO git config --global http.postBuffer 524288000 | ||
RUN while :; do cd $BUILD_DIR/linux && $SUDO makepkg -o --skippgpcheck && break || sleep 5; done | ||
|
||
COPY ./archlinux/entrypoint.sh / | ||
RUN chmod 755 /entrypoint.sh | ||
EXPOSE 8000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
BUILD_DIR=/build-kernel/build | ||
SUDO="sudo -u takano32" | ||
|
||
chown -R takano32:takano32 /build-kernel/build | ||
$SUDO mkdir -p /build-kernel/build/linux | ||
$SUDO rm -rf /build-kernel/build/linux | ||
$SUDO mkdir -p /build-kernel/build/linux | ||
cd /build-kernel/build/linux | ||
mkdir -p $BUILD_DIR | ||
chown -R takano32:takano32 $BUILD_DIR | ||
|
||
cd $BUILD_DIR | ||
$SUDO asp update linux | ||
$SUDO asp export linux | ||
$SUDO cp -a linux/* . | ||
$SUDO rm -rf linux | ||
|
||
# `makepkg` in `/build-kernel/bulid/linux` | ||
cd $BUILD_DIR/linux | ||
$SUDO updpkgsums && yes | $SUDO makepkg -seo | ||
$SUDO git config --global http.version HTTP/1.1 | ||
$SUDO git config --global http.postBuffer 524288000 | ||
while :; do $SUDO makepkg -o --skippgpcheck && break || sleep 5; done | ||
|
||
# `makepkg` in `$BUILD_DIR/linux` | ||
$SUDO makepkg --skippgpcheck | ||
|
||
cd /build-kernel/build | ||
cd $BUILD_DIR | ||
mv linux/src/archlinux-linux/Documentation/output ../htmldocs | ||
mkdir /build-kernel/zst-pkg | ||
mv linux/*.zst ../zst-pkg | ||
cd .. | ||
|
||
if ! "$CI"; then | ||
python3 -m http.server | ||
fi | ||
|
||
|