Coder Social home page Coder Social logo

archlinux / archinstall Goto Github PK

View Code? Open in Web Editor NEW
5.9K 63.0 510.0 11.12 MB

Arch Linux installer - guided, templates etc.

License: GNU General Public License v3.0

Python 99.16% Shell 0.84%
arch-installer arch linux archlinux archlinux-installer python3 installer arch-linux iso archinstall

archinstall's People

Contributors

aggamr avatar alexmelman88 avatar castillofrancodamian avatar codefiles avatar conqp avatar demostanis avatar didr avatar dylanmtaylor avatar grazzolini avatar jakobdev avatar jaybent avatar kbdharun avatar l4zy0n3 avatar lavafroth avatar lunarequest avatar m1ten avatar ninchester avatar pyfisch avatar renovate[bot] avatar rffontenelle avatar roxfr avatar secondthunder avatar summoner001 avatar svartkanin avatar torxed avatar utuhiro78 avatar wiseweb-works avatar wllacer avatar yetist avatar zosman1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archinstall's Issues

Issue installing package groups (kde-applications for instance)

As mentioned in #61, support for package groups doesn't work.
The idea here is that it should be supported, we simply never verified that the archinstall.find_package() function can verify those, and apparently it can't. So we have to use another API endpoint or multiple to support this.

The backplane supports it already, as the packages are sent as a unfiltered string to pacman -S more or less.

Instruction to change git-branch

Would be neat, if the instruction set could influence which git branch to run from.
If the instruction arguments have "git" : "experimental" it would save me a bunch of time having to re-create ISO's and/or abort the installation quickly to re-run with the correct branch.

Show file format when showing disks/partitions.

When showing "Select one of the above disks (by number):", in the list above, show the file format on those disks. And a human readable filesize perhaps. Would make it a lot easier to understand which disk is which (even tho you can ctrl+alt+f2 to run fdisk -l yourself).

Support an already installed system

Assuming the following, that someone runs the scripts/library on a docker installation or re-running it after already performing an installation. It would be nice if the installer could run again and run different profiles scenarios. But that requires the mount points to be pointed towards the correct place.

Which, perhaps the archinstall.Installer() should take care of.

Add option to support time zones

As mentioned in #61:

An option to select the timezone / enable NTP would be nice.

The feature is pretty straight forward and not a bad idea.
It's mainly been put on hold because it's an easy thing to configure while inside the machine, but it makes sense to put it in now.

  • Guess time-zone in examples/guided.py based on the locale selected would be nice, but not a requirement
  • Listing time-zones would be nice and almost a requirement.

Add `lib/hardware.py` for detecting different hardware setups

Add hardware helpers, preferably in lib/hardware.py to detect certain hardware features.
Such as ssd/nvme detection, which should be the basis for opting in for btrfs for instance, and default to ext4 or something similar if anything else (as a very generalized example).

Thanks to @grazzolni for this idea.

Guided installation fails during package installation

Hi,

I was testing the guided installer in a virtual machine, but it seems that the installation fails during package installation. I used pip install archinstall==2.0.6rc11 and python -m archinstall guided on the current Arch Linux installation image.

Installing packages: ['vim', 'gdb', 'radare2', 'pwndbg', 'tmux']
Error in profile guided: 'list' object has no attribute 'items'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/archinstall/__main__.py", line 65, in run_as_a_module
    exec(profile)  # Is this is very safe?
  File "<string>", line 240, in <module>
  File "/usr/lib/python3.8/site-packages/archinstall/lib/disk.py", line 192, in __exit__
    raise args[1]
  File "<string>", line 240, in <module>
  File "<string>", line 66, in perform_installation
  File "/usr/lib/python3.8/site-packages/archinstall/lib/installer.py", line 78, in __exit__
    raise args[1]
  File "<string>", line 58, in perform_installation
AttributeError: 'list' object has no attribute 'items'
python -m archinstall guided  41.04s user 18.26s system 25% cpu 3:51.50 total

Full output here.

Edit: When do not select any additional packages, I get the following error:

Error in profile guided: 'packages'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/archinstall/__main__.py", line 65, in run_as_a_module
    exec(profile)  # Is this is very safe?
  File "<string>", line 240, in <module>
  File "/usr/lib/python3.8/site-packages/archinstall/lib/disk.py", line 192, in __exit__
    raise args[1]
  File "<string>", line 240, in <module>
  File "<string>", line 66, in perform_installation
  File "/usr/lib/python3.8/site-packages/archinstall/lib/installer.py", line 78, in __exit__
    raise args[1]
  File "<string>", line 52, in perform_installation
KeyError: 'packages'

Create `archinstall.packages` for helping to find/search for packages.

During installation, if a wrongly inputted package name is given.
It will take time for any error messages to pop up, and the installation will even continue up to the stage of strapping in additional packages.

It might be worth creating a package helper (crude, simple, nothing fancy) to search for package names and verify that they do exist in the upstream package database - prior to continuing the installation.

Add optional support for network configuration (and/or network managers)

A quote from #61:

A simple option to configure networking would also be useful, e.g., enabling DHCP via systemd-networkd.

We should support at least two network managers in this case, systemd-networkd for sure but perhaps also NetworkManager. Both as optional additions. Either way, supporting configuring network (at a very basic level) would be invaluable for almost any installation.

Guess locale based off IP if present

If a gateway is detected, use a geoip library to determain to the best of our ability where the user is coming from. This in order to determain the keyboard layout and suggest mirrors etc.

inherited templates should not replace keys

If two templates have the same "step name" or key, the inherited template should not replace the step of the current template.

"ubuntu" inherits "workstation"
"ubuntu" should replace whatever "desktop"-environment step "workstation" has for isntance. And not the other way around(?).

Multiple triggers via templates (merge templates into static triggers)

Currectly, there's only one trigger supported. And that's per-command-trigger set up by archinstall.py when it detects a chroot request.

However, it would be neat if the trigger-list became a normal list, and triggers from the template got merged into said list so that the template creator can choose multiple steps if need be.

Example: Say a command requires two inputs, "name" and "password". Currently, there's no way of supplying multiple triggers. Fix!

Incorrect filesystem indicator in Partition() when creating ext4 partitions

According to a harmless and rather fun joke on reddit mentioned by u/parkerlreed:

So FATT32 is the new hotness for rootfs? :D

Adding partition to BlockDevice(/dev/sda)
Adding partition to BlockDevice(/dev/sda)
Formatting Partition(path=/dev/sda1, fs=None, mounted=None) -> fat32
Formatting Partition(path=/dev/sda2, fs=None, mounted=None) -> ext4
Mounting Partition(path=/dev/sda2, fs=fat32, mounted=None) to /mnt
Mounting Partition(path=/dev/sda1, fs=fat32, mounted=None) to /mnt/boot
A new package mirror-list has been created: /etc/pacman.d/mirrorlist
Installing packages: ['base', 'base-devel', 'linux', 'linux-firmware', 'efibootmgr', 'nano']

It actually mounted EXT4 just found that funny

/dev/sda2 on /mnt type ext4 (rw,relatime,stripe=8191)

At first glance /dev/sda2 which should be ext4 in a unencrypted configuration, should actually have the status fs=ext4.
The issue is disk.py #L133-L136 which sets:

elif filesystem == 'ext4':
	if (handle := sys_command(f'/usr/bin/mkfs.ext4 -F {self.path}')).exit_code != 0:
		raise DiskError(f'Could not format {self.path} with {filesystem} because: {b"".join(handle)}')
	self.filesystem = 'fat32'     <-----------

And if we check the partition.filesystem at any given point after this, it will give wrong indications.
It does get mounted correctly, it's just the soft login ontop that will break after this point if ever used.

Legacy support: MBR with Grub

Currently, one of the bigger limitations are that the installer/guided templates only support UEFI with Systemd-boot as the default bootloader.

We'll need to add archinstall.MBR as an alternative to:

with archinstall.Filesystem(harddrive, archinstall.GPT) as fs:
    ...

And installation.add_bootloader() should probably take a parameter for which bootloader to install. Currently it doesn't take any arguments, so adding one won't brake anything. Suggestion: installation.add_bootloader("grub")

Make it easier to gather log data

Currently, all the log data is stored in ~/.cache/archinstall/workers/<id>.
That's a little bit to technical for each and everyone most likely, especially considering the targeted users.

This goes hand in hand with #45 (Create a installer.help extension).
But this issue revolves around how to gather the logs for sending.

It's also not very well documented, both in terms of how to find the logs, but also how to submit them or even what to submit. So that needs a big overhaul.

Partitions should have more flexible file system options

Currently, encrypted drives default to using btrfs inside.
Un-encrypted drives default to ext4.

There's no real reason why these has to be forced upon the users.
But for development purposes (and test support of different FS's), this was chosen as a starting point.

Anyone can use the library to format whatever they want, but this is the default of minimal_installation() and the guided.py template currently. All we have to do is expand on guided.py and add another question, and test the support in the lib to support other formats.

The current design goal is to support:

  • Format the entire drive
  • Format entire drive but keep "unsupported" partitions (windows, mac etc)
  • Use the current setup as-is
    • Autodetects pre-mounted partitions and uses them, or
    • Asks which partition to mount where

Changing sys_command to take named keyword arguments.

Just getting back into this project, have been busy wrapping up some things for work.

One of the things I noticed the last time I was diving into this project, is that the sys_command class has a huge implict set of dependencies on things passed in via kwargs. Is there a reason for this?

It seems like it only ever looks at a few keys within kwargs

  • debug
  • emulate
  • events
  • ignore_errors
  • on_output
  • suppress_errors
  • worker
  • worker_id

Having those be explict arguments should make things easier to document. I also worry a bit about kwargs being passed through. For example right now the all_disks function passes through kwargs, but it's not clear that the kwargs for all_disks should be passed to sys_command, and most likely the extra partitions key should not be passed along.

if you're amenable to this I can fix this and send over a PR.

AUR builder doesn't revert /etc/sudoers

When prompted (using the guided.py examples) for AUR support.
The AUR support needs to temporarily grant itself password-less sudo permissions. This because we don't want to accidentally set a root password and something goes wrong. And cleaning up a text file should be easier.

But in all haste of 2.0, the AUR process was simply lifted from the v1.0 branch, which may have the same issue.

change the descriptoin of profiles

all most all of the profiles use A desktop environemtn using "Awesome" window manager. even though the should be separate descriptions pertaining to the specific environment.

Create PGP signed releases

Hi,

I'm creating a package of this on Arch and I would like to ask for PGP signed releases to be created. If possible, also add the keys to the release artifacts. Also, it would be a bonus if all commits and tags were signed. I've noticed a few of the previous tags were signed, but not the most recent ones.

Another thing that would be nice to have, is if we could build a chain of trust for all the keys that could make releasesl, not sure if one already exists.

Thanks

Create a `installer.help` extension

Something along the lines of archinstall.Installer.help() which would print all the debug statistics needed.
And potentially a very optional archinstall.Installer.submit_debug(), but not until thoroughly thought out with better masking of passwords and stuff. The default archinstall.log function should probably have a filter=True for credential sensitive log data.

Make lukscrypt optionally disable-able

Fuzzy title..
Make it so LUKS is default on, but add an option some where to turn it off.
There are rare edge cases where disk encryption won't work for unattended stuff and we can accept the risk of not having disk encryption. But default should be to always have it enabled!

Create man pages

Now that archinstall is packaged on the official repos, it would be nice to have man pages for it as well. I think that, with some adaptation, they could be created from the docutils documentation.

Ignore errors

Some template steps might deliberately cause a error.
Forcing he installer to crash. Having a "ignore-errors" : True makes sense.

Improve selecting from large lists

The search feature by entering ?<enter> is a bit unclear.
And the scrollback history via Shift+PageUp is not always available (in most tty's).

It would there for be nice to break up larger lists into columns over the width of the terminal, as well as make the input text more descriptive.

unknown

Add --silent

Add a silent parameter, making the script as less noisy as possible on the network.
The name of the parameter might be discussable, but should be added at least.

When running in --offline mode, turn every online feature off.
When in --online mode so to speak, mute only automated features like country guessing and stuff. But leave the online-template fetching active.

Unecessary splitting and rejoining of sys_command output

I'm seeing a lot of splitting the output of sys_command using it's iterable, only to immediately rejoin it via b''.join(sys_command(...)). Is there a reason you've used this pattern so widely, since it seems to serve no purpose.

Multi boot support

Would you be interested/open to contributions that allow for installations that need to co-exist with other installations of operating systems?

Encryption issues with NVME (to quick to encrypt)

Some NVME drives are to quick to respond to parted and mkfs, which makes them unavailable when cryptsetup execution attempts to encrypt the drive. The underlying issue is that the disk haven't entered "ready state" in kernel in between sys calls.

A simple time.sleep(5) at luks() proved to solve the issue. A better approach would be to assert and evaluate the state of the drive and release a lock whenever the devices becomes ready.

Temporary solution: Re-run the installation as it's more of a race condition or skip encryption and manually encrypt.

Correction: This has to do with the formatting, not encryption. The disk formatting is to quick on some drives. Fix is on it's way although this happens rarely on most systems.

Rename make_offline -> aur

As of now, the intention of make_offline took a slightly different turn.
It's need came up when we tried to incorporate AUR packages into a ISO/Offline environment.

However, it does the job of building AUR packages and putting them into the ISO pretty neatly.
What it doesn't do, is make a offline-installable version of Arch Linux from the ISO (much like the other Linux distro's got, a CD jamed with all the packages).

So rename this script to ./AUR, and create a new ./make_offline that actually creates a local-hosted mirror on the ISO, that the ISO can use to install itself from. Including others who point their mirror to the ISO. (this is tested and works, that commit is here https://raw.githubusercontent.com/Torxed/Scripts/a7119ecb29b6e9b65936875a051b35d46de57c7f/systemd/offline_arch_mirror/make_mirror)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.