Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/output.py
AgeCommit message (Collapse)Author
2022-06-07Update blockdevice (#1289)Daniel Girtler
* Update blockdevice class Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
2022-05-26Rework user management (#1220)Daniel Girtler
* Rework users * Update user installation * Fix config serialization * Update * Update schemas and documentation * Update * Fix flake8 * Make users mypy compatible * Fix minor copy Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
2022-05-26Rework btrfs handling (#1234)Anton Hvornum
* Restructuring btrfs.py into lib/btrfs/*.py * Reworking how BTRFS subvolumes get represented, and worked with. Subvolumes are now their own entity which can be used to access it's information, parents or mount location. * Added BtrfsSubvolume.partition and other stuff. * Reworking the way luks2().unlock and .format() returns device instances. They should now return BTRFSSubvolume where appropriate. * Fixed a missing import * Fixed an issue where mkfs.btrfs wouldn't trigger due to busy disk. * Fixing subvol mounting without creating a fake instance. * Added creation of mountpint for btrfs subvolume * Fixed root detection * Re-worked mounting into a queue system using frozen mounting calls using lambda * Removed old mount_subvolume() function * Removed get_subvolumes_from_findmnt() * Fixed Partition().subvolumes iteration * Adding .root to BtrfsSubvolume * Fixed issue in SysCommandWorker where log output would break and crash execution due to cmd being a string vs list * Changed return-value from MapperDev.mountpoint to pathlib.Path
2022-03-16Improved color coding a bit. Added 5 more color options (not usable outside ↵Anton Hvornum
of 256-bit enabled terminals)
2022-02-08Change usage `lsblk` to `blkid` where possible. And general improvements to ↵Anton Hvornum
disk handling. (#949) * Renamed all_disks() to all_blockdevices() as it's technically a bit more correct. As it would return partitions as well. And it now distinguishes between BlockDevice() and Partition() when returning values. Also lsblk has been replaced with blkid and glob.glob() on /sys/class/block/ * Added handling of loop devices * Added device information enrichment * Removed old code * Updated the usage of blockdevice.info['type'] to 'DEVTYPE' as per returned by blkid instead of lsblk * Created a MapperDev() and DMCryptDev() 'disk' classes. This should help differentiate between BlockDevice(), Partition() and crypt-specific devices. Due to some new helper functions (mentioned later) BlockDevice().device_or_backfile has been simplified thanks to the information being pre-existing instead of having to call losetup. BlockDevice().mountpoint has been added as a dummy function. archinstall.enrich_blockdevice_information() has been added to enrich information extracted from blkid. archinstall.uevent() has been created to parse blkdid data when in -o export format, also eats up /sys/class/x/y/uevent data which is of the same format. all_blockdevices() now returns mapper devices found under /dev/mapper/ and properly returns the different types, not just BlockDevice() for everything. archinstall.get_parent_of_partition() has been added, which can translate /dev/sda1 to /dev/sda via strings by using /sys/class/block/ - note here tho that it has to be a blockdevice. Other parents won't return properly. archinstall.find_mountpoint() was created to be able to find mountpoints for a device, rather than the other way around which get_mount_info() handles. find_mountpoint() will convert /dev/sda1 -> /boot for instance, whereas get_mount_info('/boot') will convert /boot -> /dev/sda1. archinstall.get_partitions_in_use() will now properly traverse the entire structure, not just one level deep. This called for the creation of get_all_targets() which will take a dictionary structure and look for 'target': '/path' and return all '/path' values, recursively without being trapped in get_partitions_in_use() which has recursive targets. get_partitions_in_use() now returns a dictionary instead of a list, as it also returns the mountpoint and associated device. It will also prioritize MapperDev over DMCryptDev (as MapperDev is a child of DMCryptDev and can be resolved, other way around is 'trickier'). * Reverted Installer().partitions to return only the partitions. It's a slight speed defecit by not returning the mountpoints directly as {mntpoint: partition}, because the partition.mountpoint is a bit slow. But it avoids breaking legacy code :) * Fixed a few imports, and added MapperDev.filesystem * Fixed so that Installer().detect_encryption() uses the new separated logic of MapperDev/DMCryptDev/Partition * Fixing a translation issue on hostname * Added DMCryptDev.filesystem * Added back archinstall.all_disks() for legacy reasons. * Added a deprecation warning to archinstall.all_disks() * Added a enrichment check for dm-crypt specific devices, which in turn sets DMCRYPT_NAME on the device information, making it easier to detect and target DMCryptDev when needed. This should avoid issues with loopdevices being detected as DMCryptDev. Also some minor tweaks to variable names on unencrypted setups * Made debug output hidden without --verbose. Also added get_subvolume_info() which takes a path and returns any 'btrfs subvol show' information on the path * Partition().subvolumes has been added. Which generates an iterator over potential subvolumes based on mountpoint. Partition().mount_information is now a list of mount-destinations, as one partition should be allowed to be mounted to several places (more commonly used in btrfs subvolumes). BtrfsSubvolume() has been added as a 'device type', which should make it more easy to recognize a BtrfsSubvolume object right out of the gate. Only found from Partition().subvolumes currently. * Parameter fix for --verbose in log() * Made sure loopdev devices have a PATH key as well, to make dealing with them as blockdevice as seamless as possible. * Added backup information grabbing on uninitated devices * Tweaked backup option if losetup cannot find the blockdev * looks like losetup doesn't exit with a bad code even when it should. Raising ourselves when information is empty. * Fixed structure returned from get_blockdevice_uevent() * Made sure that fallback to blkid and loopdev info returns a PTTYPE (Partition Table Type) that is None, since we can't locate it yet (empty drive). But it's not False either, which is what logic after is looking for * Deprecated split_bind_name() and added more debugging * get_partitions_in_use() now only iterates over Partition() objects. And properly checks all mountpoints, not only the first. * Flipped SysCallError to show the last 500 bytes if data rather than the first, to catch the actual errors. * Removed anonymous parameters to all_blockdevices() * Added .mount_information to MapperDev * Added typing annotations * Partition().mountpoint is now a @property that will live-report the current mountpoint. * Removed the need for setting Partition().mountpoint = X when calling .mount() and .unmount(), as it's live-reported instead. * Added .subvolumes to MapperDev() * Added debug information * Muting F841 in helpers.py * Tweaked debug information in get_mount_info() * Minimized log output by moving Partition().mountpoint to DEBUG, as partitions are allowed to not be mounted * Simplified Installer().add_bootloader() to act as a router to the new split function, one for each bootloader type. This since flake8 complained about complexity and I agree that it became to wild.
2022-02-02Migrate old input to new menu (#874)Daniel
* Migrate old input to new menu * Fix imports * Remove imports * Update * Fixed import by changing 'import archinstall', to 'from ..menu import Menu' and use Menu() directly * Converted archinstall.<thing> to from ..where import <thing>. This enables us to use archinstall as a module, a git repository in testing and other things without having to install archinstall as an actual module. Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
2021-12-02Fixing some mypy complaints (#780)Anton Hvornum
* Fixed some mypy issues regarding SysCommand* and logging * Fixed imports and undefined variable
2021-11-19source code improvementSteven Lee
2021-05-19Reworking SysCommand & Moving to localectl for locale related activitiesAnton Hvornum
* Moving to `localectl` rather than local file manipulation *(both for listing locales and setting them)*. * Swapped `loadkeys` for localectl. * Renamed `main` to `maim` in awesome profile. * Created `archinstall.Boot(<installation>)` which spawns a `systemd-nspawn` container against the installation target. * Exposing systemd.py's internals to archinstall global scope. * Re-worked `SysCommand` completely, it's now a wrapper for `SysCommandWorker` which supports interacting with the process in a different way. `SysCommand` should behave just like the old one, for backwards compatibility reasons. This fixes #68 and #69. * `SysCommand()` now has a `.decode()` function that defaults to `UTF-8`. * Adding back peak_output=True to pacstrap. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Dylan Taylor <dylan@dylanmtaylor.com>
2021-05-18Proofreading: Fix misc. spelling and grammar issuesDylan Taylor
2021-05-15Perform refactoring to PEP 8 naming conventionsDylan Taylor
2021-05-15Fix E713 test for membership should be 'not in'Dylan Taylor
2021-05-15More formatting fixesDylan Taylor
2021-05-15Many more manual changesDylan Taylor
2021-05-12some type hint fixes and a bad catch fixadvaithm
2021-04-28Corrected one indentation.Anton Hvornum
2021-04-28Corrected error handling for log creation.Anton Hvornum
2021-04-28Fixing permission error on non-root-runners accessing log()Anton Hvornum
2021-04-27Moving away from custom log levels, to something that's well defined. (#360)Anton Hvornum
* Moving away from custom log levels, to something that's well defined. * Added backward compability to log() as well. * Added an option to force log messages out on screen even if the level is below the log level threashold. * Added force log messages when wrong notation is used. * Added some more length to the deprecated message * Swapped all log levels to use logging.<level> instead. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
2021-04-04Closed #110Zach Osman
2021-04-04Fix misspellingsRafael Fontenelle
2021-03-23Corrected recursion loop in log() calling log() before setting the new path ↵Anton Hvornum
for the log file on errors.
2021-03-23Partially corrects for #116. We still don't detect if we're running as root ↵Anton Hvornum
(need to investigate if we need to run as root first). But this should at least hot-swap the log-file to the current working directory and place the logfile there.
2021-03-08Tweaked logging slightly.Anton Hvornum
2021-01-24Added debug output as well as corrected output formatting in log().Anton Hvornum
2021-01-24Mixup with variable nameAnton Hvornum
2021-01-24Simpligied installer.log() to wrap output.log() with it's changes.Anton Hvornum
2021-01-24Trying to centralize the configuration for logging. Phasing out some ↵Anton Hvornum
parameters which also affects the current ability to create multiple log files for multiple runs. This will be re-introduced when logging is made into a class object in a later version
2020-11-29Issue in archinstall.output.log() when the log file output is omitted. Now ↵Anton Hvornum
properly checks if a logfile is given, otherwise it ignores it.
2020-11-05Fallback automatically to a log file if we can detect one, even tho file was ↵Anton Hvornum
never given in the log() call. This might cause some log posts to slip in to the logs, but use suppress=True to force-ignore those in such a case.
2020-11-04Tweaked some log messages in archinstall.Installer()Anton Hvornum
2020-11-04Logic issue minor fix.Anton Hvornum
2020-11-04Fixed level issues on log output. Also tweaked it so that all log rows come ↵Anton Hvornum
to the log file, but not nessecarily the interactive screen (tty/journald). Also tweaked certain log messages to be printed vs not printed.
2020-11-04Cleaned up some logic. How the LOG_LEVEL is fetched from the storage.Anton Hvornum
2020-11-04Added multiple log features.Anton Hvornum
* [Reintroduced](https://github.com/Torxed/archinstall/blob/f64a605449f59c677dff39962f1cb46616d893b7/archinstall.py#L57-L71) log levels * Created a global log file definition * Optional support for `python-systemd`'s journald handler. * Optional file output that has a globally configurable definition, that archinstall will honor in `archinstall.storage['logfile']`.
2020-10-18Reverted TTS implementation from 35913c4. Since blind people use screen ↵Anton Hvornum
readers for this functionality. Will have a look at http://www.linux-sppeakup.org/.
2020-10-11Added text-to-speach, untested but the base is now added. It routes through ↵Anton Hvornum
if available. And can be accessed with directly if needed.