Compare commits
86 Commits
bootable
...
python-cor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
858ca5d3ab | ||
|
|
d40c5deb44 | ||
|
|
3c8664b1f5 | ||
|
|
54530ac202 | ||
|
|
d872a99180 | ||
|
|
408f2aa873 | ||
|
|
28dab7b58b | ||
|
|
226ad45325 | ||
|
|
5a3b4914a0 | ||
|
|
8d27e18464 | ||
|
|
9cd968b4bd | ||
|
|
6f3bdc8008 | ||
|
|
b0f3d0de65 | ||
|
|
b0c9ab111c | ||
|
|
b72d05f329 | ||
|
|
c839b6bbf3 | ||
|
|
77dcbafc80 | ||
|
|
d9879d3d55 | ||
|
|
5b2fe128ab | ||
|
|
6be3d2343e | ||
|
|
c1c37bbecf | ||
|
|
97e0f92e77 | ||
|
|
140bb273d9 | ||
|
|
ba3a509403 | ||
|
|
ae6ca63711 | ||
|
|
5841c57d71 | ||
|
|
b4281e8e74 | ||
|
|
690bc54606 | ||
|
|
2e07d01843 | ||
|
|
58d4f78a92 | ||
|
|
c2d26a1f01 | ||
|
|
bc13ac0712 | ||
|
|
039d2db196 | ||
|
|
5635e9efac | ||
|
|
257067a67f | ||
|
|
17741369fd | ||
|
|
6d105d17d2 | ||
|
|
cb675e878e | ||
|
|
36b69a7e44 | ||
|
|
b832df461d | ||
|
|
8ccf3bf899 | ||
|
|
5e95159f18 | ||
|
|
b8b7673ac9 | ||
|
|
198f62c1fc | ||
|
|
65b74e5279 | ||
|
|
ec371ee383 | ||
|
|
c5bae37f33 | ||
|
|
9b7374f768 | ||
|
|
f7980310dc | ||
|
|
c52b6171ea | ||
|
|
af9eda2a85 | ||
|
|
3df47e621d | ||
|
|
470cf15208 | ||
|
|
8f054d1d2d | ||
|
|
2d3fbc04d6 | ||
|
|
e61c0f7df8 | ||
|
|
5c6d1322e0 | ||
|
|
edda8ff56f | ||
|
|
f7b9089707 | ||
|
|
289f248c09 | ||
|
|
928df65190 | ||
|
|
4c4b8b624c | ||
|
|
3fcf5a6a96 | ||
|
|
51af650e99 | ||
|
|
ba1e4bff49 | ||
|
|
955ec704e8 | ||
|
|
66b6451532 | ||
|
|
a3bd9823ee | ||
|
|
5d8275c9cf | ||
|
|
09e0574dba | ||
|
|
1c8fe0e0bc | ||
|
|
9b0e2b66c4 | ||
|
|
501a8cd164 | ||
|
|
e2d707ad80 | ||
|
|
7737c3c652 | ||
|
|
925741f12b | ||
|
|
66affd78c0 | ||
|
|
a5d2622f67 | ||
|
|
50aa19f459 | ||
|
|
e5707bb776 | ||
|
|
d79bd42091 | ||
|
|
5edbaf9f79 | ||
|
|
d27a676a8a | ||
|
|
93273b4f7f | ||
|
|
5c1282e94c | ||
|
|
d08797d043 |
@@ -4,9 +4,9 @@ ping -c 1 archlinux.org 2>/tmp/arch-maride-flavour_checks_internet_error.log 1>/
|
|||||||
return=$?
|
return=$?
|
||||||
|
|
||||||
if [ "$return" -eq 0 ]; then
|
if [ "$return" -eq 0 ]; then
|
||||||
exit 0
|
amf_return=0
|
||||||
else
|
else
|
||||||
echo "~> Either internet is unavailable or archlinux.org is down..."
|
echo "~> Either internet is unavailable or archlinux.org is down..."
|
||||||
echo "~> (ping returned $return. Maybe check the logs in /tmp."
|
echo "~> (ping returned $return. Maybe check the logs in /tmp."
|
||||||
exit 1
|
amf_return=1
|
||||||
fi
|
fi
|
||||||
|
|||||||
21
checks/packeys.check
Executable file
21
checks/packeys.check
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
|
|
||||||
|
echo " We can force to fetch PGP keys via HTTP over 80/tcp."
|
||||||
|
echo " You probably don't want this unless your internet connection is heavily filtered."
|
||||||
|
echo -n "=> Is your internet connection filtered (e.g. company network)? (y/N)"
|
||||||
|
read answer
|
||||||
|
|
||||||
|
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
|
||||||
|
echo " Ugh. Poor bastard, you."
|
||||||
|
keyserver="hkp://p80.pool.sks-keyservers.net:80"
|
||||||
|
else
|
||||||
|
keyserver="hkp://pool.sks-keyservers.net"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " Fetching via $keyserver"
|
||||||
|
|
||||||
|
dirmngr &
|
||||||
|
pacman-key --populate --keyserver $keyserver || amf_return=1
|
||||||
|
pacman-key --refresh-keys --keyserver $keyserver || amf_return=1
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ls /sys/firmware/efi/efivars 2>/tmp/arch-maride-flavour_checks_uefi_error.log 1>/tmp/arch-maride-flavour_checks_uefi_out.log
|
if [ "$bootloader" == "BIOS" ]; then
|
||||||
return=$?
|
echo "~> Not an EFI host, not checking for EFI."
|
||||||
|
amf_return=0
|
||||||
if [ "$return" -eq 0 ]; then
|
|
||||||
exit 0
|
|
||||||
else
|
else
|
||||||
echo "~> This doesn't seem to be an UEFI boot. Please boot UEFI."
|
ls /sys/firmware/efi/efivars 2>/tmp/arch-maride-flavour_checks_uefi_error.log 1>/tmp/arch-maride-flavour_checks_uefi_out.log
|
||||||
exit 1
|
return=$?
|
||||||
|
|
||||||
|
if [ "$return" -eq 0 ]; then
|
||||||
|
amf_return=0
|
||||||
|
else
|
||||||
|
echo "~> This doesn't seem to be an UEFI boot. Please boot UEFI."
|
||||||
|
amf_return=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
10
flavours/cpu.flavour/install.sh
Executable file
10
flavours/cpu.flavour/install.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing thermald cpupower"
|
||||||
|
pacstrap /mnt thermald cpupower
|
||||||
|
echo " Setting 'ondemand' governor"
|
||||||
|
arch-chroot /mnt cpupower frequency-set -g ondemand
|
||||||
|
echo " Start cpupower on boot"
|
||||||
|
arch-chroot /mnt systemctl enable cpupower
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
18
flavours/i3.flavour/install.sh
Executable file
18
flavours/i3.flavour/install.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing i3"
|
||||||
|
pacstrap /mnt i3 feh compton dmenu acpi
|
||||||
|
|
||||||
|
user=$(ls /mnt/home)
|
||||||
|
if [ "$user" == "" ]; then
|
||||||
|
path="/mnt/etc/skel/"
|
||||||
|
else
|
||||||
|
path="/mnt/home/$user/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "~> Creating .xinitrc"
|
||||||
|
echo "compton -CGb" > $path/.xinitrc
|
||||||
|
echo "feh --bg-fill /etc/wallpapers/\$(ls /etc/wallpapers/ | shuf -n 1)" >> $path/.xinitrc
|
||||||
|
echo "exec i3" >> $path/.xinitrc
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
16
flavours/mate.flavour/install.sh
Executable file
16
flavours/mate.flavour/install.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing mate"
|
||||||
|
pacstrap /mnt mate mate-extra
|
||||||
|
|
||||||
|
user=$(ls /mnt/home)
|
||||||
|
if [ "$user" == "" ]; then
|
||||||
|
path="/mnt/etc/skel/"
|
||||||
|
else
|
||||||
|
path="/mnt/home/$user/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "~> Creating .xinitrc"
|
||||||
|
echo "exec mate-session" > $path/.xinitrc
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
8
flavours/networkmanager.flavour/install.sh
Executable file
8
flavours/networkmanager.flavour/install.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing NetworkManager"
|
||||||
|
pacstrap /mnt networkmanager
|
||||||
|
echo " Enabling NetworkManager on boot"
|
||||||
|
arch-chroot /mnt systemctl enable NetworkManager
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
6
flavours/sound.flavour/install.sh
Executable file
6
flavours/sound.flavour/install.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing pulseaudio alsa-utils ponymix"
|
||||||
|
pacstrap /mnt pulseaudio alsa-utils ponymix
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
14
flavours/ssh.flavour/install.sh
Executable file
14
flavours/ssh.flavour/install.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Install openssh package"
|
||||||
|
pacstrap /mnt openssh
|
||||||
|
|
||||||
|
echo "~> Patch /etc/ssh/sshd_config...:"
|
||||||
|
echo " * disallow passwords."
|
||||||
|
arch-chroot /mnt sed -i "s/^#PasswordAuthentication .*$/PasswordAuthentication no/g" /etc/ssh/sshd_config
|
||||||
|
echo " * force SSH keys."
|
||||||
|
arch-chroot /mnt sed -i "s/^#PubkeyAuthentication .*$/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
|
||||||
|
echo " * enable on boot."
|
||||||
|
arch-chroot /mnt systemctl enable sshd
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
10
flavours/sudo.flavour/install.sh
Executable file
10
flavours/sudo.flavour/install.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Install sudo package"
|
||||||
|
pacstrap /mnt sudo
|
||||||
|
|
||||||
|
echo "~> Create group sudo and patch sudoers file"
|
||||||
|
arch-chroot /mnt groupadd sudo
|
||||||
|
arch-chroot /mnt sed -i "s/^# %sudo/%sudo/g" /etc/sudoers
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
10
flavours/swapfile.flavour/install.sh
Executable file
10
flavours/swapfile.flavour/install.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing systemd-swap"
|
||||||
|
pacstrap /mnt systemd-swap
|
||||||
|
echo " Patching swap.conf"
|
||||||
|
arch-chroot /mnt sed -i "s/\$swapfu_enabled=0/swapfu_enabled=1/g" /etc/systemd/swap.conf
|
||||||
|
echo " Enabling systemd-swap on boot"
|
||||||
|
arch-chroot /mnt systemctl enable systemd-swap
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
11
flavours/unsplash.flavour/install.sh
Executable file
11
flavours/unsplash.flavour/install.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Grabbing a random image from unsplash.com..."
|
||||||
|
|
||||||
|
mkdir -p /mnt/etc/wallpapers/
|
||||||
|
|
||||||
|
for tag in {forest,ocean,sky,snow,architecture,technology,stars,hills,nature,fields,trees,night}; do
|
||||||
|
wget $(curl https://unsplash.com/search/photos/$tag | grep -oE 'content="http://images.unsplash.com/photo-([a-zA-Z0-9_\\-]*)' | sed -e 's/content="//g' | shuf -n 1) -O /mnt/etc/wallpapers/$tag-$(uuidgen).jpg
|
||||||
|
done
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
37
flavours/user.flavour/install.sh
Executable file
37
flavours/user.flavour/install.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Changing password for root account."
|
||||||
|
arch-chroot /mnt passwd root
|
||||||
|
|
||||||
|
echo -n "~> Do you want to create an user account? (Y/n) "
|
||||||
|
read answer
|
||||||
|
|
||||||
|
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
|
||||||
|
amf_return=0
|
||||||
|
else
|
||||||
|
echo -n " Name of your new user? "
|
||||||
|
read name
|
||||||
|
export username=$name
|
||||||
|
arch-chroot /mnt useradd -m $name
|
||||||
|
arch-chroot /mnt passwd $name
|
||||||
|
|
||||||
|
# If group "sudo" exists (=> sudo.flavour was installed), ask if the user should be added
|
||||||
|
if [ $(arch-chroot /mnt getent group sudo) ]; then
|
||||||
|
echo -n "~> Do you want to add $name to sudoers? (Y/n) "
|
||||||
|
read answer
|
||||||
|
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
|
||||||
|
arch-chroot /mnt usermod -a -G sudo $name
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n " Set up zsh with ohmyzsh for $name? (Y/n) "
|
||||||
|
read answer
|
||||||
|
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
|
||||||
|
pacstrap /mnt zsh git
|
||||||
|
arch-chroot /mnt git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git /home/$name/.oh-my-zsh
|
||||||
|
wget https://git.darknebu.la/maride/config/raw/master/zshrc -O /mnt/home/$name/.zshrc
|
||||||
|
arch-chroot /mnt chsh -s /bin/zsh $name
|
||||||
|
fi
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
|
fi
|
||||||
6
flavours/virtualbox-guest.flavour/install.sh
Executable file
6
flavours/virtualbox-guest.flavour/install.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "~> Installing packages to be a virtualbox guest"
|
||||||
|
pacstrap /mnt virtualbox-guest-utils virtualbox-guest-modules-arch
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
5
flavours/wifi-menu.flavour/install.sh
Executable file
5
flavours/wifi-menu.flavour/install.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pacstrap /mnt dialog wpa_supplicant
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
5
flavours/xorg.flavour/00-keyboard.conf
Normal file
5
flavours/xorg.flavour/00-keyboard.conf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Section "InputClass"
|
||||||
|
Identifier "system-keyboard"
|
||||||
|
MatchIsKeyboard "on"
|
||||||
|
Option "XkbLayout" "de"
|
||||||
|
EndSection
|
||||||
7
flavours/xorg.flavour/install.sh
Executable file
7
flavours/xorg.flavour/install.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pacstrap /mnt xorg xorg-xinit xterm ttf-dejavu
|
||||||
|
|
||||||
|
cp 00-keyboard.conf /mnt/etc/X11/xorg.conf.d/
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
8
flavours/yaourt.flavour/install.sh
Executable file
8
flavours/yaourt.flavour/install.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pacstrap /mnt git
|
||||||
|
arch-chroot /mnt git clone https://aur.archlinux.org/package-query.git /tmp/package-query && cd /tmp/package-query && makepkg -si
|
||||||
|
arch-chroot /mnt git clone https://aur.archlinux.org/yaourt.git /tmp/yaourt && cd /tmp/yaourt && makepkg -si
|
||||||
|
arch-chroot /mnt rm -R /tmp/package-query /tmp/yaourt
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
47
install.sh
47
install.sh
@@ -1,47 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "HOI, this is the 'Arch w/ maride flavour' install script (chainloader)"
|
|
||||||
echo "Hope you used TLS..."
|
|
||||||
echo -e "=-=-=-=-=-=-=-=-=-=-=\n"
|
|
||||||
|
|
||||||
echo "=> Things you should've set up already:"
|
|
||||||
echo " * Your keyboard layout (consider passwords!)"
|
|
||||||
echo " * Any RAID setup that you are planning to set up"
|
|
||||||
echo " * An internet connection (DHCP or static, idc...)"
|
|
||||||
echo -n "=> Did you set that up? (y/N) "
|
|
||||||
read answer
|
|
||||||
|
|
||||||
if [ "$answer" != "y" ]; then
|
|
||||||
echo "OK, then do necessary steps and see you soon."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=> Please enter the full path to the block device the installation should take place on: (e.g. /dev/sda)"
|
|
||||||
echo " Make sure to choose a drive, not a partition."
|
|
||||||
echo " Hint: here's a list of devices that may be the right:"
|
|
||||||
ls /dev/sd* /dev/mmc* 2>/dev/null
|
|
||||||
echo -n "Install to: "
|
|
||||||
read blockdevice
|
|
||||||
export blockdevice
|
|
||||||
|
|
||||||
for check in checks/*.check
|
|
||||||
do
|
|
||||||
echo "=> Running check '$check'..."
|
|
||||||
$check
|
|
||||||
return=$?
|
|
||||||
if [ "$return" -ne 0 ]; then
|
|
||||||
echo "=> Check failed. Fix it, maybe."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for step in steps/*.step
|
|
||||||
do
|
|
||||||
echo "=> Running step '$step'..."
|
|
||||||
$step
|
|
||||||
return=$?
|
|
||||||
if [ "$return" -ne 0 ]; then
|
|
||||||
echo "=> Step failed. That is weird. Sorry. Check logs maybe."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
132
run.py
Executable file
132
run.py
Executable file
@@ -0,0 +1,132 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def quit():
|
||||||
|
print("OK, then do necessary steps and see you soon.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def motd(termsize, settings):
|
||||||
|
print("HOI, this is the 'Arch w/ maride flavour' install script (chainloader)")
|
||||||
|
print("Hope you used TLS...")
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
print("Things you should've set up already:")
|
||||||
|
print(" * Your keyboard layout (consider passwords!)")
|
||||||
|
print(" * Any RAID setup that you are planning to set up")
|
||||||
|
print(" * An internet connection (DHCP or static, idc...)")
|
||||||
|
|
||||||
|
answer = _ask("Did you set that up?", [ "yes", "no" ])
|
||||||
|
|
||||||
|
if answer == "no":
|
||||||
|
quit()
|
||||||
|
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
|
||||||
|
def efibios(termsize, settings):
|
||||||
|
print("Please choose the installation/startup method.")
|
||||||
|
print("Note that BIOS is required for VirtalBox hosts due a long-time unfixed bug.")
|
||||||
|
print("It's possible that you need to change Mainboard settings for EFI. (But it's recommended!)")
|
||||||
|
settings["bootmethod"] = _ask("Do you want to install on EFI or BIOS?", [ "EFI", "BIOS" ])
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
|
||||||
|
def blockdevice(termsize, settings):
|
||||||
|
print("Please enter the full path to the block device the installation should take place on: (e.g. /dev/sda)")
|
||||||
|
print("Make sure to choose a drive, not a partition.")
|
||||||
|
print("Here's a list of devices that may be the right:")
|
||||||
|
settings["blockdevice"] = _ask("Install where?", os.listdir("/sys/block/"), enforce=False)
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
|
||||||
|
def cryptroot(termsize, settings):
|
||||||
|
print("Do you want to encrypt your root partition?")
|
||||||
|
print("Please note that there is no way to recover your data if you forget your password.")
|
||||||
|
settings["cryptroot"] = _ask("Encrypt root?", [ "yes", "no" ])
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
|
||||||
|
def rundir(termsize, settings, directory, validation_suffix, subfile="", ask=False):
|
||||||
|
for filename in sorted(os.listdir(directory)):
|
||||||
|
if filename[-len(validation_suffix):] == validation_suffix:
|
||||||
|
# Run loop
|
||||||
|
run = True
|
||||||
|
while run:
|
||||||
|
if ask and _ask("Do you want to run %s?" % (filename), [ "yes", "no" ]) == "no":
|
||||||
|
run = False
|
||||||
|
continue
|
||||||
|
|
||||||
|
_separator(termsize)
|
||||||
|
print("Running '%s'" % (filename))
|
||||||
|
|
||||||
|
if subfile:
|
||||||
|
executable = os.path.join(directory, filename, subfile)
|
||||||
|
else:
|
||||||
|
executable = os.path.join(directory, filename)
|
||||||
|
|
||||||
|
with subprocess.Popen([executable], env=settings) as process:
|
||||||
|
# Wait for process termination
|
||||||
|
process.wait()
|
||||||
|
if process.returncode > 0:
|
||||||
|
# Woops, check failed somehow
|
||||||
|
print("Executable %s returned non-null error code %i." % (executable, process.returncode))
|
||||||
|
answer = _ask("Do you want to re-run the executable, skip the check or abort the installation?", [ "run", "skip", "abort"])
|
||||||
|
if answer == "run":
|
||||||
|
# doesn't matter, run is already 'True'
|
||||||
|
continue
|
||||||
|
elif answer == "skip":
|
||||||
|
run = False
|
||||||
|
elif answer == "abort":
|
||||||
|
quit()
|
||||||
|
else:
|
||||||
|
run = False
|
||||||
|
else:
|
||||||
|
print("Uh. Found this executable: '%s' (Not executing)" % (filename))
|
||||||
|
|
||||||
|
_separator(termsize)
|
||||||
|
|
||||||
|
|
||||||
|
def finish(termsize, settings):
|
||||||
|
_separator(termsize)
|
||||||
|
if _ask("Finished! \\o/ reboot now?", [ "yes", "no" ]) == "yes":
|
||||||
|
os.system("reboot")
|
||||||
|
|
||||||
|
|
||||||
|
def _separator(termsize):
|
||||||
|
print("~" * termsize["cols"])
|
||||||
|
|
||||||
|
|
||||||
|
def _ask(question, choices, enforce=True):
|
||||||
|
while True:
|
||||||
|
print("=> %s (%s) " % (question, ", ".join(choices)))
|
||||||
|
answer = sys.stdin.readline()[:-1]
|
||||||
|
if answer in choices or not enforce:
|
||||||
|
return answer
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
rows, columns = os.popen('stty size', 'r').read().split()
|
||||||
|
termsize = {
|
||||||
|
"rows": int(rows),
|
||||||
|
"cols": int(columns)
|
||||||
|
}
|
||||||
|
settings = {}
|
||||||
|
|
||||||
|
motd(termsize, settings)
|
||||||
|
efibios(termsize, settings)
|
||||||
|
blockdevice(termsize, settings)
|
||||||
|
cryptroot(termsize, settings)
|
||||||
|
rundir(termsize, settings, "checks", ".check")
|
||||||
|
rundir(termsize, settings, "steps", ".step")
|
||||||
|
rundir(termsize, settings, "flavours", ".flavour", "install.sh", ask=True)
|
||||||
|
finish(termsize, settings)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
@@ -4,17 +4,18 @@ echo "~> Going to wipe $blockdevice. Just skip it if you are really sure that th
|
|||||||
echo -n "~> Wipe block device? (Y/n) "
|
echo -n "~> Wipe block device? (Y/n) "
|
||||||
read answer
|
read answer
|
||||||
|
|
||||||
if [ "$answer" == "n" ]; then
|
if [ "$answer" == "n" ] || [ "$answer" == "N" ]; then
|
||||||
exit 0
|
amf_return=0
|
||||||
fi
|
|
||||||
|
|
||||||
echo -n "~> You sure? (y/N) "
|
|
||||||
read answer
|
|
||||||
|
|
||||||
if [ "$answer" == "y" ]; then
|
|
||||||
echo "~> OK. Be patient now, that could take some time..."
|
|
||||||
dd if=/dev/zero of=$blockdevice status=progress
|
|
||||||
exit 0
|
|
||||||
else
|
else
|
||||||
exit 1
|
echo -n "~> You sure? (y/N) "
|
||||||
|
read answer
|
||||||
|
|
||||||
|
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
|
||||||
|
echo "~> OK. Be patient now, that could take some time..."
|
||||||
|
dd if=/dev/zero of=$blockdevice status=progress
|
||||||
|
amf_return=0
|
||||||
|
else
|
||||||
|
amf_return=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
return $amf_return
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ echo -e "g\nn\n1\n2048\n+300M\nn\n2\n\n\np\nw" | fdisk $blockdevice
|
|||||||
|
|
||||||
if [ "$?" -eq 0 ]; then
|
if [ "$?" -eq 0 ]; then
|
||||||
echo "~> Seems to have worked. Yay!"
|
echo "~> Seems to have worked. Yay!"
|
||||||
exit 0
|
amf_return=0
|
||||||
else
|
else
|
||||||
echo "~> Failed. :("
|
echo "~> Failed. :("
|
||||||
exit 1
|
amf_return=1
|
||||||
fi
|
fi
|
||||||
|
return $amf_return
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ mkfs.fat -F32 ${blockdevice}1
|
|||||||
echo -n "~> Do you want to encrypt root? (Y/n) "
|
echo -n "~> Do you want to encrypt root? (Y/n) "
|
||||||
read answer
|
read answer
|
||||||
|
|
||||||
if [ "$answer" == "n" ]; then
|
if [ "$cryptroot" == "yes" ]; then
|
||||||
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
|
|
||||||
rootformat=${blockdevice}2
|
|
||||||
else
|
|
||||||
echo "~> Formatting root (/) for crypto"
|
echo "~> Formatting root (/) for crypto"
|
||||||
cryptsetup -v luksFormat ${blockdevice}2
|
cryptsetup -v luksFormat ${blockdevice}2
|
||||||
echo "~> Here's the header crypto:"
|
echo "~> Here's the header crypto:"
|
||||||
@@ -17,6 +14,9 @@ else
|
|||||||
echo "~> Open the crypt container"
|
echo "~> Open the crypt container"
|
||||||
cryptsetup luksOpen ${blockdevice}2 cryptroot
|
cryptsetup luksOpen ${blockdevice}2 cryptroot
|
||||||
rootformat=/dev/mapper/cryptroot
|
rootformat=/dev/mapper/cryptroot
|
||||||
|
else
|
||||||
|
echo "~> There are close to no reasons to not do this, but hey, you're an adult."
|
||||||
|
rootformat=${blockdevice}2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "~> Formatting $rootformat EXT4"
|
echo "~> Formatting $rootformat EXT4"
|
||||||
@@ -26,3 +26,6 @@ echo "~> Mount partitions"
|
|||||||
mount $rootformat /mnt
|
mount $rootformat /mnt
|
||||||
mkdir -p /mnt/boot
|
mkdir -p /mnt/boot
|
||||||
mount ${blockdevice}1 /mnt/boot
|
mount ${blockdevice}1 /mnt/boot
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
|
return $amf_return
|
||||||
|
|||||||
@@ -2,3 +2,6 @@
|
|||||||
|
|
||||||
echo "~> Installing 'base' group and 'grub', 'efibootmgr'"
|
echo "~> Installing 'base' group and 'grub', 'efibootmgr'"
|
||||||
pacstrap /mnt base grub efibootmgr
|
pacstrap /mnt base grub efibootmgr
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
|
return $amf_return
|
||||||
|
|||||||
@@ -17,9 +17,19 @@ echo -e "~> Choose a hostname: "
|
|||||||
read hostname
|
read hostname
|
||||||
echo $hostname > /mnt/etc/hostname
|
echo $hostname > /mnt/etc/hostname
|
||||||
|
|
||||||
echo "~> Configuring 'grub'"
|
echo "~> Configuring 'grub' for $bootloader"
|
||||||
arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch_GRUB
|
if [ "$bootmethod" == "EFI" ]; then
|
||||||
echo "GRUB_CMDLINE_LINUX='cryptdevice=UUID=`blkid -o value ${blockdevice}2 | head -n 1`:cryptroot'" > /mnt/etc/default/grub
|
arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=BOOT
|
||||||
|
# thanks to Virtualbox, this step is necessary
|
||||||
|
cp /mnt/boot/EFI/BOOT/{grubx64.efi,BOOTX64.EFI}
|
||||||
|
else
|
||||||
|
arch-chroot /mnt grub-install --target=i386-pc /dev/*da
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$cryptroot" == "yes" ]; then
|
||||||
|
echo "GRUB_CMDLINE_LINUX='cryptdevice=UUID=`blkid -o value ${blockdevice}2 | head -n 1`:cryptroot'" > /mnt/etc/default/grub
|
||||||
|
fi
|
||||||
|
|
||||||
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
|
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
|
|
||||||
echo "~> Patching mkinitcpio.conf for encryption magic"
|
echo "~> Patching mkinitcpio.conf for encryption magic"
|
||||||
@@ -28,3 +38,9 @@ echo "HOOKS=\"base udev autodetect modconf block keyboard keymap encrypt filesys
|
|||||||
|
|
||||||
echo "~> ... and recompile the kernel"
|
echo "~> ... and recompile the kernel"
|
||||||
arch-chroot /mnt mkinitcpio -p linux
|
arch-chroot /mnt mkinitcpio -p linux
|
||||||
|
|
||||||
|
echo "~> Patching pacman.conf for some pacman magic."
|
||||||
|
arch-chroot /mnt sed -i "s/\[options\]/\[options\]\nILoveCandy/g" /etc/pacman.conf
|
||||||
|
|
||||||
|
amf_return=0
|
||||||
|
return $amf_return
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo -n "~> Do you want to create an user account? (Y/n) "
|
|
||||||
read answer
|
|
||||||
|
|
||||||
if [ "$answer" == "n" ]; then
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo -n " Name of your new user? "
|
|
||||||
read name
|
|
||||||
arch-chroot /mnt useradd -m $name
|
|
||||||
arch-chroot /mnt passwd $name
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user