Commit Graph

2770 Commits

Author SHA1 Message Date
Anton Hvornum dce83ebe89
Reverted some changes to SysCommandWorker() 2022-02-09 17:11:33 +01:00
Anton Hvornum b12346ac89
Changing debug information 2022-02-09 16:53:07 +01:00
Anton Hvornum a817a6ce9e
Removed debug information 2022-02-09 16:49:08 +01:00
Anton Hvornum 1cf5c64fdc
Removed debug information 2022-02-09 16:46:50 +01:00
Anton Hvornum 8239c96278
Removed debug information 2022-02-09 16:46:22 +01:00
Anton Hvornum af1e240611
Changing debug information 2022-02-09 15:44:09 +01:00
Anton Hvornum 218f54123e
Changed flush() method to child fd 2022-02-09 15:42:34 +01:00
Anton Hvornum 1319801564
Changed flush() method to child fd 2022-02-09 15:40:58 +01:00
Anton Hvornum 5777ff9061
Changed flush() method to child fd 2022-02-09 15:39:58 +01:00
Anton Hvornum e2f42065d7
Changed flush() method to child fd 2022-02-09 15:33:09 +01:00
Anton Hvornum c3caea51cc
Bug with formatting of string 2022-02-09 15:28:58 +01:00
Anton Hvornum 83c663fcb2
Bug with formatting of string 2022-02-09 15:26:26 +01:00
Anton Hvornum ae7e791f40
Bug with formatting of string 2022-02-09 15:25:42 +01:00
Anton Hvornum 1a82934a3c
Improving SysCommandWorker() to handle buffered output. 2022-02-09 15:25:03 +01:00
Anton Hvornum 563f15db4d
Adding debug 2022-02-09 15:02:22 +01:00
Anton Hvornum 50cc9f2dfe
Adding debug 2022-02-09 14:56:55 +01:00
Anton Hvornum e4d991b860
Adding debug 2022-02-09 14:55:56 +01:00
Anton Hvornum f18a88927b
using debug 2022-02-09 14:53:08 +01:00
Anton Hvornum 2992849de8
Adding debug 2022-02-09 14:50:32 +01:00
Anton Hvornum 1fdb64858c
Wrong variable name in usage 2022-02-09 14:45:08 +01:00
Anton Hvornum e30290aee0
Added debug information 2022-02-09 14:41:41 +01:00
Anton Hvornum 205d217a44
Added --crypt-x options as parameters, that passes in the values to the .encrypt() function to set iter-time, key-size and hash-type. 2022-02-09 14:39:10 +01:00
Anton Hvornum f1333eb77c
Removed subvolume logic from MapperDev().mount() as a mapperdev isn't a BtrfsSubvolume(), instead we need to create a BtrfsSubvolume().mount() that handles this. 2022-02-09 12:54:34 +01:00
Anton Hvornum 2319267a46
Removed some debugging 2022-02-09 11:59:44 +01:00
Anton Hvornum 216ca90b29
Improved error handling in luks2().close() 2022-02-09 11:58:18 +01:00
Anton Hvornum 3129cf79f4
Wrong variable name in luks2().close() 2022-02-09 11:56:13 +01:00
Anton Hvornum c12fbc900a
Forgot =True to parameter 2022-02-09 11:53:19 +01:00
Anton Hvornum 15b1fb26ce
Added more debugging 2022-02-09 11:51:19 +01:00
Anton Hvornum 45d37ad58d
Made MapperDev() more representable 2022-02-09 11:48:13 +01:00
Anton Hvornum f2750c8d21
Improved logging, and made MapperDev() representable 2022-02-09 11:47:46 +01:00
Anton Hvornum c2d765ff6d
Fixed flake8 complaint 2022-02-09 11:44:03 +01:00
Anton Hvornum 1cdd4313ae
Added some debugging 2022-02-09 11:43:18 +01:00
Anton Hvornum de974322f9
Added some debugging 2022-02-09 11:40:30 +01:00
Anton Hvornum 369daa43fc
luks2().unlock() now returns a MapperDev(). MapperDev() now have a .format() function, which relies on Partition.format() but with a custom path for now. It's not ideal, as it's a bit slow to resolve the Partition() object, but it works. 2022-02-09 11:33:51 +01:00
Anton Hvornum 32d6c1e635
Fixed issue with any() 2022-02-09 10:31:45 +01:00
Anton Hvornum 6f3a867fa3
Fixed flake8 complaint 2022-02-09 10:29:42 +01:00
Anton Hvornum d90c3fa2f5
Fixed syntax issue with missing : 2022-02-09 10:19:57 +01:00
Anton Hvornum 16dd6fe0cd
Forgot import of Union 2022-02-09 10:19:20 +01:00
Anton Hvornum d57f29757d
Added back key_file support for legacy reasons, but it now acts as an input instead. 2022-02-09 10:17:05 +01:00
Anton Hvornum 47dddfc497
Converting --key-file from /tmp/x to /dev/stdin. 2022-02-09 09:54:16 +01:00
Anton Hvornum d3b6832345
Change usage `lsblk` to `blkid` where possible. And general improvements to 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-08 23:21:20 +01:00
Erick G. Islas-Osuna feffa69042
Spanish translation file (#941)
* wip: add base.po for spanish

* feat: spanish translation

* fix: ignore backup files

* Resolve merge conflicts for spanish translation PR

* new translations

Co-authored-by: Anton Hvornum <anton@hvornum.se>
Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
2022-02-08 21:06:45 +01:00
Anton Hvornum 1515fb9fde
Calling Partition().partprobe() instead of general partprobe. This avoids read-only issues and lets Partition().partprobe() deal with the error checks. 2022-02-07 09:10:39 +01:00
Werner Llácer ef558fdb45
Solving some issues after merging flexible_menu (#948)
* Correct definition of btrfs standard layout

* Solve issue #936

* make ask_for_a_timezone as synonym to ask_timezone

* first batch of changes due to the last merges
selector.text is a call to selector.menu_text
A number of Generalmenu methods reappeared in their old version at Global

* disk encryption password menu option restored
2022-02-07 01:58:33 +01:00
Daniel 20e23dcecd
Add locale script (#945)
* Add locales script

* Add gitignore exception

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
2022-02-06 15:17:43 +01:00
Werner Llácer 1ea6fea1d8
Flexible menu 2 (#916)
* Correct definition of btrfs standard layout

* New version of the FlexibleMenu
* Added new functionality to Selector
* Created a GeneralMenu class
* GlobalMenu is made a child of GeneralMenu

* Some refining in GeneralMenu
secret is now a general function

* log is invoked in GeneralMenu directly

* Correction at GeneralMenu

* Materialize again _setup_selection_menu_options. Gives more room to play

* Callbacks converted as methods
Synch() (data area and menu) decoupled from enable()
and made general before any run

* script swiss added to the patch set

* Only_hd gets a new implementation of the menu
flake8 corrections

* swiss.py description added

* New version of the FlexibleMenu
* Added new functionality to Selector
* Created a GeneralMenu class
* GlobalMenu is made a child of GeneralMenu

* changes from the rebase left dangling

* Modify order of execution between exec_menu and post_processing.
Added selector_name as parameter for exec_menu

* minor corrections to the scripts

* Adapt to PR #874

* Solve issue #936

* make ask_for_a_timezone as synonym to ask_timezone

* Adapted to nationalization framework (PR 893).
String still NOT adapted

* flake8 complains

* Use of archinstall.output_config instead of local copy at swiss.py

* Problems with the last merge

* more flake8 complains. caused by reverted changes re. ask*timezone

* git complains

Co-authored-by: Anton Hvornum <anton@hvornum.se>
2022-02-06 11:54:13 +01:00
Daniel 9fb8d3164c
Update nationalization (#944)
* Update nationalization

* Update translations

* Finish german translation

* Fix errors #943

* Add remaining translations

* Fix alignment in menu

* Update README

* Update translations:

* Fix flake8

* Update tz function

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
2022-02-06 11:30:26 +01:00
Werner Llácer ec73bdab4c
Routine to properly print and save config data (#888)
* Created a standard function to show/save the config parameters

* flake8 complains

* Correct definition of btrfs standard layout

* Solve issue #936

* Moved output_configs to lib/configuration.py
2022-02-05 13:52:14 +01:00
Anton Hvornum 0ec9549dc4
Renamed ask_timezone() 2022-02-05 11:17:41 +01:00
Daniel f6d133804b
Provide nationalization (#893)
* Nationalization

* Add _ as builtins to flake8

* Removing conflict hash tag

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Co-authored-by: Anton Hvornum <anton@hvornum.se>
2022-02-05 00:27:29 +01:00