Compare commits

..

No commits in common. "3fe25352130c488ca39450769b1d2501acc4b3c3" and "3035bd45046733a67b37eeb3cf476dda7e7a6113" have entirely different histories.

42 changed files with 68 additions and 206 deletions

View File

@ -46,17 +46,9 @@ function run_in_target {
clear
touch $LOGFILE
if [ ! "$(id -u)" -eq 0 ]; then
echo "Must be root to run this script!"
exit 1
fi
if ping -c4 repo-default.voidlinux.org >> $LOGFILE 2>&1; then
:
else
echo "An internet connection is required to run this script."
exit 1
fi
#TODO: check that we are root
#TODO: check that we are online
# -> could be done by pinging repo-default.voidlinux.org
echo "
This script will now download and install Void Linux on your USB stick.
@ -65,6 +57,7 @@ usable from Windows or MacOS.
Before we begin, the following packages need to be installed (if not installed already):
- xmirror
- squashfs-tools
- wget
"
press_any_key
@ -73,7 +66,7 @@ echo -n "Ensuring that XBPS is up-to-date... "
xbps-install --yes --sync --update xbps >> $LOGFILE 2>&1
echo "done"
echo -n "Installing xmirror, squashfs-tools, wget... "
xbps-install --yes xmirror wget >> $LOGFILE 2>&1
xbps-install --yes xmirror squashfs-tools wget >> $LOGFILE 2>&1
echo "done"
#TODO: If going down the path of extracting routines from void-installer, that should be done here

View File

@ -1,115 +1,4 @@
#!/usr/bin/env bash
LOGFILE=/tmp/void-usb-install-log
function press_any_key {
echo "Press any key to continue or Ctrl+c to abort..."
read -n1 DISCARD_ME
echo ""
}
function yesno {
unset DISCARD_ME
while [ -z "$DISCARD_ME" ]; do
read -p "[y/n] " -n1 DISCARD_ME
case "$DISCARD_ME" in
y)
return 0
;;
n)
return 1
;;
*)
echo " Please enter y for yes or n for no."
unset DISCARD_ME
;;
esac
done
}
[ -z "$TERM" ] && export TERM=linux
echo -n "Checking for internet connection..."
INTERNET="down"
WAITING=0
while [ "$INTERNET" = "down" -a "$WAITING" -lt 15 ]; do
sleep 1
if ping -c2 repo-default.voidlinux.org >> $LOGFILE 2>&1; then
INTERNET="up"
fi
WAITING=$((WAITING+1))
echo -n "."
done
echo " $INTERNET"
if [ "$INTERNET" = "down" ]; then
clear
echo "Connect to WiFi?
Any network settings from before the reboot have not been saved and need to be entered again.
Use 'Activate a connection' in the dialog to select your network.
Alternatively, you can continue without internet but the system will be left in a barebones state.
"
if yesno; then
nmtui
clear
echo -n "Checking for internet connection..."
WAITING=0
while [ "$INTERNET" = "down" -a "$WAITING" -lt 15 ]; do
sleep 1
if ping -c2 repo-default.voidlinux.org >> $LOGFILE 2>&1; then
INTERNET="up"
fi
WAITING=$((WAITING+1))
echo -n "."
done
echo " $INTERNET"
fi
fi
if [ "$INTERNET" = "up" ]; then
echo -n "Retrieving package lists... "
xbps-install --sync >>$LOGFILE 2>&1
echo "done"
fi
readarray -t SECTIONS < /opt/void-usb/installer/package_selections/sections.lst
for I in ${!SECTIONS[@]}; do
readarray -t OPTIONS < "/opt/void-usb/installer/package_selections/${SECTIONS[$I]}/options.lst"
AVAILABLE_OPTIONS=()
for J in ${!OPTIONS[@]}; do
source "/opt/void-usb/installer/package_selections/${SECTIONS[$I]}/${OPTIONS[$J]}"
if check; then
AVAILABLE_OPTIONS+=("${OPTIONS[$J]}")
fi
done
if [ -z "${AVAILABLE_OPTIONS[1]}" ]; then
# no need to ask, there is only one option anyway
CHOICE="${AVAILABLE_OPTIONS[0]}"
else
clear
cat "/opt/void-usb/installer/package_selections/${SECTIONS[$I]}/description.txt"
for J in ${!AVAILABLE_OPTIONS[@]}; do
source "/opt/void-usb/installer/package_selections/${SECTIONS[$I]}/${AVAILABLE_OPTIONS[$J]}"
echo "$J: $DESCRIPTION"
done
CHOICE=""
while [ -z "$CHOICE" ]; do
echo "Select by entering the corresponding number."
read -p "> " CHOICE_NUMBER
CHOICE="${AVAILABLE_OPTIONS[$CHOICE_NUMBER]}"
done
fi
source "/opt/void-usb/installer/package_selections/${SECTIONS[$I]}/$CHOICE"
if [ -n "$PACKAGES" ]; then
xbps-install --yes $PACKAGES
fi
post_install
done
bash --norc --noprofile
#debugging
exec bash --norc --noprofile

View File

@ -1,12 +1,14 @@
TODO:
compare sizes of glibc and musl installations
need xdg menu maker?
test that the (RAM) boot option allows you to install to the stick the system booted off
adjust required USB stick and RAM size in README
do not rely on the RTC
- change the message when configuring UTC/localtime to reflect that this is only for offline usage
- use ntp to get time
- only fall back to using rtc if offline
- do not set the RTC
show user-friendly status instead of scrolling output from all sorts of tools
make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
vkpurge old stuff - only keep 2 vkpurgeable kernels
- change kernel pre-install hook
@ -21,15 +23,6 @@ look into roxterm as an alternative terminal
add a zram swap option to package_selections
include arandr or something similar in fully featured desktop utils
deal with the entropy thing that runs after rc.shutdown
add firewall option to package_selections
first run message in xinitrc
- auto-disables itself
- displays README.txt on root dir of the F2FS partition
put a README.txt on root dir of F2FS partition
add online check to all the selections that need internet
sort out /etc/resolv.conf for the chroot
Minimum viable Xorg setup: setxkbmap xauth xorg-video-drivers mesa mesa-dri xorg-server elogind xorg-input-drivers xrandr acpilight xhost xinit xrdb xinput xgamma xset iceauth sessreg transset xcmsdb xkbutils xmodmap dejavu-fonts-ttf
musl downsides:
- no nvidia drivers
@ -45,6 +38,26 @@ Stage 1:
-> symlink /etc/localtime
Stage 2:
-> configure services
-> dbus
-> NetworkManager
-> acpid
-> ask user to connect to network using nmtui
-> install packages
-> go through the list of choices for what the user can install
-> Minimum viable Xorg setup: setxkbmap xauth xorg-video-drivers mesa mesa-dri xorg-server elogind xorg-input-drivers xrandr acpilight xhost xinit xrdb xinput xgamma xset iceauth sessreg transset xcmsdb xkbutils xmodmap dejavu-fonts-ttf
-> dont ask the user if there is only one option
-> passwd -l root
-> populate /etc/skel
-> ultimate bashrc bc why not
-> first run message in xinitrc
-> auto-deletes itself
-> displays README.txt on root dir of the F2FS partition
-> if using CTWM
-> put xclock in xinitrc
-> configure more sane defaults
-> prepend bashrc with a thing that checks of xorg is running
-> if not, run startx and ask user whether to shut down, reboot, or do nothing afterwards
-> set up user
-> ask for username
-> run useradd (non-interactively)

View File

@ -6,6 +6,6 @@ DESCRIPTION="No audio"
PACKAGES=""
function post_install {
function post-install {
echo "audio/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Pipewire with GUI settings (Pavucontrol)"
PACKAGES="pipewire pavucontrol"
function post_install {
function post-install {
echo "audio/pipewire" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Pipewire with text-based settings (pulsemixer)"
PACKAGES="pipewire pulsemixer"
function post_install {
function post-install {
echo "audio/pipewire-slim" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
return 0
}
@ -8,6 +7,6 @@ DESCRIPTION="BodgeMasters IceWM setup (recommended)"
# TODO
PACKAGES=""
function post_install {
function post-install {
echo "desktop/icewm-fancy" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
return 0
}
@ -8,6 +7,6 @@ DESCRIPTION="Lighter IceWM setup"
# TODO
PACKAGES=""
function post_install {
function post-install {
echo "desktop/icewm-light" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="No desktop - for advanced users that want to set things up themselv
PACKAGES=""
function post_install {
function post-install {
echo "desktop/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
return 0
}
@ -9,6 +8,6 @@ DESCRIPTION="OpenBox window manager (even more lightweight???)"
# TODO also add xclock
PACKAGES=""
function post_install {
function post-install {
echo "desktop/openbox" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -12,7 +11,7 @@ DESCRIPTION="All of the above"
#TODO
PACKAGES=""
function post_install {
function post-install {
# TODO: configure desktop backgounds if using IceWM
echo "extras/all" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -12,7 +11,7 @@ DESCRIPTION="All of the above except Minecraft"
#TODO
PACKAGES=""
function post_install {
function post-install {
# TODO: configure desktop backgounds if using IceWM
echo "extras/all-no-minecraft" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/icewm" /tmp/stage-2-choices >/dev/null 2>&1; then
return 0
else
@ -11,9 +10,7 @@ DESCRIPTION="Add some desktop backgrounds and randomly choose one on login"
PACKAGES=""
function post_install {
# TODO: install wget
function post-install {
# TODO: configure
# TODO: remove wget
echo "extras/desktop-backgrounds" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -12,6 +11,6 @@ DESCRIPTION="Prism Launcher for Minecraft"
#TODO: Java stuff
PACKAGES="PrismLauncher"
function post_install {
function post-install {
echo "extras/minecraft" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -13,6 +12,6 @@ DESCRIPTION="??? (Minesweeper)"
#TODO
PACKAGES=""
function post_install {
function post-install {
echo "extras/minesweeper" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="None"
PACKAGES=""
function post_install {
function post-install {
echo "extras/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -13,6 +12,6 @@ DESCRIPTION="nSnake"
#TODO
PACKAGES="nSnake"
function post_install {
function post-install {
echo "extras/snake" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="No"
PACKAGES=""
function post_install {
function post-install {
echo "multimedia/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -12,6 +11,6 @@ DESCRIPTION="Install VLC"
#TODO: fluidsynth MIDI stuff
PACKAGES="vlc"
function post_install {
function post-install {
echo "multimedia/vlc" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="Dont install."
PACKAGES=""
function post_install {
function post-install {
echo "nvidia/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if xbps-query glibc >/dev/null 2>&1; then
return 0
else
@ -10,10 +9,9 @@ function check {
DESCRIPTION="Latest Nvidia driver, supports GTX ??? series and up"
#TODO: optimus support?
#TODO: void-repo-nonfree
PACKAGES="nvidia"
function post_install {
function post-install {
#TODO: nvidia modeset kernel parameter?
echo "nvidia/nvidia" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if xbps-query glibc >/dev/null 2>&1; then
return 0
else
@ -10,10 +9,9 @@ function check {
DESCRIPTION="Legacy Nvidia driver, version 390, supports GTX ??? series"
#TODO: Optimus support?
#TODO: void-repo-nonfree
PACKAGES="nvidia390"
function post_install {
function post-install {
#TODO: nvidia modeset kernel parameter?
echo "nvidia/nvidia390" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if xbps-query glibc >/dev/null 2>&1; then
return 0
else
@ -10,10 +9,9 @@ function check {
DESCRIPTION="Legacy Nvidia driver, version 470, supports GTX ??? series"
#TODO: optimus support?
#TODO: void-repo-nonfree
PACKAGES="nvidia470"
function post_install {
function post-install {
#TODO: nvidia modeset kernel parameter?
echo "nvidia/nvidia470" >> /tmp/stage-2-choices
}

View File

@ -6,9 +6,8 @@ DESCRIPTION="Only add custom bashrc (advanced users)"
PACKAGES=""
function post_install {
function post-install {
#TODO: configure things
# (probably by barfing the bashrc using echo)
echo "pre-configure/bashrc" >> /tmp/stage-2-choices
}

View File

@ -10,7 +10,7 @@ DESCRIPTION="Auto-start GUI session on login and add custom bashrc (recommended)
PACKAGES=""
function post_install {
function post-install {
#TODO: configure things
echo "pre-configure/gui-and-bashrc" >> /tmp/stage-2-choices

View File

@ -6,6 +6,6 @@ DESCRIPTION="No (advanced users)"
PACKAGES=""
function post_install {
function post-install {
echo "pre-configure/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/icewm" /tmp/stage-2-choices >/dev/null 2>&1; then
if grep "audio/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 0
@ -16,6 +15,6 @@ DESCRIPTION="Add tray icon for network"
#TODO
PACKAGES=""
function post_install {
function post-install {
echo "systray/network" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/icewm" /tmp/stage-2-choices >/dev/null 2>&1; then
if grep "audio/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
@ -16,6 +15,6 @@ DESCRIPTION="Add tray icon for network and audio"
#TODO
PACKAGES=""
function post_install {
function post-install {
echo "systray/network-and-audio" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="Dont install additional tray icons"
PACKAGES=""
function post_install {
function post-install {
echo "systray/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="LXDE Terminal (recommended)"
PACKAGES="lxterminal"
function post_install {
function post-install {
echo "terminal/lxterminal" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="None (advanced users only)"
PACKAGES="none"
function post_install {
function post-install {
echo "terminal/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Xterm"
PACKAGES="xterm"
function post_install {
function post-install {
echo "terminal/xterm" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -13,6 +12,6 @@ DESCRIPTION="Fully featured (list of things) (recommended)"
#TODO
PACKAGES=""
function post_install {
function post-install {
echo "utilities/desktop-integrated-guisysmon" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -13,6 +12,6 @@ DESCRIPTION="Fully featured (list of things with htop)"
#TODO
PACKAGES=""
function post_install {
function post-install {
echo "utilities/desktop-integrated-htop" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="None"
PACKAGES=""
function post_install {
function post-install {
echo "utilities/none" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -13,6 +12,6 @@ DESCRIPTION="Smaller set of desktop utilities (XFE + ???)"
#TODO
PACKAGES="xfe"
function post_install {
function post-install {
echo "utilities/xfe-guisysmon" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Smaller set of desktop utilities (XFE + Htop)"
PACKAGES="xfe htop"
function post_install {
function post-install {
echo "utilities/xfe-htop" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
return 0
}
@ -7,6 +6,6 @@ DESCRIPTION="Install ELinks (terminal-based browser)"
PACKAGES="elinks"
function post_install {
function post-install {
echo "web/elinks" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Join the dark side with Chromium (Consider Firefox... You can still
PACKAGES="chromium"
function post_install {
function post-install {
echo "web/evil" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Install Firefox (recommended)"
PACKAGES="firefox"
function post_install {
function post-install {
echo "web/firefox" >> /tmp/stage-2-choices
}

View File

@ -1,5 +1,4 @@
function check {
[ "$INTERNET" = "down" ] && return 1
if grep "desktop/none" /tmp/stage-2-choices >/dev/null 2>&1; then
return 1
else
@ -11,6 +10,6 @@ DESCRIPTION="Install Firefox - Extended Support Release (ESR)"
PACKAGES="firefox-esr"
function post_install {
function post-install {
echo "web/firefox-esr" >> /tmp/stage-2-choices
}

View File

@ -6,6 +6,6 @@ DESCRIPTION="No web browser"
PACKAGES=""
function post_install {
function post-install {
echo "web/none" >> /tmp/stage-2-choices
}