Skip to content

Instantly share code, notes, and snippets.

@k11m1
Last active March 27, 2018 16:25
Show Gist options
  • Save k11m1/4fa5fafe5fd0fe2c67ab1774c55ba035 to your computer and use it in GitHub Desktop.
Save k11m1/4fa5fafe5fd0fe2c67ab1774c55ba035 to your computer and use it in GitHub Desktop.
import os
import sys
#VARIABLES
disk = "/dev/sda"
debug = False
def exec( command ):
"Execute the command with os.system"
if debug == True:
sys.stdout.write("\033[36m")
print( "#Command#\t" + command )
sys.stdout.write("\033[0m")
else:
sys.stdout.write("\033[36m")
os.system( command )
sys.stdout.write("\033[0m")
return
def echo ( text ):
sys.stdout.write("\033[33m")
print( text )
sys.stdout.write("\033[0m")
return
echo("Setting Up Keyboard layout")
exec(r'loadkeys cz-qwertz')
echo("Starting partitioning " + disk)
exec(r'parted -s ' + disk + r' mktable msdos')
exec('echo \'start=2048, type=83 \' | sfdisk ' + disk)
exec('mkfs.ext4 ' + disk + "1")
exec('mount ' + disk + "1 /mnt")
echo("Installing Base System via Pacstrap util. + python (This Script needs Python)")
exec('pacstrap /mnt base python wget')
echo("Generating Fstab File")
exec('genfstab -U /mnt >> /mnt/etc/fstab')
echo("Arch-chrooting... Please use the second script")
exec('arch-chroot /mnt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment