This commit is contained in:
mollusk 2019-03-28 13:18:20 -07:00
commit a2c7770462
8 changed files with 45 additions and 13 deletions

33
Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# 1) use alpine to generate a void environment
FROM alpine:3.9 as stage0
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org/current
ARG ARCH=x86_64
COPY keys/* /target/var/db/xbps/keys/
RUN apk add ca-certificates && \
wget -O - https://alpha.de.repo.voidlinux.org/static/xbps-static-latest.$(uname -m)-musl.tar.xz | \
tar Jx && \
XBPS_ARCH=${ARCH} xbps-install.static -yMU \
--repository=${REPOSITORY} \
--repository=${REPOSITORY}/musl \
-r /target \
base-minimal
# 2) using void to generate the final build
FROM scratch as stage1
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org/current
ARG ARCH=x86_64
COPY --from=stage0 /target /
COPY keys/* /target/var/db/xbps/keys/
RUN xbps-reconfigure -a && \
mkdir -p /target/var/cache && ln -s /var/cache/xbps /target/var/cache/xbps && \
XBPS_ARCH=${ARCH} xbps-install -yMU \
--repository=${REPOSITORY} \
--repository=${REPOSITORY}/musl \
-r /target \
base-minimal
# 3) configure and clean up the final image
FROM scratch
COPY --from=stage1 /target /
RUN xbps-reconfigure -a && \
rm -r /var/cache/xbps

View File

@ -20,6 +20,6 @@ sure to configure your network interface and then use:
Thanks for using Void Linux.
http://www.voidlinux.eu
https://www.voidlinux.org
###############################################################################

View File

@ -1,7 +1,7 @@
#!/bin/sh
dialog --colors --keep-tite --no-shadow --no-mouse \
--backtitle "\Zb\Z7Void Linux installation -- http://www.voidlinux.eu/\Zn" \
--backtitle "\Zb\Z7Void Linux installation -- https://www.voidlinux.org\Zn" \
--cancel-label "Reboot" --aspect 20 \
--menu "Select an Action:" 10 50 2 \
"Install" "Run void-installer" \

1
hooks/README.md Normal file
View File

@ -0,0 +1 @@
hooks for Docker

2
hooks/build Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
docker build --build-arg ARCH=$ARCH -t $IMAGE_NAME .

View File

@ -94,7 +94,7 @@ WIDGET_SIZE="10 70"
DIALOG() {
rm -f $ANSWER
dialog --colors --keep-tite --no-shadow --no-mouse \
--backtitle "${BOLD}${WHITE}Void Linux installation -- https://www.voidlinux.eu/ (@@MKLIVE_VERSION@@)${RESET}" \
--backtitle "${BOLD}${WHITE}Void Linux installation -- https://www.voidlinux.org (@@MKLIVE_VERSION@@)${RESET}" \
--cancel-label "Back" --aspect 20 "$@" 2>$ANSWER
return $?
}
@ -102,7 +102,7 @@ DIALOG() {
INFOBOX() {
# Note: dialog --infobox and --keep-tite don't work together
dialog --colors --no-shadow --no-mouse \
--backtitle "${BOLD}${WHITE}Void Linux installation -- https://www.voidlinux.eu/ (@@MKLIVE_VERSION@@)${RESET}" \
--backtitle "${BOLD}${WHITE}Void Linux installation -- https://www.voidlinux.org (@@MKLIVE_VERSION@@)${RESET}" \
--title "${TITLE}" --aspect 20 --infobox "$@"
}
@ -1444,7 +1444,7 @@ Linux distribution made from scratch and built from the source package tree \
available for XBPS, a new alternative binary package system.\n\n
The installation should be pretty straightforward. If you are in trouble \
please join us at ${BOLD}#voidlinux${RESET} on ${BOLD}irc.freenode.org${RESET}.\n\n
${BOLD}http://www.voidlinux.eu${RESET}\n\n" 16 80
${BOLD}https://www.voidlinux.org${RESET}\n\n" 16 80
while true; do
menu

View File

@ -31,7 +31,7 @@ check_tools() {
# if a different version of something is used than was expected.
for tool in $LIBTOOLS $REQTOOLS ; do
if ! which "$tool" > /dev/null ; then
die "Required tool $f is not available on this system!"
die "Required tool $tool is not available on this system!"
fi
done

View File

@ -75,7 +75,6 @@ directory if unset).
-l <locale> Default locale to use (en_US.UTF-8 if unset).
-i <lz4|gzip|bzip2|xz> Compression type for the initramfs image (xz if unset).
-s <gzip|lzo|xz> Compression type for the squashfs image (xz if unset)
-S <freesize> Allocate this free size (MB) for the rootfs.
-o <file> Output file name for the ISO image (auto if unset).
-p "pkg pkgN ..." Install additional packages into the ISO image.
-I <includedir> Include directory structure under given path into rootfs
@ -259,11 +258,8 @@ generate_squashfs() {
# Find out required size for the rootfs and create an ext3fs image off it.
ROOTFS_SIZE=$(du -sm "$ROOTFS"|awk '{print $1}')
if [ -z "$ROOTFS_FREESIZE" ]; then
ROOTFS_FREESIZE="$((ROOTFS_SIZE/6))"
fi
mkdir -p "$BUILDDIR/tmp/LiveOS"
truncate -s "$((ROOTFS_SIZE+ROOTFS_FREESIZE))M" \
truncate -s "$((ROOTFS_SIZE+ROOTFS_SIZE/6))M" \
"$BUILDDIR"/tmp/LiveOS/ext3fs.img >/dev/null 2>&1
mkdir -p "$BUILDDIR/tmp-rootfs"
mkfs.ext3 -F -m1 "$BUILDDIR/tmp/LiveOS/ext3fs.img" >/dev/null 2>&1
@ -319,8 +315,9 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
esac
done
shift $((OPTIND - 1))
XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=http://alpha.de.repo.voidlinux.org/current --repository=http://alpha.de.repo.voidlinux.org/current/musl"
# Configure dracut to use overlayfs for the writable overlay.
BOOT_CMDLINE="$BOOT_CMDLINE rd.live.overlay.overlayfs=1 "
ARCH=$(xbps-uhelper arch)
@ -346,7 +343,6 @@ fi
readonly CURDIR="$PWD"
ISO_VOLUME="VOID_LIVE"
if [ -n "$ROOTDIR" ]; then
BUILDDIR=$(mktemp --tmpdir="$ROOTDIR" -d)
else