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)
|
2023-11-19 20:40:15 -01:00
|
|
|
IMAGES="base"
|
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
|
|
|
|
2023-10-02 20:37:32 +00:00
|
|
|
usage() {
|
|
|
|
cat <<-EOH
|
|
|
|
Usage: $PROGNAME [options ...] [-- mklive options ...]
|
|
|
|
|
|
|
|
Wrapper script around mklive.sh for several standard flavors of live images.
|
|
|
|
Adds void-installer and other helpful utilities to the generated images.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-a <arch> Set XBPS_ARCH in the image
|
|
|
|
-b <variant> One of base, enlightenment, xfce, mate, cinnamon, gnome, kde,
|
|
|
|
lxde, or lxqt (default: base). May be specified multiple times
|
|
|
|
to build multiple variants
|
|
|
|
-d <date> Override the datestamp on the generated image (YYYYMMDD format)
|
|
|
|
-t <arch-date-variant>
|
|
|
|
Equivalent to setting -a, -b, and -d
|
|
|
|
-r <repo> Use this XBPS repository. May be specified multiple times
|
|
|
|
-h Show this help and exit
|
|
|
|
-V Show version and exit
|
|
|
|
|
|
|
|
Other options can be passed directly to mklive.sh by specifying them after the --.
|
|
|
|
See mklive.sh -h for more details.
|
|
|
|
EOH
|
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
|
|
|
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;;
|
2023-10-02 20:37:32 +00:00
|
|
|
h) usage; exit 0;;
|
|
|
|
*) usage >&2; 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() {
|
2023-11-19 19:50:36 -01:00
|
|
|
rm -rf "$INCLUDEDIR"
|
2022-12-17 11:04:00 -01:00
|
|
|
}
|
|
|
|
|
2024-12-26 23:58:10 -01:00
|
|
|
include_installer() {
|
|
|
|
if [ -x installer.sh ]; then
|
|
|
|
MKLIVE_VERSION="$(PROGNAME='' version)"
|
|
|
|
installer=$(mktemp)
|
|
|
|
sed "s/@@MKLIVE_VERSION@@/${MKLIVE_VERSION}/" installer.sh > "$installer"
|
|
|
|
install -Dm755 "$installer" "$INCLUDEDIR"/usr/bin/void-installer
|
|
|
|
rm "$installer"
|
|
|
|
else
|
|
|
|
echo installer.sh not found >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-06-25 07:16:04 +00:00
|
|
|
setup_pipewire() {
|
|
|
|
PKGS="$PKGS pipewire alsa-pipewire"
|
|
|
|
mkdir -p "$INCLUDEDIR"/etc/xdg/autostart
|
2023-11-19 19:50:36 -01:00
|
|
|
ln -sf /usr/share/applications/pipewire.desktop "$INCLUDEDIR"/etc/xdg/autostart/
|
2023-06-25 07:16:04 +00:00
|
|
|
mkdir -p "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d
|
2023-11-19 19:50:36 -01:00
|
|
|
ln -sf /usr/share/examples/wireplumber/10-wireplumber.conf "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d/
|
|
|
|
ln -sf /usr/share/examples/pipewire/20-pipewire-pulse.conf "$INCLUDEDIR"/etc/pipewire/pipewire.conf.d/
|
2023-06-25 07:16:04 +00:00
|
|
|
mkdir -p "$INCLUDEDIR"/etc/alsa/conf.d
|
2023-11-19 19:50:36 -01:00
|
|
|
ln -sf /usr/share/alsa/alsa.conf.d/50-pipewire.conf "$INCLUDEDIR"/etc/alsa/conf.d
|
|
|
|
ln -sf /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf "$INCLUDEDIR"/etc/alsa/conf.d
|
2023-06-25 07:16:04 +00:00
|
|
|
}
|
|
|
|
|
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
|
2024-12-26 23:58:10 -01:00
|
|
|
|
|
|
|
# el-cheapo installer is unsupported on arm because arm doesn't install a kernel by default
|
|
|
|
# and to work around that would add too much complexity to it
|
|
|
|
# thus everyone should just do a chroot install anyways
|
|
|
|
WANT_INSTALLER=no
|
2024-03-21 20:58:56 -01:00
|
|
|
case "$ARCH" in
|
2024-12-26 23:58:10 -01:00
|
|
|
x86_64*|i686*) GRUB_PKGS="grub-i386-efi grub-x86_64-efi"; WANT_INSTALLER=yes ;;
|
2024-03-21 20:58:56 -01:00
|
|
|
aarch64*) GRUB_PKGS="grub-arm64-efi" ;;
|
|
|
|
esac
|
2024-12-26 23:58:10 -01:00
|
|
|
|
2023-06-25 03:46:18 +00:00
|
|
|
A11Y_PKGS="espeakup void-live-audio brltty"
|
2024-12-21 17:21:13 -01:00
|
|
|
PKGS="dialog cryptsetup lvm2 mdadm void-docs-browse xtools-minimal xmirror chrony tmux $A11Y_PKGS $GRUB_PKGS"
|
2023-06-25 07:16:33 +00:00
|
|
|
XORG_PKGS="xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf orca"
|
2023-11-19 20:40:43 -01:00
|
|
|
SERVICES="sshd chronyd"
|
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-06-25 07:16:04 +00: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 xfce4-pulseaudio-plugin"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES dbus 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"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES dbus 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"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES dbus 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"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES dbus gdm NetworkManager polkitd"
|
2022-07-11 22:34:40 +00:00
|
|
|
;;
|
|
|
|
kde)
|
2024-07-12 17:42:20 +00:00
|
|
|
PKGS="$PKGS $XORG_PKGS kde5 konsole firefox dolphin NetworkManager"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES dbus 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"
|
2024-03-12 12:56:01 -01:00
|
|
|
SERVICES="$SERVICES 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
|
2023-07-13 19:12:29 +00:00
|
|
|
# needed to show the keyboard layout menu on the login screen
|
|
|
|
cat <<- EOF > "$INCLUDEDIR"/etc/lightdm/lightdm-gtk-greeter.conf
|
|
|
|
[greeter]
|
|
|
|
indicators = ~host;~spacer;~clock;~spacer;~layout;~session;~a11y;~power
|
|
|
|
EOF
|
2023-05-21 21:29:04 +00:00
|
|
|
fi
|
|
|
|
|
2024-12-26 23:58:10 -01:00
|
|
|
if [ "$WANT_INSTALLER" = yes ]; then
|
|
|
|
include_installer
|
|
|
|
else
|
|
|
|
mkdir -p "$INCLUDEDIR"/usr/bin
|
|
|
|
printf "#!/bin/sh\necho 'void-installer is not supported on this live image'\n" > "$INCLUDEDIR"/usr/bin/void-installer
|
|
|
|
chmod 755 "$INCLUDEDIR"/usr/bin/void-installer
|
|
|
|
fi
|
|
|
|
|
2023-06-25 07:16:04 +00:00
|
|
|
if [ "$variant" != base ]; then
|
|
|
|
setup_pipewire
|
|
|
|
fi
|
|
|
|
|
2022-12-17 11:04:00 -01:00
|
|
|
./mklive.sh -a "$ARCH" -o "$IMG" -p "$PKGS" -S "$SERVICES" -I "$INCLUDEDIR" ${REPO} "$@"
|
2023-11-19 19:50:36 -01:00
|
|
|
|
|
|
|
cleanup
|
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
|
|
|
|
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
|