Simplify, clean up and use official stages image

This commit is contained in:
Julian Ospald 2018-06-07 17:56:22 +02:00
parent efa6ff7362
commit 189519b14f
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
3 changed files with 54 additions and 73 deletions

View File

@ -1,15 +1,16 @@
FROM busybox FROM exherbo/exherbo-x86_64-pc-linux-gnu-base
MAINTAINER Julian Ospald <hasufell@posteo.de> MAINTAINER Julian Ospald <hasufell@posteo.de>
ENV PALUDIS_DO_NOTHING_SANDBOXY=1
RUN echo "export PALUDIS_DO_NOTHING_SANDBOXY=1" >> /etc/profile
# copy hooks # copy hooks
COPY ./config/paludis /etc/paludis-new COPY ./config/paludis /etc/paludis
# This one should be present by running the build.sh script # This one should be present by running the build.sh script
COPY bootstrap.sh build.sh / COPY build.sh /
RUN chmod +x /build.sh && /build.sh
# one step, to make the layer as thin as possible RUN rm /build.sh
# bootstrap.sh calls build.sh
RUN /bootstrap.sh amd64 x86_64
# update etc files... hope this doesn't screw up # update etc files... hope this doesn't screw up
RUN eclectic config accept-all RUN eclectic config accept-all

View File

@ -1,55 +0,0 @@
#!/bin/sh
set -e
# First param is package tarball, 2nd is the *.DIGEST file
VerifyShaOfStage3()
{
test_sum=$(awk -v myvar="$1" '$2==myvar {for(i=1; i<=1; i++) { print $1; exit}}' $2)
calculated_sum=$(sha1sum $1 | awk '{print $1}' -)
if [[ "$test_sum" == "$calculated_sum" ]]; then
return 0
else
return 1
fi
}
suffix=$3 # e.g. -hardened
arch=$1
dist="http://dev.exherbo.org/stages/"
stage3="exherbo-x86_64-pc-linux-gnu-current.tar.xz"
# Create working directory, keep a copy of busybox handy
mkdir newWorldOrder; cd newWorldOrder
cp /bin/busybox .
echo "Downloading and extracting ${stage3}..."
wget -c "${dist}/${stage3}" "${dist}/sha1sum"
if VerifyShaOfStage3 $stage3 "sha1sum"; then
echo "DIGEST sum is okey";
else
echo "DIGEST sum is NOT okey";
return 1;
fi
xz -d ${stage3}
tar --exclude "./etc/hosts" --exclude "./etc/hostname" --exclude "./sys/*" -xf ${stage3%.*}
/newWorldOrder/busybox rm -f ${stage3%.*}
echo "Installing stage 3"
/newWorldOrder/busybox rm -rf /lib* /usr /var /bin /sbin /opt /mnt /media /root /home /run /tmp
/newWorldOrder/busybox cp -fRap lib* /
/newWorldOrder/busybox cp -fRap bin boot home media mnt opt root run sbin tmp usr var /
/newWorldOrder/busybox cp -fRap etc/* /etc/
/newWorldOrder/busybox cp -fRap /etc/paludis-new/* /etc/paludis/
/newWorldOrder/busybox rm -rf /etc/paludis-new
# Cleaning
cd /
/newWorldOrder/busybox rm -rf /newWorldOrder /bootstrap.sh /linuxrc
# Say hello
echo "Bootstrapped ${stage3} into /:"
ls --color -lah
exec /bin/bash -c /build.sh

View File

@ -23,19 +23,54 @@ echo LANG="en_US.UTF-8" > /etc/env.d/99locale
# update # update
chgrp paludisbuild /dev/tty chgrp paludisbuild /dev/tty
cave sync cave sync
cave resolve -z -1 dev-libs/libressl sys-apps/paludis -U dev-libs/openssl -D dev-libs/openssl -f -x
cave resolve -z \!dev-libs/openssl -u '*/*' -x cave resolve --recommendations ignore --suggestions ignore \
cave resolve -z -1 dev-libs/libressl -x -z -1 \
cave resolve -z -1 net-misc/wget net-misc/curl -x -U dev-libs/openssl -D dev-libs/openssl \
cave fix-linkage -x -- --without sys-apps/paludis dev-libs/libressl sys-apps/paludis \
cave resolve -z \!sys-apps/systemd -u '*/*' -x -f -x
cave resolve -z -1 repository/spbecker -x
cave resolve --recommendations ignore --suggestions ignore \
-z \
-u '*/*' \
\!dev-libs/openssl \
-x
cave resolve --recommendations ignore --suggestions ignore \
-z -1 \
dev-libs/libressl \
-x
cave resolve --recommendations ignore --suggestions ignore \
-z -1 \
net-misc/wget net-misc/curl \
-x
cave fix-linkage -x -- \
--without sys-apps/paludis \
--recommendations ignore --suggestions ignore
cave resolve --recommendations ignore --suggestions ignore \
-z \
-u '*/*' \
\!sys-apps/systemd \
-x
cave resolve --recommendations ignore --suggestions ignore \
-z -1 \
repository/spbecker \
-x
cave update-world app-editors/nano cave update-world app-editors/nano
cave resolve -c world -x
cave resolve \
-c world --recommendations ignore --suggestions ignore \
-x
cave purge -x cave purge -x
cave fix-linkage -x
cave fix-linkage -x -- \
--recommendations ignore --suggestions ignore
rm -rf /var/cache/paludis/distfiles/* rm -rf /var/cache/paludis/distfiles/*
rm -f /build.sh