Compare commits
No commits in common. "db6c18e67a51012fb8b1662d46822d361ea52d4f" and "cc16479341b250db39c79d219b392e1aff4064e7" have entirely different histories.
db6c18e67a
...
cc16479341
14
README.md
14
README.md
|
@ -4,25 +4,23 @@ 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 medium
|
||||
- Set up a Void live image
|
||||
- Download here: https://voidlinux.org/download/
|
||||
- The following instructions assume you downloaded the "base" image
|
||||
- The base image is good enough (don’t waste your time)
|
||||
- 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 what’s on the stick.
|
||||
- Boot into Void live and prepare things
|
||||
- Two things I can’t help you with (sorry):
|
||||
- How to boot off CD/USB depends on your computer, so you’ll 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.
|
||||
- How to boot off CD/USB depends on your computer, so you’ll have to find out elsewhere (sorry).
|
||||
- If you are booting off the USB stick you want to install to, use the (RAM) option.
|
||||
- Log in as `root`, password `voidlinux`
|
||||
- If you need to use WiFi, run `void-installer`
|
||||
- Run `void-installer`
|
||||
- set your keyboard layout (optional)
|
||||
- connect to your network
|
||||
- abort the installation
|
||||
- Download and run stage 1 of the USB installation script
|
||||
- The base image doesn’t come with a way to download files so you need to install that first: `xbps-install -S wget`
|
||||
- Download and run stage 1 of the USB installation
|
||||
- `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`
|
||||
|
|
|
@ -15,32 +15,13 @@ 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 download and install Void Linux on your USB stick.
|
||||
Any data that is currently on the stick will be lost and it won’t be
|
||||
usable from Windows or MacOS.
|
||||
This script will now install Void Linux on your USB stick.
|
||||
It will be formatted and will not be usable from Windows or MacOS.
|
||||
|
||||
Before we begin, the following tools need to be installed:
|
||||
Before we begin, let’s make sure some dependencies are installed on the host/live system:
|
||||
- up-to-date xbps
|
||||
- xmirror
|
||||
- squashfs-tools"
|
||||
press_any_key
|
||||
|
@ -58,13 +39,12 @@ KBD_LAYOUT="de-latin1"
|
|||
clear
|
||||
echo "Select the USB stick to install to (NAME column below)...
|
||||
"
|
||||
# exclude loop devices
|
||||
lsblk --exclude 7 --nodeps --output NAME,SIZE,MODEL
|
||||
lsblk --nodeps --output NAME,SIZE,MODEL
|
||||
echo ""
|
||||
read -p "> " TARGET_DISK
|
||||
|
||||
while [ ! -b "/dev/$TARGET_DISK" ]; do
|
||||
lsblk --exclude 7 --nodeps --output NAME,SIZE,MODEL
|
||||
lsblk --nodeps --output NAME,SIZE,MODEL
|
||||
echo "$TARGET_DISK is not a valid device!"
|
||||
read -p "> " TARGET_DISK
|
||||
done
|
||||
|
@ -145,11 +125,8 @@ 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/live system and determine
|
||||
the chosen mirror from the config file it generates.
|
||||
|
||||
TODO:
|
||||
"
|
||||
The script will launch xmirror on the host system and read the mirror
|
||||
from the config file it generates."
|
||||
press_any_key
|
||||
|
||||
xmirror
|
||||
|
@ -165,7 +142,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 --yes --sync --rootdir /mnt/target --repository "$TARGET_MIRROR" \
|
||||
XBPS_ARCH="$TARGET_TYPE" xbps-install -S -r /mnt/target -R "$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 \
|
||||
|
@ -190,84 +167,5 @@ 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -25,23 +25,21 @@ Steps to install:
|
|||
-> download and run install script
|
||||
- preparations:
|
||||
-> update xbps
|
||||
-> install xmirror squashfs-tools
|
||||
-> make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
|
||||
-> install xmirror
|
||||
-> make our own or extract kb selection and time zone selection (if feasible) to hijack them for our purposes
|
||||
- select kb layout
|
||||
- set up disk
|
||||
- warn user about formatting and making the USB stick unusable with Windows
|
||||
- set up disks
|
||||
-> select disk from a list
|
||||
-> warn user about formatting and making the USB stick unusable with Windows
|
||||
-> allow user to double check that it’s the USB drive
|
||||
-> wipe and partition disk (new gpt)
|
||||
-> 2M BIOS GRUB
|
||||
-> 268M ESP
|
||||
-> 1G /boot
|
||||
-> rest /container
|
||||
-> format partitions
|
||||
-> allow user to double check that it’s 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)
|
||||
-> ESP FAT32
|
||||
-> /boot and /container F2FS
|
||||
- mount them things
|
||||
-> set up plain tmpfs as / for now
|
||||
-> rest F2FS
|
||||
- mount them things, set up tmpfs as / for now
|
||||
- install base system
|
||||
-> select mirror
|
||||
-> just use xmirror and get the result from the file
|
||||
|
@ -50,28 +48,18 @@ 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 mirror
|
||||
-> configure XBPS (set mirror?, anything else?)
|
||||
-> configure sudo
|
||||
-> drop a file with "%wheel ALL=(ALL:ALL) ALL" in /etc/sudoers.d/sudo_group
|
||||
-> configure overlayfs setup
|
||||
-> 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 we’re at it
|
||||
-> selection dialog?
|
||||
-> symlink /etc/localtime
|
||||
-> configure host name
|
||||
-> configure tmpfses
|
||||
-> configure /home (bind mount or symlink?)
|
||||
-> configure keymap (etc/rc.conf)
|
||||
-> configure shutdown squashfs updater
|
||||
-> rc.shutdown?
|
||||
-> configure and install bootloader
|
||||
-> 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
|
||||
-> determine BIOS or UEFI
|
||||
-> if UEFI, install as removable device
|
||||
-> xbps-reconfigure -fa
|
||||
-> prepare 2nd stage installation
|
||||
-> auto login root
|
||||
|
@ -85,12 +73,19 @@ 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 (multiple versions?)
|
||||
-> java
|
||||
-> pipewire (pulsemixer?)
|
||||
-> ask about nvidia driver
|
||||
-> install if needed
|
||||
|
|
Loading…
Reference in New Issue