Compare commits
No commits in common. "f1ee7c85dd3c274de16f08ad0ae93ca79da8d9b7" and "3f10d03ad5676e1cc8648cb91439fd7eff459507" have entirely different histories.
f1ee7c85dd
...
3f10d03ad5
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
LOGFILE=/tmp/void-usb-install-log
|
LOGFILE=/tmp/void-usb-install-log
|
||||||
GIT_REPO_BASE="https://lostcave.ddnss.de/git/BodgeMaster/void-usb/raw/branch/master"
|
GIT_REPO_BASE="https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master"
|
||||||
|
|
||||||
function press_any_key {
|
function press_any_key {
|
||||||
echo "Press any key to continue or Ctrl+c to abort..."
|
echo "Press any key to continue or Ctrl+c to abort..."
|
||||||
|
@ -78,7 +78,9 @@ echo -n "Installing xmirror, squashfs-tools, wget... "
|
||||||
xbps-install --yes xmirror wget >> $LOGFILE 2>&1
|
xbps-install --yes xmirror wget >> $LOGFILE 2>&1
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
#TODO: Select keyboard layout by showing lists of what's present (directories for region, then files within)
|
#TODO: If going down the path of extracting routines from void-installer, that should be done here
|
||||||
|
|
||||||
|
#TODO: Select keyboard layout
|
||||||
KBD_LAYOUT="de-latin1"
|
KBD_LAYOUT="de-latin1"
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
@ -205,32 +207,15 @@ the chosen mirror from the config file it generates.
|
||||||
"
|
"
|
||||||
press_any_key
|
press_any_key
|
||||||
xmirror
|
xmirror
|
||||||
|
#TODO: also remove CPU architecture
|
||||||
TARGET_MIRROR="$(sed 's/repository=//;s|/musl$||' /etc/xbps.d/00-repository-main.conf)"
|
TARGET_MIRROR="$(sed 's/repository=//;s|/musl$||' /etc/xbps.d/00-repository-main.conf)"
|
||||||
|
|
||||||
|
#TODO: select installation type
|
||||||
|
TARGET_TYPE="x86_64"
|
||||||
|
|
||||||
#TODO: allow only 32 bit on a 32 bit system
|
#TODO: also add CPU architecture
|
||||||
options=("x86_64" "x86_64 musl" "x86_32")
|
|
||||||
while true; do
|
|
||||||
echo "Select your desired architecture."
|
|
||||||
for i in "${!options[@]}"; do
|
|
||||||
echo "$((i+1)): ${options[$i]}"
|
|
||||||
done
|
|
||||||
|
|
||||||
read -p "Input your choice (number): " choice
|
|
||||||
|
|
||||||
if [ "$choice" -ge 1 ] && [ "$choice" -le "${#options[@]}" ]; then
|
|
||||||
TARGET_TYPE="${options[$((choice-1))]}"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "Selection invalid."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "You selected: $TARGET_TYPE"
|
|
||||||
|
|
||||||
if grep "musl" <<< "$TARGET_TYPE"; then
|
if grep "musl" <<< "$TARGET_TYPE"; then
|
||||||
TARGET_MIRROR="$TARGET_MIRROR/musl"
|
TARGET_MIRROR="$TARGET_MIRROR/musl"
|
||||||
TARGET_TYPE="$(sed -e 's/ musl//' <<< "$TARGET_TYPE")"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Copying repository keys... "
|
echo -n "Copying repository keys... "
|
||||||
|
@ -317,6 +302,8 @@ else
|
||||||
echo "KEYMAP=\"$KBD_LAYOUT\"" >> /mnt/target/etc/rc.conf
|
echo "KEYMAP=\"$KBD_LAYOUT\"" >> /mnt/target/etc/rc.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#TODO: Figure out how to configure keyboard for Xorg
|
||||||
|
|
||||||
#TODO timezone
|
#TODO timezone
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
LOGFILE=/tmp/void-usb-install-log
|
LOGFILE=/tmp/void-usb-install-log
|
||||||
STAGE2_DIR="/opt/void-usb/installer/"
|
|
||||||
|
|
||||||
function press_any_key {
|
function press_any_key {
|
||||||
echo "Press any key to continue or Ctrl+c to abort..."
|
echo "Press any key to continue or Ctrl+c to abort..."
|
||||||
|
@ -70,7 +69,6 @@ Alternatively, you can continue without internet but the system will be left in
|
||||||
echo -n "."
|
echo -n "."
|
||||||
done
|
done
|
||||||
echo " $INTERNET"
|
echo " $INTERNET"
|
||||||
# TODO: allow to connect again if still no internet
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -81,20 +79,25 @@ if [ "$INTERNET" = "up" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
STAGE2_DIR="/opt/void-usb/installer/" # Change this to your desired directory
|
||||||
CONFIG_DIR="$STAGE2_DIR/custom-scripts"
|
CONFIG_DIR="$STAGE2_DIR/custom-scripts"
|
||||||
|
SCRIPT_LIST="$CONFIG_DIR/scripts.lst"
|
||||||
SCRIPTS=()
|
SCRIPTS=()
|
||||||
NAMES=()
|
NAMES=()
|
||||||
DESCRIPTIONS=()
|
DESCRIPTIONS=()
|
||||||
|
|
||||||
|
# Find all scripts and extract their names & descriptions
|
||||||
echo "Scanning for configuration scripts in $CONFIG_DIR..."
|
echo "Scanning for configuration scripts in $CONFIG_DIR..."
|
||||||
for script in "$CONFIG_DIR"/*.sh; do
|
for script in "$CONFIG_DIR"/*.sh; do
|
||||||
[ -f "$script" ] || continue # Skip if no .sh files found
|
[ -f "$script" ] || continue # Skip if no .sh files found
|
||||||
SCRIPTS+=("$script")
|
SCRIPTS+=("$script")
|
||||||
|
|
||||||
SCRIPT_NAME=$(grep '^# NAME:' "$script" | sed 's/^# NAME:[[:space:]]*//')
|
# Extract name from "# NAME:" (first occurrence)
|
||||||
|
SCRIPT_NAME=$(grep -m1 '^# NAME:' "$script" | sed 's/^# NAME:[[:space:]]*//')
|
||||||
[ -z "$SCRIPT_NAME" ] && SCRIPT_NAME="$(basename "$script")"
|
[ -z "$SCRIPT_NAME" ] && SCRIPT_NAME="$(basename "$script")"
|
||||||
|
|
||||||
SCRIPT_DESC=$(grep '^# DESC:' "$script" | sed 's/^# DESC:[[:space:]]*//')
|
# Extract description from "# DESC:" (first occurrence)
|
||||||
|
SCRIPT_DESC=$(grep -m1 '^# DESC:' "$script" | sed 's/^# DESC:[[:space:]]*//')
|
||||||
[ -z "$SCRIPT_DESC" ] && SCRIPT_DESC="No description available."
|
[ -z "$SCRIPT_DESC" ] && SCRIPT_DESC="No description available."
|
||||||
|
|
||||||
NAMES+=("$SCRIPT_NAME")
|
NAMES+=("$SCRIPT_NAME")
|
||||||
|
@ -107,51 +110,36 @@ if [ ${#SCRIPTS[@]} -eq 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Display menu dynamically
|
||||||
echo "Available configurations:"
|
echo "Available configurations:"
|
||||||
for i in "${!SCRIPTS[@]}"; do
|
for i in "${!SCRIPTS[@]}"; do
|
||||||
echo "$((i+1)): ${NAMES[i]} - ${DESCRIPTIONS[i]}"
|
echo "$((i+1))) ${NAMES[i]} - ${DESCRIPTIONS[i]}"
|
||||||
done
|
done
|
||||||
echo "$(( ${#SCRIPTS[@]} + 1 )): Exit"
|
echo "$(( ${#SCRIPTS[@]} + 1 ))) Exit"
|
||||||
|
|
||||||
CHOICE=0
|
# Get user input
|
||||||
while ! (( CHOICE >= 1 && CHOICE <= ${#SCRIPTS[@]} )); do
|
read -p "Select an option [1-$((${#SCRIPTS[@]}+1))]: " CHOICE
|
||||||
read -p "Select an option [1-$((${#SCRIPTS[@]}+1))]: " CHOICE
|
|
||||||
if (( CHOICE >= 1 && CHOICE <= ${#SCRIPTS[@]} )); then
|
|
||||||
echo "Running: ${NAMES[CHOICE-1]}"
|
|
||||||
bash "${SCRIPTS[CHOICE-1]}"
|
|
||||||
elif (( CHOICE == ${#SCRIPTS[@]} + 1 )); then
|
|
||||||
echo "Exiting..."
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "Invalid choice."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
# Run selected script
|
||||||
|
if (( CHOICE >= 1 && CHOICE <= ${#SCRIPTS[@]} )); then
|
||||||
|
echo "Running: ${NAMES[CHOICE-1]}"
|
||||||
|
bash "${SCRIPTS[CHOICE-1]}"
|
||||||
|
elif (( CHOICE == ${#SCRIPTS[@]} + 1 )); then
|
||||||
|
echo "Exiting..."
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Invalid choice."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Stage 2 Tasks
|
||||||
echo "Setting up user..."
|
echo "Setting up user..."
|
||||||
read -p "Enter username: " NEW_USER
|
read -p "Enter username: " NEW_USER
|
||||||
#TODO: let the user choose additional groups (suggest sane defaults for different use cases)
|
useradd -m -G wheel "$NEW_USER"
|
||||||
# cdrom? optical? storage? what they do?
|
|
||||||
# scanner
|
|
||||||
# network (check if this even still does anything)
|
|
||||||
# kvm
|
|
||||||
# audio, video
|
|
||||||
# dialout
|
|
||||||
# users (dows this even do anything)
|
|
||||||
useradd -m -s /bin/bash -G wheel "$NEW_USER"
|
|
||||||
passwd "$NEW_USER"
|
passwd "$NEW_USER"
|
||||||
|
|
||||||
echo "Cleaning up installation files..."
|
echo "Cleaning up installation files..."
|
||||||
mv /mnt/target/etc/sv/agetty-tty1/conf.bak /mnt/target/etc/sv/agetty-tty1/conf >> $LOGFILE 2>&1
|
|
||||||
if [ -f /root/.profile.bak ]; then
|
|
||||||
mv /root/.profile.bak /root/.profile
|
|
||||||
else
|
|
||||||
rm /root/.profile
|
|
||||||
fi
|
|
||||||
rm -rf "$STAGE2_DIR"
|
rm -rf "$STAGE2_DIR"
|
||||||
|
mv /mnt/target/etc/sv/agetty-tty1/conf.bak /mnt/target/etc/sv/agetty-tty1/conf >> $LOGFILE 2>&1
|
||||||
|
|
||||||
clear
|
bash --norc --noprofile
|
||||||
echo "To save the changes made to the system, a new system image needs to be created.
|
|
||||||
|
|
||||||
The system will reboot now. While shutting down, you will be asked about creating a system image. Choose yes."
|
|
||||||
|
|
||||||
reboot
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
TODO:
|
TODO:
|
||||||
|
make sure that gufw works as intended
|
||||||
|
check for Nvidia Optimus support - or make it happen somehow
|
||||||
compare sizes of glibc and musl installations
|
compare sizes of glibc and musl installations
|
||||||
need xdg menu maker?
|
need xdg menu maker?
|
||||||
adjust required USB stick and RAM size in README
|
adjust required USB stick and RAM size in README
|
||||||
|
@ -7,27 +9,114 @@ do not rely on the RTC
|
||||||
- use ntp to get time
|
- use ntp to get time
|
||||||
- only fall back to using rtc if offline
|
- only fall back to using rtc if offline
|
||||||
- do not set the RTC
|
- do not set the RTC
|
||||||
make our own time zone selection
|
make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
|
||||||
keyboard?
|
- potentially interesting packages
|
||||||
|
- ckbcomp
|
||||||
|
- kbd-data
|
||||||
overview of the installation process at the start
|
overview of the installation process at the start
|
||||||
overall progress indication (step x out of y)
|
overall progress indication (step x out of y)
|
||||||
look into roxterm as an alternative terminal
|
look into roxterm as an alternative terminal
|
||||||
deal with the entropy thing that runs after rc.shutdown
|
deal with the entropy thing that runs after rc.shutdown
|
||||||
|
first run message in .xinitrc.d
|
||||||
|
- auto-removes itself
|
||||||
|
- displays README.txt on root dir of the F2FS partition
|
||||||
add online check to all the selections that need internet
|
add online check to all the selections that need internet
|
||||||
sort out /etc/resolv.conf for the chroot
|
sort out /etc/resolv.conf for the chroot
|
||||||
set keyboard layout for initramfs
|
set keyboard layout for initramfs
|
||||||
tell user about expected GRUB error messaegs
|
tell user about expected GRUB error messaegs
|
||||||
disable hibernate, warn about suspend
|
disable suspend and hibernate
|
||||||
use zswap
|
when shutting down, let Xorg exit first, then run `loginctl {poweroff,reboot}`
|
||||||
rices: when shutting down, let Xorg exit first, then run `loginctl {poweroff,reboot}`
|
add polkit to common packages
|
||||||
- this is needed so the user can interact with the console
|
|
||||||
https://github.com/aarnt/octoxbps
|
https://github.com/aarnt/octoxbps
|
||||||
system-image
|
system-image
|
||||||
check that all output goes to current TTY
|
check that all output goes to current TTY
|
||||||
|
|
||||||
|
package selections:
|
||||||
|
desktop
|
||||||
|
icewm-full
|
||||||
|
packages
|
||||||
|
-> audio applet -> volctl
|
||||||
|
-> system monitor, file browser, image viewer, text editor, archive manager
|
||||||
|
-> GUI package manager? GUI update manager?
|
||||||
|
-> notification daemon?
|
||||||
|
xscreensaver
|
||||||
|
blueman
|
||||||
|
-> BT support?
|
||||||
|
post-install
|
||||||
|
add ultimate.bashrc
|
||||||
|
add backgrounds
|
||||||
|
modify bashrc to auto-start X if not already running
|
||||||
|
kick off scripts in .xinitrc.d from .xinitrc
|
||||||
|
exec icewm-session from .xinitrc
|
||||||
|
add to .xinitrc.d
|
||||||
|
start pipewire, pipewire-pulse, wireplumber
|
||||||
|
start conky
|
||||||
|
start desktop applets
|
||||||
|
volctl &
|
||||||
|
nm-applet &
|
||||||
|
blueman-applet &
|
||||||
|
display README
|
||||||
|
start xscreensaver
|
||||||
|
xscreensaver --no-splash &
|
||||||
|
start conky
|
||||||
|
conky &
|
||||||
|
put README.txt with relevant information on root dir of F2FS partition
|
||||||
|
symlink to /home/README.txt
|
||||||
|
add a symlink ~/.local/bin/xterm that points to lxterminal
|
||||||
|
configure icewm
|
||||||
|
startup script
|
||||||
|
choose random background
|
||||||
|
configuration
|
||||||
|
configure conky
|
||||||
|
configure xscreensaver
|
||||||
|
icewm-lite
|
||||||
|
post-install
|
||||||
|
add ultimate.bashrc
|
||||||
|
modify bashrc to auto-start X if not already running
|
||||||
|
kick off scripts in .xinitrc.d from .xinitrc
|
||||||
|
exec icewm (not session) from .xinitrc
|
||||||
|
add to .xinitrc.d
|
||||||
|
start pipewire, pipewire-pulse, wireplumber
|
||||||
|
display README
|
||||||
|
put README.txt with relevant information on root dir of F2FS partition
|
||||||
|
symlink to /home/README.txt
|
||||||
|
configure icewm
|
||||||
|
none
|
||||||
|
post-install
|
||||||
|
add ultimate.bashrc
|
||||||
|
modify bashrc to display README
|
||||||
|
put README.txt with relevant information on root dir of F2FS partition
|
||||||
|
symlink to /home/README.txt
|
||||||
|
|
||||||
|
|
||||||
|
musl downsides:
|
||||||
|
- no nvidia drivers
|
||||||
|
- may be janky in regards to running some Minecraft versions
|
||||||
|
musl upsides:
|
||||||
|
- ??
|
||||||
|
|
||||||
Stage 1:
|
Stage 1:
|
||||||
-> select kb layout
|
-> select kb layout
|
||||||
|
-> select installation type (x86_32/x86_64, glibc/musl)
|
||||||
-> configure time zone
|
-> configure time zone
|
||||||
-> selection dialog?
|
-> selection dialog?
|
||||||
-> symlink /etc/localtime
|
-> symlink /etc/localtime
|
||||||
|
|
||||||
|
Stage 2:
|
||||||
|
-> set up user
|
||||||
|
-> ask for username
|
||||||
|
-> run useradd (non-interactively)
|
||||||
|
-> useradd --groups "comma,separated,groups" --create-home --shell /bin/bash $USERNAME
|
||||||
|
-> groups: dialout users wheel
|
||||||
|
-> ?? groups:
|
||||||
|
-> cdrom optical - can listen to CDs? Can watch DVDs? Can mount / unmount CDs/DVDs?
|
||||||
|
-> storage - can mount / unmount disks from GUI?
|
||||||
|
-> scanner - can scan things (for example using XSane?)
|
||||||
|
-> network - can interface with NetworkManager?
|
||||||
|
-> kvm - can run QEMU?
|
||||||
|
-> run passwd (interactively)
|
||||||
|
-> clean up
|
||||||
|
-> mv /mnt/target/etc/sv/agetty-tty1/conf.bak /mnt/target/etc/sv/agetty-tty1/conf
|
||||||
|
-> if [ -f /mnt/target/root/.profile.bak ]; then mv /mnt/target/root/.profile.bak /mnt/target/root/.profile; else rm /mnt/target/root/.profile; fi
|
||||||
|
-> rm -r /opt/void-usb/installer
|
||||||
|
-> build new squashfs image and reboot
|
||||||
|
|
Loading…
Reference in New Issue