Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:18.04
ENV LFS /

RUN apt-get update
RUN apt-get install -y build-essential openssh-server python3 gawk bison texinfo kpartx
RUN apt-get install -y build-essential openssh-server python3 gawk bison texinfo kpartx parallel

RUN mkdir -p /root/.ssh
RUN chmod 0700 /root/.ssh
Expand All @@ -12,8 +12,10 @@ RUN sed -i s/^#PasswordAuthentication\ yes/PasswordAuthentication\ no/ /etc/ssh/
RUN sed -i s/^#PermitRootLogin\ prohibit-password/PermitRootLogin\ yes/ /etc/ssh/sshd_config
RUN sed -i -e 's/^root:!:/root::/' /etc/shadow

RUN wget https://github.com/mvanveen.keys -O /root/.ssh/authorized_keys

WORKDIR /root
ADD script/ .
ADD packages.txt .
ADD run.sh .
ADD pkg/prep/ .

CMD ["/bin/sh", "run.sh"]
CMD ["/bin/bash", "run.sh"]
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker-build:
docker-run:
#docker run -v sources:/sources -p 2222:22 -d linuxfromscratch
#-v ${CURDIR}/lfs.img:/root/lfs.img
docker run -p 2222:22 -d --privileged linuxfromscratch
docker run -p 2222:22 --privileged linuxfromscratch

docker-kill:
./kill_container.sh
Expand Down Expand Up @@ -71,4 +71,5 @@ build-pkgs:
scp -P 2222 pkg/build/* root@localhost:/mnt/lfs/tools && ssh -p 2222 root@localhost "sh /tools/run-build.sh"


all: docker-kill clean docker-build docker-run run-stage0 ext4-img run-stage1 dl-sources prep-pkgs build-pkgs
all: docker-kill clean docker-build docker-run run-stage0 ext4-img run-stage1 dl-sources prep-pkgs build-pkgs
x-all: docker-kill clean docker-build docker-run
64 changes: 63 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1 +1,63 @@
service ssh start && while true; do sleep 1; done;
#!/bin/bash
failed()
{
echo '
********************
*** BUILD FAILED ***
********************
'
echo "Keeping container alive for debugging..."
tail -f /dev/null
}

trap 'failed' 0

set -e
set -x

source stage0.sh
source mkext4.sh
source stage1.sh
echo "PRE PARALLEL"
cat packages.txt | parallel "wget --continue --directory-prefix=/mnt/lfs/sources {}"
echo "POST PARALLEL"
cd /mnt/lfs/sources
source binutils.sh
source gcc-pass1.sh
source linux-headers.sh
source glibc.sh
source libstdcplusplus.sh
source binutils-pass-2.sh
source gcc-pass2.sh
source tcl.sh
source expect.sh
source dejagnu.sh
source m4.sh
source ncurses.sh
source bash.sh
source bison.sh
source bzip2.sh
source coreutils.sh
source diffutils.sh
source file.sh
source findutils.sh
source gawk.sh
source gettext.sh
source grep.sh
source make.sh
source patch.sh
source perl.sh
source python.sh
source sed.sh
source tar.sh
source texinfo.sh
source xz.sh

trap : 0

echo '
***********************
*** BUILD SUCCEEDED ***
***********************
'
tail -f /dev/null
1 change: 0 additions & 1 deletion script/stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ EOF"

mkdir -p ~lfs/.ssh
chmod 0700 ~/.ssh
cp ~/.ssh/authorized_keys ~lfs/.ssh/authorized_keys
sed -i -e 's/^lfs:!:/lfs::/' /etc/shadow
su lfs -c "ssh-keygen -A"