Commit Graph

2401 Commits

Author SHA1 Message Date
Hugo Ankarloo 26244212cf Fix Bug: Cannot get partuuid from loop device
File: lib/disk.py

When installing on a loopback device (a.k.a loop device), function
Filesystem.partuuid_to_index() crashes with a JSON parsing error.

REASON

1) For loop devices, the property BlockDevice.device returns the
   actual image file (back-file) of the loop device instead of the
   /dev/X device.

2) Function Filesystem.partuuid_to_index() executes `lsblk --json`
   against BlockDevice.device .

3) `lsblk` fails and prints the error "not a block device" to stderr.
   This causes the output to not be valid JSON.

4) Code crashes when JSON parser tries to parse the output.

SOLUTION

- Make sure property BlockDevice.device only returns a valid block
  device.

- Create new function BlockDevice.device_or_backfile that mimics
  the present behaviour of BlockDevice.device.

- Use BlockDevice.device_or_backfile in function
  BlockDevice.__repr__().

SOLUTION REASONING

I can only see one reason behind BlockDevice.device returning
the back-file of a loop device, and that is to show the back-file
to the user (instead of /dev/X) when printing the string
representation of a BlockDevice.

All other parts of the code can use the /dev/X file just fine.

And IMO it makes more sense that a property named `device` only
returns devices, and not normal files.
2021-09-20 21:46:56 +02:00
Hugo Ankarloo 915ae88947 Fix Bug: Set filesystem crashes if no partitions
File: lib/user_interaction.py

When function manage_new_and_existing_partitions() is used, and
no partitions are configured, and 'Set desired filesystem for a
partition' is selected, the installer crashes.
2021-09-20 20:17:39 +02:00
Hugo Ankarloo ffbfafb354 Fix Bug: config b0rked by Suggest partition layout
File: lib/user_interaction.py

When function manage_new_and_existing_partitions() is used, and
'Suggest partition layout' is selected, the partition info is not
correctly stored in the config.

Instead of: {"partitions": [{...}, {...}]}
You get: {"partitions": {"partitions": [{...}, {...}], "wipe":True}}
2021-09-20 19:58:56 +02:00
Hugo Ankarloo d2d80113b3 Fix Bug: Timezone is ignored, always same as host
Bug affects normal interactive usage (example/guided.py).

The timezone configured in the installer is not the timezone that
ends up in the new installed system. Instead, the timezone
used in the host system (from where the installer is run) is the
one that finally ends up being used.

Reason: systemd-nspawn by default copies the host timezone into
the target. And systemd-nspawn is run when keyboard-layout is
changed (which is done after changing the timezone).

Solution: Add option `--timezone=off` to systemd-nspawn, which
hinders affecting the timezone in the target.
2021-09-20 19:30:07 +02:00
Anton Hvornum ea41a6c268
Merge pull request #628 from kusakata/patch-1
Update ReadMe document link
2021-09-07 20:41:53 +02:00
Shohei Kusakata 243284d2fd
Update ReadMe document link
fix readthedocs link
2021-09-08 02:43:41 +09:00
Anton Hvornum e3b6a46b74
Update README.md 2021-09-06 18:23:19 +02:00
Anton Hvornum 009dc0ab37
Merge pull request #623 from conqp/clean_hardware_imports
Remove unused import of json
2021-09-06 18:01:46 +02:00
Anton Hvornum 6aa028d29d
Merge pull request #626 from conqp/refactor_meminfo
Refactor meminfo() to allow direct key access
2021-09-06 18:01:31 +02:00
Anton Hvornum 6ead767907
Merge pull request #625 from conqp/fix_tab_indentation
Fix indentation with tabs instead of spaces
2021-09-06 17:59:43 +02:00
Richard Neumann 712e5d4a70 Fix indentation with tabs instead of spaces 2021-09-06 17:15:40 +02:00
Richard Neumann 0a8fe402a4 Refactor meminfo() to allow direct key access 2021-09-06 17:13:26 +02:00
Richard Neumann 93496087e5 Remove unused import of json 2021-09-06 16:52:41 +02:00
Anton Hvornum e39e49ecc7
Merge pull request #426 from archlinux/torxed-rework-partitioning
Re-work partitioning logic, introducing more granularity (and stability)
2021-09-06 16:42:31 +02:00
Anton Hvornum e10daf4c57 Merged in master 2021-09-06 14:41:29 +00:00
Anton Hvornum 51565314b4 Merged in master. 2021-09-06 14:40:05 +00:00
Anton Hvornum 4505c3a11f
Merge pull request #622 from conqp/refactor_cpu_data_detection
Refactor cpu data detection
2021-09-06 16:29:14 +02:00
Richard Neumann 8841e209ee Refactor cpu_model() to use cpuinfo() 2021-09-06 16:12:53 +02:00
Richard Neumann 086dcc3325 Refactor cpu_vendor() to use cpuinfo() 2021-09-06 16:12:16 +02:00
Anton Hvornum 81f3ccad40
Merge pull request #615 from conqp/native_cpu_detection
Native cpu detection
2021-09-06 15:55:05 +02:00
Anton Hvornum 1030bd19c5
Merge branch 'master' into native_cpu_detection 2021-09-06 15:54:52 +02:00
Anton Hvornum 40cd801184
Merge pull request #614 from laxect/patch-1
Fix wrong default in kernels (guide.py)
2021-09-06 15:48:49 +02:00
Anton Hvornum a7d2f5ea03
Merge pull request #613 from RustyRaptor/master
fixed the git checkout non-existent branch
2021-09-06 15:48:11 +02:00
Anton Hvornum 355f502d80
Merge pull request #610 from luckspt/patch-2
Typo
2021-09-06 15:45:53 +02:00
Anton Hvornum 000eb14668
Merge pull request #608 from archlinux/deepin-profile
Remove lightdm packages from Deepin profile
2021-09-06 15:43:29 +02:00
Anton Hvornum bf18260510
Merge pull request #605 from CYPT71/patch-1
Update hardware.py
2021-09-06 15:42:15 +02:00
Anton Hvornum 8d7ccde162
Added exception handling to check_output
I tweaked the optimized return of check_output. Worth mentioning that `check_output()` will raise an exception `subprocess.CalledProcessError: Command 'lscpu | grep AMD' returned non-zero exit status 1.`.
2021-09-06 13:40:45 +00:00
Anton Hvornum 5fe752cf72
No need for try/catch any longer.
The old behavior of SysCommand was that exit codes raised an exception, which needed to be handled by each individual caller. We now utilize `.exit_code` instead to manually detect faulty commands and raise exceptions where needed.
2021-09-06 13:22:53 +00:00
Anton Hvornum 0f5e0c0d3f
Merge pull request #603 from j-james/master
Mention GNOME and KDE's soft dependency on NetworkManager in the installation process
2021-09-06 15:01:43 +02:00
Anton Hvornum 48fd68124a
Merge branch 'master' into master 2021-09-06 15:01:37 +02:00
Anton Hvornum 05c923524b
Merge pull request #600 from monosans/comprehension
Replace for loops with comprehensions
2021-09-06 14:26:30 +02:00
Anton Hvornum 025dc83194 Corrected some minor modifications mentioned in #595 as well as merged in latest changes from master. For future PR's do create a patch-branch for upstream patches to avoid changes to your local repo. 2021-09-06 12:22:57 +00:00
Anton Hvornum cc6491f0a5
Merge pull request #578 from l4zy0n3/patch-2
created load_config() to load configuration
2021-09-06 12:11:58 +02:00
Anton Hvornum 8a0a9b16e1 Merge branch 'master' of github.com:archlinux/archinstall into torxed-rework-partitioning 2021-09-04 20:58:05 +02:00
Anton Hvornum e88ac430f2
Fixed edge case where size of disks could be exactly 40GB and a /home would never be created on single devices. 2021-09-04 20:54:25 +02:00
Anton Hvornum 278ded8e74
Added a PARTUUID -> parted index, this in order to properly set the boot flag on the correct partition. Perhaps there's a smarter way. I suspect parted can operate on a given partition ID, but haven't found the docs for it yet. 2021-09-04 19:09:16 +02:00
Anton Hvornum 429006fe4b
Simplified lambda and made it filter out non relevant disks for the selection process. 2021-09-04 17:03:52 +02:00
Anton Hvornum 1814a19d6a
Fixed filtering if largest disk selection 2021-09-04 16:39:15 +02:00
Richard Neumann a5a56728f1 Remove excess newline 2021-08-20 18:16:45 +02:00
Richard Neumann 61947ab944 Rewrite CPU vendor detection functions
Use cpuinfo() function rather than a subprocess.
2021-08-20 18:16:00 +02:00
Richard Neumann b8ede1b333 Add cpuinfo() 2021-08-20 18:13:23 +02:00
Yash Tripathi c461cc49e7
only prompt if _selected_servers is not set 2021-08-20 03:54:23 +05:30
Yash Tripathi 78bbf26c1a
Update guided.py 2021-08-20 03:48:13 +05:30
Yash Tripathi 6d462ac1cc
added servers key 2021-08-20 03:34:50 +05:30
ギャラ 79f70cee21
Update guided.py
Fix wrong default in kernels.
2021-08-18 20:52:10 +09:00
Anton Hvornum 81e52bc3ff
Reworking logic that selects / and /home for multi-disk configurations. Also added some more debugging 2021-08-18 08:17:50 +02:00
RustyRaptor 71ec22a349
fixed the git checkout non-existent branch
It looks like the `torxed-v2.2.0` branch doesnt exist anymore and I assume its now just `v2.2.0` instead so I changed this command in Using a live ISO
2021-08-17 13:54:26 -06:00
Anton Hvornum 59c366da35
Fixed a prompt error in one of the parted calls. Also started on a more reliable size-conversion that isn't limited to Gigabytes in free_space(). 2021-08-17 20:23:20 +02:00
Felix Yan 339e9f8a42
Add back lightdm, be more explicit 2021-08-05 15:23:50 +08:00
Lucas Pinto 64e6b7b456
Typo
Fix a tiny typo
2021-07-28 01:35:26 +01:00