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.
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/
- 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
- Windows should have a built-in thing for burning ISOs.
- You can use something like Win32DiskImager or Rufus for USB sticks.
- This will delete whats on the stick.
- 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.
- Log in as `root`, password `voidlinux`
- Run `void-installer`
- If you need to use WiFi, run `void-installer`
- set your keyboard layout (optional)
- connect to your network
- abort the installation
- Download and run stage 1 of the USB installation
- `xbps-install -S wget`
- Download and run stage 1 of the USB installation script
- 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
- `wget https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/install-stage1.sh`
- `bash install-stage1.sh`

View File

@ -15,13 +15,32 @@ function are_you_really_really_sure {
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
echo "
This script will now install Void Linux on your USB stick.
It will be formatted and will not be usable from Windows or MacOS.
This script will now download and install Void Linux on your USB stick.
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:
- up-to-date xbps
Before we begin, the following tools need to be installed:
- xmirror
- squashfs-tools"
press_any_key
@ -39,12 +58,13 @@ KBD_LAYOUT="de-latin1"
clear
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 ""
read -p "> " TARGET_DISK
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!"
read -p "> " TARGET_DISK
done
@ -125,8 +145,11 @@ clear
echo "Storage is now prepared and ready for installation.
You need to select a download mirror for Void next.
The script will launch xmirror on the host system and read the mirror
from the config file it generates."
The script will launch xmirror on the host/live system and determine
the chosen mirror from the config file it generates.
TODO:
"
press_any_key
xmirror
@ -142,7 +165,7 @@ fi
mkdir -p /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 \
iw wpa_supplicant util-linux which tar man-pages iproute2 iputils \
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
" > /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
- preparations:
-> update xbps
-> install xmirror
-> make our own or extract kb selection and time zone selection (if feasible) to hijack them for our purposes
-> install xmirror squashfs-tools
-> make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
- select kb layout
- warn user about formatting and making the USB stick unusable with Windows
- set up disks
- set up disk
-> select disk from a list
-> allow user to double check that its the USB drive
-> wipe disk (new gpt)
-> partition disk
-> 270M ESP (if needed) or 2M BIOS GRUB
-> partition that holds home and the squashfs image
-> format partitions (use force option)
-> warn user about formatting and making the USB stick unusable with Windows
-> allow user to double check that its the USB drive
-> wipe and partition disk (new gpt)
-> 2M BIOS GRUB
-> 268M ESP
-> 1G /boot
-> rest /container
-> format partitions
-> ESP FAT32
-> rest F2FS
- mount them things, set up tmpfs as / for now
-> /boot and /container F2FS
- mount them things
-> set up plain tmpfs as / for now
- install base system
-> select mirror
-> 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
-> 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
-> configure XBPS (set mirror?, anything else?)
-> configure XBPS mirror
-> configure sudo
-> drop a file with "%wheel ALL=(ALL:ALL) ALL" in /etc/sudoers.d/sudo_group
-> configure overlayfs setup
-> configure tmpfses
-> configure /home (bind mount or symlink?)
-> configure keymap (etc/rc.conf)
-> configure shutdown squashfs updater
-> rc.shutdown?
-> startup script
-> shutdown squashfs updater
-> 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
-> determine BIOS or UEFI
-> if UEFI, install as removable device
-> if x86 install for both UEFI and BIOS
-> 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
-> prepare 2nd stage installation
-> auto login root
@ -73,19 +85,12 @@ Steps to install:
-> NetworkManager
-> acpid
-> 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
-> 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?
-> browser?
-> prism launcher
-> java
-> java (multiple versions?)
-> pipewire (pulsemixer?)
-> ask about nvidia driver
-> install if needed