2014-12-03 09:32:01 -01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-07-11 22:34:40 +00:00
|
|
|
set -eu
|
|
|
|
|
2023-05-21 21:25:38 +00:00
|
|
|
. ./lib.sh
|
|
|
|
|
|
|
|
PROGNAME=$(basename "$0")
|
2022-07-11 22:34:40 +00:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
IMAGES="base enlightenment xfce mate cinnamon gnome kde lxde lxqt"
|
2023-04-08 12:06:28 +00:00
|
|
|
TRIPLET=
|
2022-07-11 22:34:40 +00:00
|
|
|
REPO=
|
2023-04-08 12:06:28 +00:00
|
|
|
DATE=$(date -u +%Y%m%d)
|
2022-07-11 22:34:40 +00:00
|
|
|
|
|
|
|
help() {
|
2023-04-08 12:06:28 +00:00
|
|
|
echo "$PROGNAME: [-a arch] [-b base|enlightenment|xfce|mate|cinnamon|gnome|kde|lxde|lxqt] [-d date] [-t arch-date-variant] [-r repo]" >&2
|
2022-07-11 22:34:40 +00:00
|
|
|
}
|
2015-06-07 10:31:59 +00:00
|
|
|
|
2023-04-08 12:06:28 +00:00
|
|
|
while getopts "a:b:d:t:hr:V" opt; do
|
2015-06-07 10:31:59 +00:00
|
|
|
case $opt in
|
2022-07-11 22:34:40 +00:00
|
|
|
a) ARCH="$OPTARG";;
|
|
|
|
b) IMAGES="$OPTARG";;
|
2023-04-08 12:06:28 +00:00
|
|
|
d) DATE="$OPTARG";;
|
2022-07-11 22:34:40 +00:00
|
|
|
h) help; exit 0;;
|
|
|
|
r) REPO="-r $OPTARG $REPO";;
|
2023-04-08 12:06:28 +00:00
|
|
|
t) TRIPLET="$OPTARG";;
|
2023-05-21 21:25:38 +00:00
|
|
|
V) version; exit 0;;
|
2022-07-11 22:34:40 +00:00
|
|
|
*) help; exit 1;;
|
2015-06-07 10:31:59 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
|
2022-12-17 11:04:00 -01:00
|
|
|
INCLUDEDIR=$(mktemp -d)
|
|
|
|
trap "cleanup" INT TERM
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
rm -r "$INCLUDEDIR"
|
|
|
|
}
|
|
|
|
|
2022-07-11 22:34:40 +00:00
|
|
|
build_variant() {
|
|
|
|
variant="$1"
|
2023-02-19 22:35:23 -01:00
|
|
|
shift
|
2022-07-27 21:32:02 +00:00
|
|
|
IMG=void-live-${ARCH}-${DATE}-${variant}.iso
|
2022-07-11 22:34:40 +00:00
|
|
|
GRUB_PKGS="grub-i386-efi grub-x86_64-efi"
|
2022-11-17 09:09:15 -01:00
|
|
|
PKGS="dialog cryptsetup lvm2 mdadm void-docs-browse xtools-minimal xmirror espeakup $GRUB_PKGS"
|
2022-07-11 22:34:40 +00:00
|
|
|
XORG_PKGS="xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf alsa-plugins-pulseaudio"
|
2022-05-16 12:42:02 +00:00
|
|
|
SERVICES="sshd"
|
2014-12-03 09:32:01 -01:00
|
|
|
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=''
|
|
|
|
|
2022-07-11 22:34:40 +00:00
|
|
|
case $variant in
|
2022-05-16 12:42:02 +00:00
|
|
|
base)
|
2020-11-13 02:44:55 -01:00
|
|
|
SERVICES="$SERVICES dhcpcd wpa_supplicant acpid"
|
2022-05-16 12:42:02 +00:00
|
|
|
;;
|
2022-07-11 22:34:40 +00:00
|
|
|
enlightenment)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lightdm lightdm-gtk3-greeter enlightenment terminology udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES acpid dhcpcd wpa_supplicant lightdm dbus polkitd"
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=enlightenment
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
xfce)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lightdm lightdm-gtk3-greeter xfce4 gnome-themes-standard gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES dbus elogind lightdm NetworkManager polkitd"
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=xfce
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
mate)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lightdm lightdm-gtk3-greeter mate mate-extra gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES dbus elogind lightdm NetworkManager polkitd"
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=mate
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
cinnamon)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lightdm lightdm-gtk3-greeter cinnamon gnome-keyring colord gnome-terminal gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES dbus elogind lightdm NetworkManager polkitd"
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=cinnamon
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
gnome)
|
2022-10-01 11:06:34 +00:00
|
|
|
PKGS="$PKGS $XORG_PKGS gnome firefox"
|
2022-05-16 12:42:02 +00:00
|
|
|
SERVICES="$SERVICES dbus elogind gdm NetworkManager polkitd"
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
kde)
|
2022-10-01 11:06:34 +00:00
|
|
|
PKGS="$PKGS $XORG_PKGS kde5 konsole firefox dolphin"
|
2022-05-16 12:42:02 +00:00
|
|
|
SERVICES="$SERVICES dbus elogind NetworkManager sddm"
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
lxde)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lxde lightdm lightdm-gtk3-greeter gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES acpid dbus dhcpcd wpa_supplicant lightdm polkitd"
|
2023-05-21 21:29:04 +00:00
|
|
|
LIGHTDM_SESSION=LXDE
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
lxqt)
|
2023-03-03 07:58:47 -01:00
|
|
|
PKGS="$PKGS $XORG_PKGS lxqt sddm gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox"
|
|
|
|
SERVICES="$SERVICES elogind dbus dhcpcd wpa_supplicant sddm polkitd"
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
>&2 echo "Unknown variant $variant"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2014-12-05 00:17:57 -01:00
|
|
|
|
2023-05-21 21:29:04 +00:00
|
|
|
if [ -n "$LIGHTDM_SESSION" ]; then
|
|
|
|
mkdir -p "$INCLUDEDIR"/etc/lightdm
|
|
|
|
echo "$LIGHTDM_SESSION" > "$INCLUDEDIR"/etc/lightdm/.session
|
|
|
|
fi
|
|
|
|
|
2022-12-17 11:04:00 -01:00
|
|
|
./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" ${REPO} "$@"
|
2022-07-11 22:34:40 +00:00
|
|
|
}
|
2014-12-03 09:32:01 -01:00
|
|
|
|
2022-07-27 21:39:17 +00:00
|
|
|
if [ ! -x mklive.sh ]; then
|
|
|
|
echo mklive.sh not found >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-12-03 09:32:01 -01:00
|
|
|
|
2022-12-17 11:04:00 -01:00
|
|
|
if [ -x installer.sh ]; then
|
2023-05-21 21:25:38 +00:00
|
|
|
MKLIVE_VERSION="$(PROGNAME='' version)"
|
2022-12-17 12:29:52 -01:00
|
|
|
installer=$(mktemp)
|
|
|
|
sed "s/@@MKLIVE_VERSION@@/${MKLIVE_VERSION}/" installer.sh > "$installer"
|
|
|
|
install -Dm755 "$installer" "$INCLUDEDIR"/usr/bin/void-installer
|
|
|
|
rm "$installer"
|
2022-12-17 11:04:00 -01:00
|
|
|
else
|
|
|
|
echo installer.sh not found >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-04-08 12:06:28 +00:00
|
|
|
if [ -n "$TRIPLET" ]; then
|
|
|
|
VARIANT="${TRIPLET##*-}"
|
|
|
|
REST="${TRIPLET%-*}"
|
|
|
|
DATE="${REST##*-}"
|
|
|
|
ARCH="${REST%-*}"
|
|
|
|
build_variant "$VARIANT" "$@"
|
|
|
|
else
|
|
|
|
for image in $IMAGES; do
|
|
|
|
build_variant "$image" "$@"
|
|
|
|
done
|
|
|
|
fi
|