Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster db6c18e67a install stage 1: all sorts of minor fixes and rc.conf configuration 2023-06-14 09:47:23 +02:00
BodgeMaster b36a64f223 documentation update 2023-06-14 09:42:48 +02:00
3 changed files with 152 additions and 43 deletions

View File

@ -4,23 +4,25 @@ This repository holds a bunch of scripts for installing and customizing
Void Linux to run off a USB stick. Void Linux to run off a USB stick.
There are a couple manual steps to get started before this script can take over: There are a couple manual steps to get started before this script can take over:
- Set up a Void live image - Set up a Void live medium
- Download here: https://voidlinux.org/download/ - Download here: https://voidlinux.org/download/
- The base image is good enough (dont waste your time) - The following instructions assume you downloaded the "base" image
- Burn to a CD/DVD or flash it to a USB stick - Burn to a CD/DVD or flash it to a USB stick
- Windows should have a built-in thing for burning ISOs. - Windows should have a built-in thing for burning ISOs.
- You can use something like Win32DiskImager or Rufus for USB sticks. - You can use something like Win32DiskImager or Rufus for USB sticks.
- This will delete whats on the stick. - This will delete whats on the stick.
- Boot into Void live and prepare things - Boot into Void live and prepare things
- How to boot off CD/USB depends on your computer, so youll have to find out elsewhere (sorry). - Two things I cant help you with (sorry):
- How to boot off CD/USB depends on your computer, so youll have to find out elsewhere.
- Be aware that Void uses a US keymap until you change it. If your keyboard is different, you might need to look up an image of a US keyboard to find the right keys.
- If you are booting off the USB stick you want to install to, use the (RAM) option. - If you are booting off the USB stick you want to install to, use the (RAM) option.
- Log in as `root`, password `voidlinux` - Log in as `root`, password `voidlinux`
- Run `void-installer` - If you need to use WiFi, run `void-installer`
- set your keyboard layout (optional) - set your keyboard layout (optional)
- connect to your network - connect to your network
- abort the installation - abort the installation
- Download and run stage 1 of the USB installation - Download and run stage 1 of the USB installation script
- `xbps-install -S wget` - The base image doesnt come with a way to download files so you need to install that first: `xbps-install -S wget`
- if it yells at you about updating xbps, do that, then try again - if it yells at you about updating xbps, do that, then try again
- `wget https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/install-stage1.sh` - `wget https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/install-stage1.sh`
- `bash install-stage1.sh` - `bash install-stage1.sh`

View File

@ -15,13 +15,32 @@ function are_you_really_really_sure {
fi fi
} }
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
}
clear clear
echo " echo "
This script will now install Void Linux on your USB stick. This script will now download and install Void Linux on your USB stick.
It will be formatted and will not be usable from Windows or MacOS. Any data that is currently on the stick will be lost and it wont be
usable from Windows or MacOS.
Before we begin, lets make sure some dependencies are installed on the host/live system: Before we begin, the following tools need to be installed:
- up-to-date xbps
- xmirror - xmirror
- squashfs-tools" - squashfs-tools"
press_any_key press_any_key
@ -39,12 +58,13 @@ KBD_LAYOUT="de-latin1"
clear clear
echo "Select the USB stick to install to (NAME column below)... echo "Select the USB stick to install to (NAME column below)...
" "
lsblk --nodeps --output NAME,SIZE,MODEL # exclude loop devices
lsblk --exclude 7 --nodeps --output NAME,SIZE,MODEL
echo "" echo ""
read -p "> " TARGET_DISK read -p "> " TARGET_DISK
while [ ! -b "/dev/$TARGET_DISK" ]; do while [ ! -b "/dev/$TARGET_DISK" ]; do
lsblk --nodeps --output NAME,SIZE,MODEL lsblk --exclude 7 --nodeps --output NAME,SIZE,MODEL
echo "$TARGET_DISK is not a valid device!" echo "$TARGET_DISK is not a valid device!"
read -p "> " TARGET_DISK read -p "> " TARGET_DISK
done done
@ -125,8 +145,11 @@ clear
echo "Storage is now prepared and ready for installation. echo "Storage is now prepared and ready for installation.
You need to select a download mirror for Void next. You need to select a download mirror for Void next.
The script will launch xmirror on the host system and read the mirror The script will launch xmirror on the host/live system and determine
from the config file it generates." the chosen mirror from the config file it generates.
TODO:
"
press_any_key press_any_key
xmirror xmirror
@ -142,7 +165,7 @@ fi
mkdir -p /mnt/target/var/db/xbps/keys mkdir -p /mnt/target/var/db/xbps/keys
cp /var/db/xbps/keys/* /mnt/target/var/db/xbps/keys/ cp /var/db/xbps/keys/* /mnt/target/var/db/xbps/keys/
XBPS_ARCH="$TARGET_TYPE" xbps-install -S -r /mnt/target -R "$TARGET_MIRROR" \ XBPS_ARCH="$TARGET_TYPE" xbps-install --yes --sync --rootdir /mnt/target --repository "$TARGET_MIRROR" \
linux bash shadow f2fs-tools dosfstools dbus NetworkManager iana-etc \ linux bash shadow f2fs-tools dosfstools dbus NetworkManager iana-etc \
iw wpa_supplicant util-linux which tar man-pages iproute2 iputils \ iw wpa_supplicant util-linux which tar man-pages iproute2 iputils \
wifi-firmware traceroute grep gzip file sed gawk less coreutils findutils \ wifi-firmware traceroute grep gzip file sed gawk less coreutils findutils \
@ -167,5 +190,84 @@ UUID=$(blkid --output value --match-tag UUID $TARGET_PART_EFI) /boot/efi vfat de
/container/home /home none bind 0 0 /container/home /home none bind 0 0
" > /mnt/target/etc/fstab " > /mnt/target/etc/fstab
if grep "#KEYMAP=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#KEYMAP=.*/KEYMAP="'"$KBD_LAYOUT"'"/'
else
clear
echo "WARNING: Could not locate the keymap setting in rc.conf."
echo "The script will attempt to add one."
echo ""
press_any_key
echo "" >> /mnt/target/etc/rc.conf
echo "# Install script could not find keymap setting, adding one here." >> /mnt/target/etc/rc.conf
echo "KEYMAP=\"$KBD_LAYOUT\"" >> /mnt/target/etc/rc.conf
fi
#TODO timezone
clear
echo "Set hardware clock to UTC?
Most Unix/Linux systems set the clock in your computer to UTC and add
the time zone on-the-fly. If you use Windows, you will want to answer no here.
"
if yesno; then
if grep "#HARDWARECLOCK=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="UTC"/'
else
clear
echo "WARNING: Could not locate the hardwareclock setting in rc.conf."
echo "The script will attempt to add one."
echo ""
press_any_key
echo "" >> /mnt/target/etc/rc.conf
echo "# Install script could not find hardwareclock setting, adding one here." >> /mnt/target/etc/rc.conf
echo 'HARDWARECLOCK="UTC"' >> /mnt/target/etc/rc.conf
fi
else
if grep "#HARDWARECLOCK=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="localtime"/'
else
clear
echo "WARNING: Could not locate the hardwareclock setting in rc.conf."
echo "The script will attempt to add one."
echo ""
press_any_key
echo "" >> /mnt/target/etc/rc.conf
echo "# Install script could not find hardwareclock setting, adding one here." >> /mnt/target/etc/rc.conf
echo 'HARDWARECLOCK="localtime"' >> /mnt/target/etc/rc.conf
fi
fi
clear
echo "Do you want to set a hostname?
This is equivalent to giving a name to your computer - except it's a system
on a USB drive.
If you leave this empty, it will be set to void-usb.
Allowed characters are a-zA-Z0-9 (and - in the middle).
"
while [ -z "$TARGET_HOSTNAME" ]; do
read -p "> " TARGET_HOSTNAME
if [ -z "$TARGET_HOSTNAME" ]; then
TARGET_HOSTNAME="void-usb"
else
if grep -e "^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$" -e "^[a-zA-Z0-9]*$" <<< "$TARGET_HOSTNAME" > /dev/null 2>&1; then
echo "$TARGET_HOSTNAME" > /mnt/target/etc/hostname
else
echo "Allowed characters are a-zA-Z0-9 (and - in the middle)."
unset TARGET_HOSTNAME
fi
fi
done
# #

View File

@ -25,21 +25,23 @@ Steps to install:
-> download and run install script -> download and run install script
- preparations: - preparations:
-> update xbps -> update xbps
-> install xmirror -> install xmirror squashfs-tools
-> make our own or extract kb selection and time zone selection (if feasible) to hijack them for our purposes -> make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
- select kb layout - select kb layout
- warn user about formatting and making the USB stick unusable with Windows - set up disk
- set up disks
-> select disk from a list -> select disk from a list
-> warn user about formatting and making the USB stick unusable with Windows
-> allow user to double check that its the USB drive -> allow user to double check that its the USB drive
-> wipe disk (new gpt) -> wipe and partition disk (new gpt)
-> partition disk -> 2M BIOS GRUB
-> 270M ESP (if needed) or 2M BIOS GRUB -> 268M ESP
-> partition that holds home and the squashfs image -> 1G /boot
-> format partitions (use force option) -> rest /container
-> format partitions
-> ESP FAT32 -> ESP FAT32
-> rest F2FS -> /boot and /container F2FS
- mount them things, set up tmpfs as / for now - mount them things
-> set up plain tmpfs as / for now
- install base system - install base system
-> select mirror -> select mirror
-> just use xmirror and get the result from the file -> just use xmirror and get the result from the file
@ -48,18 +50,28 @@ Steps to install:
-> if musl, add that bit to repo url -> if musl, add that bit to repo url
-> install packages -> install packages
-> linux bash shadow f2fs-tools dosfstools dbus NetworkManager iana-etc iw wpa_supplicant util-linux which tar man-pages iproute2 iputils wifi-firmware traceroute grep gzip file sed gawk less coreutils findutils diffutils pciutils usbutils tzdata base-files ncurses mdocml procps-ng kbd xbps sudo ethtool kmod eudev runit-void removed-packages nano acpid squashfs-tools -> linux bash shadow f2fs-tools dosfstools dbus NetworkManager iana-etc iw wpa_supplicant util-linux which tar man-pages iproute2 iputils wifi-firmware traceroute grep gzip file sed gawk less coreutils findutils diffutils pciutils usbutils tzdata base-files ncurses mdocml procps-ng kbd xbps sudo ethtool kmod eudev runit-void removed-packages nano acpid squashfs-tools
-> configure XBPS (set mirror?, anything else?) -> configure XBPS mirror
-> configure sudo -> configure sudo
-> drop a file with "%wheel ALL=(ALL:ALL) ALL" in /etc/sudoers.d/sudo_group -> drop a file with "%wheel ALL=(ALL:ALL) ALL" in /etc/sudoers.d/sudo_group
-> configure overlayfs setup -> configure overlayfs setup
-> configure tmpfses -> startup script
-> configure /home (bind mount or symlink?) -> shutdown squashfs updater
-> configure keymap (etc/rc.conf)
-> configure shutdown squashfs updater
-> rc.shutdown? -> rc.shutdown?
-> configure fstab
-> /boot, /boot/efi
-> /home (bind mount)
-> NOT /, /container
-> configure rc.conf
-> keyboard layout
-> hardware clock set to UTC?
-> configure time zone while were at it
-> selection dialog?
-> symlink /etc/localtime
-> configure host name
-> configure and install bootloader -> configure and install bootloader
-> determine BIOS or UEFI -> if x86 install for both UEFI and BIOS
-> if UEFI, install as removable device -> Is there a way we can make this work with 32-bit AND 64-bit EFI at the same time?
-> if ARM install only UEFI
-> xbps-reconfigure -fa -> xbps-reconfigure -fa
-> prepare 2nd stage installation -> prepare 2nd stage installation
-> auto login root -> auto login root
@ -73,19 +85,12 @@ Steps to install:
-> NetworkManager -> NetworkManager
-> acpid -> acpid
-> ask user to connect to network using nmtui -> ask user to connect to network using nmtui
-> set up timezone
-> ask user which zone
-> ask user whether to use UTC or local time
-> configure (rc.conf and /etc/localtime)
-> set hostname
-> ask user
-> configure
-> install packages -> install packages
-> 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 -> 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
-> terminal? -> terminal?
-> browser? -> browser?
-> prism launcher -> prism launcher
-> java -> java (multiple versions?)
-> pipewire (pulsemixer?) -> pipewire (pulsemixer?)
-> ask about nvidia driver -> ask about nvidia driver
-> install if needed -> install if needed