From 056b800c8eb42c4112dce54bd1a7336d52ead2ab Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 20 Aug 2020 17:08:13 +0000 Subject: Starting to add networking helpers in archinstall. First up is archinstall.getHwAddr(ifname) which returns the mac of a interface name. second is archinstall.list_interfaces() which lists all the local MAC addresses and which interface it is bound to. Also starting to add the unattended installer back step by step. Currently with one MAC profile. The MAC profile filtering/detection has also been added in archinstall.list_profiles() - it will filter out all MAC address-specific profiles when called, unless a MAC matches a profile or filter_irrelevant_macs=False is given. --- profiles/52-54-00-12-34-56.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 profiles/52-54-00-12-34-56.py (limited to 'profiles/52-54-00-12-34-56.py') diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py new file mode 100644 index 00000000..4c487938 --- /dev/null +++ b/profiles/52-54-00-12-34-56.py @@ -0,0 +1,32 @@ +import archinstall, getpass + +# Unmount and close previous runs +archinstall.sys_command(f'umount -R /mnt', surpress_errors=True) +archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', surpress_errors=True) + +# Select a harddrive and a disk password +harddrive = archinstall.all_disks()['/dev/sda'] +disk_password = '1234' + +with archinstall.Filesystem(harddrive, archinstall.GPT) as fs: + # Use the entire disk instead of setting up partitions on your own + fs.use_entire_disk('luks2') + + if harddrive.partition[1].size == '512M': + raise OSError('Trying to encrypt the boot partition for petes sake..') + harddrive.partition[0].format('fat32') + + with archinstall.luks2(harddrive.partition[1], 'luksloop', disk_password) as unlocked_device: + unlocked_device.format('btrfs') + + with archinstall.Installer(unlocked_device, boot_partition=harddrive.partition[0], hostname='testmachine') as installation: + if installation.minimal_installation(): + installation.add_bootloader() + + installation.add_additional_packages(['nano', 'wget', 'git']) + installation.install_profile('workstation') + + installation.user_create('anton', 'test') + installation.user_set_pw('root', 'toor') + + installation.add_AUR_support() \ No newline at end of file -- cgit v1.2.3-70-g09d2