Merge branch 'master' of https://github.com/void-linux/void-mklive
This commit is contained in:
commit
76790a9cef
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
xbps-cachedir-*/
|
||||
*.iso
|
||||
*.img*
|
||||
*.tar*
|
@ -3,8 +3,8 @@ FROM alpine:3.9 as stage0
|
||||
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org
|
||||
ARG ARCH=x86_64
|
||||
COPY keys/* /target/var/db/xbps/keys/
|
||||
RUN apk add ca-certificates && \
|
||||
wget -O - ${REPOSITORY}/static/xbps-static-latest.$(uname -m)-musl.tar.xz | \
|
||||
RUN apk add ca-certificates curl && \
|
||||
curl ${REPOSITORY}/static/xbps-static-latest.$(uname -m)-musl.tar.xz | \
|
||||
tar Jx && \
|
||||
XBPS_ARCH=${ARCH} xbps-install.static -yMU \
|
||||
--repository=${REPOSITORY}/current \
|
||||
@ -17,6 +17,7 @@ FROM scratch as stage1
|
||||
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org
|
||||
ARG ARCH=x86_64
|
||||
ARG BASEPKG=base-minimal
|
||||
ARG ADDINS=
|
||||
COPY --from=stage0 /target /
|
||||
COPY keys/* /target/var/db/xbps/keys/
|
||||
RUN xbps-reconfigure -a && \
|
||||
@ -25,10 +26,12 @@ RUN xbps-reconfigure -a && \
|
||||
--repository=${REPOSITORY}/current \
|
||||
--repository=${REPOSITORY}/current/musl \
|
||||
-r /target \
|
||||
${BASEPKG}
|
||||
${BASEPKG} ${ADDINS}
|
||||
|
||||
# 3) configure and clean up the final image
|
||||
FROM scratch
|
||||
COPY --from=stage1 /target /
|
||||
RUN xbps-reconfigure -a && \
|
||||
rm -r /var/cache/xbps
|
||||
|
||||
CMD ["/bin/sh"]
|
||||
|
2
Makefile
2
Makefile
@ -99,6 +99,6 @@ masterdir-all-print:
|
||||
masterdir-all: $(ALL_MASTERDIRS)
|
||||
|
||||
masterdir-%:
|
||||
$(SUDO) docker build --build-arg REPOSITORY=$(XBPS_REPOSITORY) --build-arg ARCH=$* -t voidlinux/masterdir-$*:$(DATECODE) .
|
||||
$(SUDO) docker build --build-arg REPOSITORY=$(XBPS_REPOSITORY) --build-arg ARCH=$* --build-arg ADDINS=spdx-licenses-list -t voidlinux/masterdir-$*:$(DATECODE) .
|
||||
|
||||
.PHONY: clean dist rootfs-all-print rootfs-all platformfs-all-print platformfs-all pxe-all-print pxe-all masterdir-all-print masterdir-all masterdir-push-all
|
||||
|
@ -7,7 +7,7 @@ while getopts "a:b:hr:" opt; do
|
||||
case $opt in
|
||||
a) ARCH="$OPTARG";;
|
||||
b) IMAGE="$OPTARG";;
|
||||
h) echo "${0#/*}: [-a arch] [-b base|e|xfce|mate|cinnamon|kde|lxde|lxqt] [-r repo]" >&2; exit 1;;
|
||||
h) echo "${0#/*}: [-a arch] [-b base|e|xfce|mate|cinnamon|gnome|kde|lxde|lxqt] [-r repo]" >&2; exit 1;;
|
||||
r) REPO="-r $OPTARG $REPO";;
|
||||
esac
|
||||
done
|
||||
@ -21,6 +21,7 @@ readonly E_IMG=void-live-${ARCH}-${DATE}-enlightenment.iso
|
||||
readonly XFCE_IMG=void-live-${ARCH}-${DATE}-xfce.iso
|
||||
readonly MATE_IMG=void-live-${ARCH}-${DATE}-mate.iso
|
||||
readonly CINNAMON_IMG=void-live-${ARCH}-${DATE}-cinnamon.iso
|
||||
readonly GNOME_IMG=void-live-${ARCH}-${DATE}-gnome.iso
|
||||
readonly KDE_IMG=void-live-${ARCH}-${DATE}-kde.iso
|
||||
readonly LXDE_IMG=void-live-${ARCH}-${DATE}-lxde.iso
|
||||
readonly LXQT_IMG=void-live-${ARCH}-${DATE}-lxqt.iso
|
||||
@ -33,6 +34,7 @@ readonly E_PKGS="$X_PKGS lxdm enlightenment terminology econnman udisks2 firefox
|
||||
readonly XFCE_PKGS="$X_PKGS lxdm xfce4 gnome-themes-standard gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr"
|
||||
readonly MATE_PKGS="$X_PKGS lxdm mate mate-extra gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr"
|
||||
readonly CINNAMON_PKGS="$X_PKGS lxdm cinnamon gnome-keyring colord gnome-terminal gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr"
|
||||
readonly GNOME_PKGS="$X_PKGS gnome gnome-terminal firefox-esr"
|
||||
readonly KDE_PKGS="$X_PKGS kde5 konsole firefox dolphin"
|
||||
readonly LXDE_PKGS="$X_PKGS lxdm lxde gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr"
|
||||
readonly LXQT_PKGS="$X_PKGS lxdm lxqt gvfs-afc gvfs-mtp gvfs-smb udisks2 qupzilla"
|
||||
@ -64,6 +66,13 @@ if [ -z "$IMAGE" -o "$IMAGE" = cinnamon ]; then
|
||||
./mklive.sh -a $ARCH -o $CINNAMON_IMG -p "$CINNAMON_PKGS" ${REPO} $@
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$IMAGE" -o "$IMAGE" = gnome ]; then
|
||||
if [ ! -e $GNOME_IMG ]; then
|
||||
./mklive.sh -a $ARCH -o $GNOME_IMG -p "$GNOME_PKGS" ${REPO} $@
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$IMAGE" -o "$IMAGE" = lxde ]; then
|
||||
if [ ! -e $LXDE_IMG ]; then
|
||||
./mklive.sh -a $ARCH -o $LXDE_IMG -p "$LXDE_PKGS" ${REPO} $@
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#-
|
||||
# Copyright (c) 2012-2015 Juan Romero Pardines <xtraeme@voidlinux.eu>.
|
||||
# Copyright (c) 2012-2015 Juan Romero Pardines <xtraeme@gmail.com>.
|
||||
# 2012 Dave Elusive <davehome@redthumb.info.tm>.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -952,6 +952,7 @@ menu_network() {
|
||||
validate_filesystems() {
|
||||
local mnts dev size fstype mntpt mkfs rootfound fmt
|
||||
local usrfound efi_system_partition
|
||||
local bootdev=$(get_option BOOTLOADER)
|
||||
|
||||
unset TARGETFS
|
||||
mnts=$(grep -E '^MOUNTPOINT.*' $CONF_FILE)
|
||||
@ -985,10 +986,11 @@ the mount point for the root filesystem (/) has not yet been configured." ${MSGB
|
||||
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
|
||||
/usr mount point has been configured but is not supported, please remove it to continue." ${MSGBOXSIZE}
|
||||
return 1
|
||||
elif [ -n "$EFI_SYSTEM" -a -z "$efi_system_partition" ]; then
|
||||
elif [ -n "$EFI_SYSTEM" -a "$bootdev" != "none" -a -z "$efi_system_partition" ]; then
|
||||
DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} \
|
||||
The EFI System Partition has not yet been configured, please create it\n
|
||||
as FAT32, mountpoint /boot/efi and at least with 100MB of size." ${MSGBOXSIZE}
|
||||
return 1
|
||||
fi
|
||||
FILESYSTEMS_DONE=1
|
||||
}
|
||||
@ -1031,7 +1033,7 @@ failed to activate swap on $dev!\ncheck $LOG for errors." ${MSGBOXSIZE}
|
||||
ext2) MKFS="mke2fs -F"; modprobe ext2 >$LOG 2>&1;;
|
||||
ext3) MKFS="mke2fs -F -j"; modprobe ext3 >$LOG 2>&1;;
|
||||
ext4) MKFS="mke2fs -F -t ext4"; modprobe ext4 >$LOG 2>&1;;
|
||||
f2fs) MKFS="mkfs.f2fs"; modprobe f2fs >$LOG 2>&1;;
|
||||
f2fs) MKFS="mkfs.f2fs -f"; modprobe f2fs >$LOG 2>&1;;
|
||||
vfat) MKFS="mkfs.vfat -F32"; modprobe vfat >$LOG 2>&1;;
|
||||
xfs) MKFS="mkfs.xfs -f -i sparse=0"; modprobe xfs >$LOG 2>&1;;
|
||||
esac
|
||||
@ -1191,17 +1193,10 @@ enable_dhcpd() {
|
||||
}
|
||||
|
||||
menu_install() {
|
||||
# Don't continue if filesystems are not ready.
|
||||
validate_filesystems || return 1
|
||||
|
||||
ROOTPASSWORD_DONE="$(get_option ROOTPASSWORD)"
|
||||
BOOTLOADER_DONE="$(get_option BOOTLOADER)"
|
||||
|
||||
if [ -z "$FILESYSTEMS_DONE" ]; then
|
||||
DIALOG --msgbox "${BOLD}Required filesystems were not configured, \
|
||||
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
|
||||
return 1
|
||||
elif [ -z "$ROOTPASSWORD_DONE" ]; then
|
||||
if [ -z "$ROOTPASSWORD_DONE" ]; then
|
||||
DIALOG --msgbox "${BOLD}The root password has not been configured, \
|
||||
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
|
||||
return 1
|
||||
@ -1211,6 +1206,16 @@ configured, please do so before starting the installation.${RESET}" ${MSGBOXSIZE
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Validate filesystems after making sure bootloader is done,
|
||||
# so that specific checks can be made based on the selection
|
||||
validate_filesystems || return 1
|
||||
|
||||
if [ -z "$FILESYSTEMS_DONE" ]; then
|
||||
DIALOG --msgbox "${BOLD}Required filesystems were not configured, \
|
||||
please do so before starting the installation.${RESET}" ${MSGBOXSIZE}
|
||||
return 1
|
||||
fi
|
||||
|
||||
DIALOG --yesno "${BOLD}The following operations will be executed:${RESET}\n\n
|
||||
${BOLD}${TARGETFS}${RESET}\n
|
||||
${BOLD}${RED}WARNING: data on partitions will be COMPLETELY DESTROYED for new \
|
||||
|
24
mklive.sh.in
24
mklive.sh.in
@ -81,6 +81,7 @@ directory if unset).
|
||||
|
||||
-C "cmdline args" Add additional kernel command line arguments.
|
||||
-T "title" Modify the bootloader title.
|
||||
-v linux<version> Install a custom Linux version on ISO image (linux meta-package if unset).
|
||||
-K Do not remove builddir.
|
||||
|
||||
The $PROGNAME script generates a live image of the Void Linux distribution.
|
||||
@ -288,7 +289,7 @@ generate_iso_image() {
|
||||
#
|
||||
# main()
|
||||
#
|
||||
while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
|
||||
while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:v:h" opt; do
|
||||
case $opt in
|
||||
a) BASE_ARCH="$OPTARG";;
|
||||
b) BASE_SYSTEM_PKG="$OPTARG";;
|
||||
@ -305,6 +306,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do
|
||||
p) PACKAGE_LIST="$OPTARG";;
|
||||
C) BOOT_CMDLINE="$OPTARG";;
|
||||
T) BOOT_TITLE="$OPTARG";;
|
||||
v) LINUX_VERSION="$OPTARG";;
|
||||
h) usage;;
|
||||
*) usage;;
|
||||
esac
|
||||
@ -350,7 +352,7 @@ GRUB_DIR="$BOOT_DIR/grub"
|
||||
ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg"
|
||||
CURRENT_STEP=0
|
||||
STEP_COUNT=9
|
||||
[ -n "${INCLUDE_DIRECTORY}" ] && ((STEP_COUNT=STEP_COUNT+1))
|
||||
[ -n "${INCLUDE_DIRECTORY}" ] && STEP_COUNT=$((STEP_COUNT+1))
|
||||
|
||||
: ${SYSLINUX_DATADIR:="$VOIDHOSTDIR"/usr/lib/syslinux}
|
||||
: ${GRUB_DATADIR:="$VOIDHOSTDIR"/usr/share/grub}
|
||||
@ -370,10 +372,26 @@ copy_void_keys "$VOIDHOSTDIR"
|
||||
XBPS_ARCH=$BASE_ARCH $XBPS_INSTALL_CMD -r "$ROOTFS" ${XBPS_REPOSITORY} -S
|
||||
XBPS_ARCH=$ARCH $XBPS_INSTALL_CMD -r "$VOIDHOSTDIR" ${XBPS_REPOSITORY} -S
|
||||
|
||||
_linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux|head -1)
|
||||
# Get linux version for ISO
|
||||
# If linux version option specified use
|
||||
if [ -n "$LINUX_VERSION" ]; then
|
||||
if ! echo "$LINUX_VERSION" | grep "linux[0-9._]*"; then
|
||||
die "-v option must be in format linux<version>"
|
||||
fi
|
||||
|
||||
_linux_series="$LINUX_VERSION"
|
||||
PACKAGE_LIST="$PACKAGE_LIST $LINUX_VERSION"
|
||||
else # Otherwise find latest stable version from linux meta-package
|
||||
_linux_series=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -x linux|head -1)
|
||||
fi
|
||||
|
||||
_kver=$(XBPS_ARCH=$BASE_ARCH $XBPS_QUERY_CMD -r "$ROOTFS" ${XBPS_REPOSITORY:=-R} -p pkgver ${_linux_series})
|
||||
KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver})
|
||||
|
||||
if [ "$?" -ne "0" ]; then
|
||||
die "Failed to find kernel package version"
|
||||
fi
|
||||
|
||||
: ${OUTPUT_FILE="void-live-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"}
|
||||
|
||||
print_step "Installing software to generate the image: ${REQUIRED_PKGS} ..."
|
||||
|
@ -135,7 +135,7 @@ set_target_arch_from_platform
|
||||
set_cachedir
|
||||
|
||||
# Append any additional packages if they were requested
|
||||
if [ -z "$EXTRA_PKGS" ] ; then
|
||||
if [ -n "$EXTRA_PKGS" ] ; then
|
||||
PKGS="$PKGS $EXTRA_PKGS"
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user