From e9d5cd1a112111a7fff48874bd39abaaf6f3e847 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:07:18 -0400 Subject: Rework budgie to use package definition --- profiles/budgie.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'profiles') diff --git a/profiles/budgie.py b/profiles/budgie.py index 6c5475ae..fc061cd2 100644 --- a/profiles/budgie.py +++ b/profiles/budgie.py @@ -4,6 +4,9 @@ import archinstall is_top_level_profile = False +# "It is recommended also to install the gnome group, which contains applications required for the standard GNOME experience." - Arch Wiki +__packages__ = ["budgie-desktop", "lightdm", "lightdm-gtk-greeter", "gnome"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer @@ -27,8 +30,7 @@ if __name__ == 'budgie': # Install dependency profiles installation.install_profile('xorg') - # Install the application budgie from the template under /applications/ - budgie = archinstall.Application(installation, 'budgie') - budgie.install() + # Install the Budgie packages + installation.add_additional_packages(__packages__) installation.enable_service('lightdm') # Light Display Manager -- cgit v1.2.3-70-g09d2 From f319308d37ddf3dbfa6d62c500d61266f55771cd Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:08:50 -0400 Subject: Remove application profiles that just install additional packages and do not do anything else to customize or configure. --- profiles/applications/alacritty.py | 3 --- profiles/applications/budgie.py | 4 ---- profiles/applications/cinnamon.py | 3 --- profiles/applications/deepin.py | 5 ----- profiles/applications/gnome.py | 4 ---- profiles/applications/i3-gaps.py | 2 -- profiles/applications/i3-wm.py | 2 -- profiles/applications/kde.py | 5 ----- profiles/applications/lxqt.py | 3 --- profiles/applications/mate.py | 3 --- profiles/applications/sway.py | 3 --- profiles/applications/xfce4.py | 3 --- 12 files changed, 40 deletions(-) delete mode 100644 profiles/applications/alacritty.py delete mode 100644 profiles/applications/budgie.py delete mode 100644 profiles/applications/cinnamon.py delete mode 100644 profiles/applications/deepin.py delete mode 100644 profiles/applications/gnome.py delete mode 100644 profiles/applications/i3-gaps.py delete mode 100644 profiles/applications/i3-wm.py delete mode 100644 profiles/applications/kde.py delete mode 100644 profiles/applications/lxqt.py delete mode 100644 profiles/applications/mate.py delete mode 100644 profiles/applications/sway.py delete mode 100644 profiles/applications/xfce4.py (limited to 'profiles') diff --git a/profiles/applications/alacritty.py b/profiles/applications/alacritty.py deleted file mode 100644 index aab64bb4..00000000 --- a/profiles/applications/alacritty.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall - -installation.add_additional_packages("alacritty") \ No newline at end of file diff --git a/profiles/applications/budgie.py b/profiles/applications/budgie.py deleted file mode 100644 index ccec4e14..00000000 --- a/profiles/applications/budgie.py +++ /dev/null @@ -1,4 +0,0 @@ -import archinstall - -# "It is recommended also to install the gnome group, which contains applications required for the standard GNOME experience." - Arch Wiki -installation.add_additional_packages("budgie-desktop lightdm lightdm-gtk-greeter gnome") \ No newline at end of file diff --git a/profiles/applications/cinnamon.py b/profiles/applications/cinnamon.py deleted file mode 100644 index 0a1d9cc2..00000000 --- a/profiles/applications/cinnamon.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall - -installation.add_additional_packages("cinnamon system-config-printer gnome-keyring gnome-terminal blueberry metacity lightdm lightdm-gtk-greeter") diff --git a/profiles/applications/deepin.py b/profiles/applications/deepin.py deleted file mode 100644 index 0db1572d..00000000 --- a/profiles/applications/deepin.py +++ /dev/null @@ -1,5 +0,0 @@ -import archinstall - -packages = "deepin deepin-terminal deepin-editor" - -installation.add_additional_packages(packages) diff --git a/profiles/applications/gnome.py b/profiles/applications/gnome.py deleted file mode 100644 index e26290dc..00000000 --- a/profiles/applications/gnome.py +++ /dev/null @@ -1,4 +0,0 @@ -import archinstall - -installation.add_additional_packages("gnome gnome-tweaks gdm") -# Note: gdm should be part of the gnome group, but adding it here for clarity diff --git a/profiles/applications/i3-gaps.py b/profiles/applications/i3-gaps.py deleted file mode 100644 index 4daed7ad..00000000 --- a/profiles/applications/i3-gaps.py +++ /dev/null @@ -1,2 +0,0 @@ -import archinstall -installation.add_additional_packages("i3-gaps") \ No newline at end of file diff --git a/profiles/applications/i3-wm.py b/profiles/applications/i3-wm.py deleted file mode 100644 index e7838a64..00000000 --- a/profiles/applications/i3-wm.py +++ /dev/null @@ -1,2 +0,0 @@ -import archinstall -installation.add_additional_packages("i3-wm") \ No newline at end of file diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py deleted file mode 100644 index af1e6597..00000000 --- a/profiles/applications/kde.py +++ /dev/null @@ -1,5 +0,0 @@ -import archinstall -packages = "plasma-meta konsole kate dolphin sddm plasma-wayland-session" -if "nvidia" in _gfx_driver_packages: - packages = packages + " egl-wayland" -installation.add_additional_packages(packages) diff --git a/profiles/applications/lxqt.py b/profiles/applications/lxqt.py deleted file mode 100644 index 2099f3fa..00000000 --- a/profiles/applications/lxqt.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall - -installation.add_additional_packages("lxqt breeze-icons oxygen-icons xdg-utils ttf-freefont leafpad slock sddm") diff --git a/profiles/applications/mate.py b/profiles/applications/mate.py deleted file mode 100644 index 24d6be47..00000000 --- a/profiles/applications/mate.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall - -installation.add_additional_packages("mate mate-extra lightdm lightdm-gtk-greeter") \ No newline at end of file diff --git a/profiles/applications/sway.py b/profiles/applications/sway.py deleted file mode 100644 index 59921aa0..00000000 --- a/profiles/applications/sway.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall -__packages__ = "sway swaylock swayidle waybar dmenu light grim slurp pavucontrol alacritty" -installation.add_additional_packages(__packages__) diff --git a/profiles/applications/xfce4.py b/profiles/applications/xfce4.py deleted file mode 100644 index 9f4260da..00000000 --- a/profiles/applications/xfce4.py +++ /dev/null @@ -1,3 +0,0 @@ -import archinstall -__packages__ = "xfce4 xfce4-goodies lightdm lightdm-gtk-greeter" -installation.add_additional_packages(__packages__) \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 8706b48097f0fdb8eab7a612378bc3352ec00c18 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:10:08 -0400 Subject: Restore kde.py --- profiles/applications/kde.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 profiles/applications/kde.py (limited to 'profiles') diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py new file mode 100644 index 00000000..af1e6597 --- /dev/null +++ b/profiles/applications/kde.py @@ -0,0 +1,5 @@ +import archinstall +packages = "plasma-meta konsole kate dolphin sddm plasma-wayland-session" +if "nvidia" in _gfx_driver_packages: + packages = packages + " egl-wayland" +installation.add_additional_packages(packages) -- cgit v1.2.3-70-g09d2 From 2d4326b6c5dd117094dd68f533bb15e997ae1571 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:11:36 -0400 Subject: Rework how alacritty is installed for awesome --- profiles/applications/kde.py | 3 +++ profiles/awesome.py | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'profiles') diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py index af1e6597..150fc0e3 100644 --- a/profiles/applications/kde.py +++ b/profiles/applications/kde.py @@ -1,5 +1,8 @@ import archinstall + packages = "plasma-meta konsole kate dolphin sddm plasma-wayland-session" + if "nvidia" in _gfx_driver_packages: packages = packages + " egl-wayland" + installation.add_additional_packages(packages) diff --git a/profiles/awesome.py b/profiles/awesome.py index cbd52a3c..694a4f9d 100644 --- a/profiles/awesome.py +++ b/profiles/awesome.py @@ -6,7 +6,7 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['nemo', 'gpicview-gtk3', 'scrot'] +__packages__ = ['nemo', 'gpicview-gtk3', 'scrot', 'alacritty'] def _prep_function(*args, **kwargs): """ @@ -35,9 +35,6 @@ if __name__ == 'awesome': installation.add_additional_packages(__packages__) - alacritty = archinstall.Application(installation, 'alacritty') - alacritty.install() - # TODO: Copy a full configuration to ~/.config/awesome/rc.lua instead. with open(f'{installation.target}/etc/xdg/awesome/rc.lua', 'r') as fh: awesome_lua = fh.read() -- cgit v1.2.3-70-g09d2 From 23a9e9f69a76adb1015ab80ea84ffdae86cefb09 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:13:16 -0400 Subject: Change how i3 configurations are installed --- profiles/i3.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'profiles') diff --git a/profiles/i3.py b/profiles/i3.py index b82c03d6..f071714a 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -60,5 +60,4 @@ if __name__ == 'i3': installation.enable_service('lightdm') # install the i3 group now - i3 = archinstall.Application(installation, archinstall.storage['_i3_configuration']) - i3.install() + installation.add_additional_packages(installation, archinstall.storage['_i3_configuration']) \ No newline at end of file -- cgit v1.2.3-70-g09d2 From f91c0137d5f9a5f01229f21e62e81e52e41635ce Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:14:18 -0400 Subject: Remove refs to application profiles that were removed --- profiles/cinnamon.py | 5 ++--- profiles/deepin.py | 5 ++--- profiles/gnome.py | 5 ++--- profiles/lxqt.py | 5 ++--- profiles/mate.py | 5 ++--- profiles/sway.py | 5 ++--- profiles/xfce4.py | 5 ++--- 7 files changed, 14 insertions(+), 21 deletions(-) (limited to 'profiles') diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py index 91a59811..a8b89031 100644 --- a/profiles/cinnamon.py +++ b/profiles/cinnamon.py @@ -27,8 +27,7 @@ if __name__ == 'cinnamon': # Install dependency profiles installation.install_profile('xorg') - # Install the application cinnamon from the template under /applications/ - cinnamon = archinstall.Application(installation, 'cinnamon') - cinnamon.install() + # Install the Cinnamon packages + installation.add_additional_packages(__packages__) installation.enable_service('lightdm') # Light Display Manager diff --git a/profiles/deepin.py b/profiles/deepin.py index 52bcdde5..f476f7e3 100644 --- a/profiles/deepin.py +++ b/profiles/deepin.py @@ -29,9 +29,8 @@ if __name__ == 'deepin': # Install dependency profiles installation.install_profile('xorg') - # Install the application deepin from the template under /applications/ - deepin = archinstall.Application(installation, 'deepin') - deepin.install() + # Install the Deepin packages + installation.add_additional_packages(__packages__) # Enable autostart of Deepin for all users installation.enable_service('lightdm') diff --git a/profiles/gnome.py b/profiles/gnome.py index c75cafee..cc80a606 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -28,9 +28,8 @@ if __name__ == 'gnome': # Install dependency profiles installation.install_profile('xorg') - # Install the application gnome from the template under /applications/ - gnome = archinstall.Application(installation, 'gnome') - gnome.install() + # Install the GNOME packages + installation.add_additional_packages(__packages__) installation.enable_service('gdm') # Gnome Display Manager # We could also start it via xinitrc since we do have Xorg, diff --git a/profiles/lxqt.py b/profiles/lxqt.py index 871488ee..e1ac8ab7 100644 --- a/profiles/lxqt.py +++ b/profiles/lxqt.py @@ -28,8 +28,7 @@ if __name__ == 'lxqt': # Install dependency profiles installation.install_profile('xorg') - # Install the application xfce4 from the template under /applications/ - xfce = archinstall.Application(installation, 'lxqt') - xfce.install() + # Install the LXQt packages + installation.add_additional_packages(__packages__) installation.enable_service('sddm') # SDDM Display Manager diff --git a/profiles/mate.py b/profiles/mate.py index b4c697b1..3b48d0ab 100644 --- a/profiles/mate.py +++ b/profiles/mate.py @@ -27,8 +27,7 @@ if __name__ == 'mate': # Install dependency profiles installation.install_profile('xorg') - # Install the application mate from the template under /applications/ - mate = archinstall.Application(installation, 'mate') - mate.install() + # Install the MATE packages + installation.add_additional_packages(__packages__) installation.enable_service('lightdm') # Light Display Manager diff --git a/profiles/sway.py b/profiles/sway.py index c3a6e31a..84ea049b 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -24,6 +24,5 @@ def _prep_function(*args, **kwargs): # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") # or through conventional import sway if __name__ == 'sway': - # Install the application sway from the template under /applications/ - sway = archinstall.Application(installation, 'sway') - sway.install() + # Install the Sway packages + installation.add_additional_packages(__packages__) diff --git a/profiles/xfce4.py b/profiles/xfce4.py index fee8c37a..ffe4a3c0 100644 --- a/profiles/xfce4.py +++ b/profiles/xfce4.py @@ -28,8 +28,7 @@ if __name__ == 'xfce4': # Install dependency profiles installation.install_profile('xorg') - # Install the application xfce4 from the template under /applications/ - xfce = archinstall.Application(installation, 'xfce4') - xfce.install() + # Install the XFCE4 packages + installation.add_additional_packages(__packages__) installation.enable_service('lightdm') # Light Display Manager -- cgit v1.2.3-70-g09d2 From 6013e06fb134eb6d07764aea778399baccd49d21 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:20:00 -0400 Subject: Add packages to top of each desktop profile --- profiles/cinnamon.py | 2 ++ profiles/deepin.py | 1 + profiles/gnome.py | 3 +++ profiles/kde.py | 2 ++ profiles/lxqt.py | 2 ++ profiles/mate.py | 2 ++ profiles/sway.py | 2 ++ profiles/xfce4.py | 2 ++ 8 files changed, 16 insertions(+) (limited to 'profiles') diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py index a8b89031..4ca9cfed 100644 --- a/profiles/cinnamon.py +++ b/profiles/cinnamon.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = False +__packages__ = ["cinnamon", "system-config-printer", "gnome-keyring", "gnome-terminal", "blueberry", "metacity", "lightdm", "lightdm-gtk-greeter"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/deepin.py b/profiles/deepin.py index f476f7e3..ce59a699 100644 --- a/profiles/deepin.py +++ b/profiles/deepin.py @@ -4,6 +4,7 @@ import archinstall, os is_top_level_profile = False +__packages__ = ["deepin", "deepin-terminal", "deepin-editor"] def _prep_function(*args, **kwargs): """ diff --git a/profiles/gnome.py b/profiles/gnome.py index cc80a606..a480d713 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -4,6 +4,9 @@ import archinstall is_top_level_profile = False +# Note: GDM should be part of the gnome group, but adding it here for clarity +__packages__ = ["gnome". "gnome-tweaks", "gdm"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/kde.py b/profiles/kde.py index 6654dfa7..28460cbc 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -4,6 +4,8 @@ import archinstall, os is_top_level_profile = False +__packages__ = ["plasma-meta", "konsole", "kate", "dolphin", "sddm", "plasma-wayland-session"] + # TODO: Remove hard dependency of bash (due to .bash_profile) def _prep_function(*args, **kwargs): diff --git a/profiles/lxqt.py b/profiles/lxqt.py index e1ac8ab7..d0727a90 100644 --- a/profiles/lxqt.py +++ b/profiles/lxqt.py @@ -5,6 +5,8 @@ import archinstall is_top_level_profile = False +__packages__ = ["lxqt", "breeze-icons", "oxygen-icons", "xdg-utils", "ttf-freefont", "leafpad", "slock", "sddm"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/mate.py b/profiles/mate.py index 3b48d0ab..2cfe7305 100644 --- a/profiles/mate.py +++ b/profiles/mate.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = False +__packages__ = ["mate", "mate-extra", "lightdm", "lightdm-gtk-greeter"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/sway.py b/profiles/sway.py index 84ea049b..db94ae2c 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -4,6 +4,8 @@ import archinstall is_top_level_profile = False +__packages__ = ["sway", "swaylock", "swayidle", "waybar", "dmenu", "light", "grim", "slurp", "pavucontrol", "alacritty"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer diff --git a/profiles/xfce4.py b/profiles/xfce4.py index ffe4a3c0..8102919b 100644 --- a/profiles/xfce4.py +++ b/profiles/xfce4.py @@ -5,6 +5,8 @@ import archinstall is_top_level_profile = False +__packages__ = ["xfce4", "xfce4-goodies", "lightdm", "lightdm-gtk-greeter"] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer -- cgit v1.2.3-70-g09d2 From fd042053be741edaac8d967899d4b9cb1c4a913b Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:21:24 -0400 Subject: Rework KDE profile package installation --- profiles/applications/kde.py | 2 +- profiles/kde.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'profiles') diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py index 150fc0e3..a3332130 100644 --- a/profiles/applications/kde.py +++ b/profiles/applications/kde.py @@ -1,6 +1,6 @@ import archinstall -packages = "plasma-meta konsole kate dolphin sddm plasma-wayland-session" +packages = "" # Other packages for KDE are installed in the main profile now. if "nvidia" in _gfx_driver_packages: packages = packages + " egl-wayland" diff --git a/profiles/kde.py b/profiles/kde.py index 28460cbc..1c98237b 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -39,7 +39,10 @@ if __name__ == 'kde': # Install dependency profiles installation.install_profile('xorg') - # Install the application kde from the template under /applications/ + # Install the KDE packages + installation.add_additional_packages(__packages__) + + # Run KDE application configuration kde = archinstall.Application(installation, 'kde') kde.install() -- cgit v1.2.3-70-g09d2 From f9f359ab73dabb74543909af5e98adb6c56a189d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 28 Apr 2021 11:30:30 -0400 Subject: This variable wasn't really needed. --- profiles/applications/kde.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'profiles') diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py index a3332130..eacba708 100644 --- a/profiles/applications/kde.py +++ b/profiles/applications/kde.py @@ -1,8 +1,6 @@ import archinstall -packages = "" # Other packages for KDE are installed in the main profile now. +# Other packages for KDE are installed in the main profile now. if "nvidia" in _gfx_driver_packages: - packages = packages + " egl-wayland" - -installation.add_additional_packages(packages) + installation.add_additional_packages("egl-wayland") -- cgit v1.2.3-70-g09d2 From 1238199ed8022fbfaedcf746527b5d8c1ad975b9 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 28 Apr 2021 11:44:12 -0400 Subject: egl-wayland is small enough that conditionally installing it doesn't make a lot of sense --- profiles/applications/kde.py | 6 ------ profiles/kde.py | 6 +----- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 profiles/applications/kde.py (limited to 'profiles') diff --git a/profiles/applications/kde.py b/profiles/applications/kde.py deleted file mode 100644 index eacba708..00000000 --- a/profiles/applications/kde.py +++ /dev/null @@ -1,6 +0,0 @@ -import archinstall - -# Other packages for KDE are installed in the main profile now. - -if "nvidia" in _gfx_driver_packages: - installation.add_additional_packages("egl-wayland") diff --git a/profiles/kde.py b/profiles/kde.py index 1c98237b..c8efdcde 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -4,7 +4,7 @@ import archinstall, os is_top_level_profile = False -__packages__ = ["plasma-meta", "konsole", "kate", "dolphin", "sddm", "plasma-wayland-session"] +__packages__ = ["plasma-meta", "konsole", "kate", "dolphin", "sddm", "plasma-wayland-session", "egl-wayland"] # TODO: Remove hard dependency of bash (due to .bash_profile) @@ -42,9 +42,5 @@ if __name__ == 'kde': # Install the KDE packages installation.add_additional_packages(__packages__) - # Run KDE application configuration - kde = archinstall.Application(installation, 'kde') - kde.install() - # Enable autostart of KDE for all users installation.enable_service('sddm') -- cgit v1.2.3-70-g09d2 From 2d02e806f2ae5341752a0ceb532e5c239a164ee7 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 29 Apr 2021 08:18:43 +0000 Subject: Cleaning up packages. (#374) * Cleaning up packages. installer now relies on __packages__ definition. Which will work with external libs to more easily gather packages used by installer and profiles. * Added back the logic for the log message, where we inform if we're adding the boot loader to root or boot. * Added __package__ definition to profiles and the installer. These packages can be used as an indication from outside libraries of what could *possibly* be installed. For instance an offline-tool could source these, it would source more than it needed to, but it would give a quick rundown of what might be needed. * Removed import of __base__packages__ as it's now just __packages__ after a lot of stream-lining. * Explosion misspelling. Co-authored-by: Anton Hvornum --- archinstall/__init__.py | 2 +- archinstall/lib/hardware.py | 4 +++- archinstall/lib/installer.py | 21 +++++++++------------ profiles/52-54-00-12-34-56.py | 14 ++++++-------- profiles/awesome.py | 2 +- profiles/i3.py | 8 ++++---- profiles/xorg.py | 4 +++- 7 files changed, 27 insertions(+), 28 deletions(-) (limited to 'profiles') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index bc58af54..e2c7ea62 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -3,7 +3,7 @@ from .lib.general import * from .lib.disk import * from .lib.user_interaction import * from .lib.exceptions import * -from .lib.installer import __packages__, __base_packages__, Installer +from .lib.installer import __packages__, Installer from .lib.profiles import * from .lib.luks import * from .lib.mirrors import * diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index d6cf982c..e9c63e41 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -3,6 +3,8 @@ from .general import sys_command from .networking import list_interfaces, enrichIfaceTypes from typing import Optional +__packages__ = ['xf86-video-amdgpu', 'xf86-video-ati', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-fbdev', 'xf86-video-vesa', 'xf86-video-vmware', 'nvidia', 'mesa'] + AVAILABLE_GFX_DRIVERS = { # Sub-dicts are layer-2 options to be selected # and lists are a list of packages to be installed @@ -18,7 +20,7 @@ AVAILABLE_GFX_DRIVERS = { 'mesa' : ['mesa'], 'fbdev' : ['xf86-video-fbdev'], 'vesa' : ['xf86-video-vesa'], - 'vmware' : ['xf86-video-vmware'] + 'vmware / virtualbox' : ['xf86-video-vmware'] } def hasWifi()->bool: diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index a5449662..dbc6d1b4 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -12,8 +12,7 @@ from .storage import storage from .hardware import * # Any package that the Installer() is responsible for (optional and the default ones) -__packages__ = ["base", "base-devel", "linux", "linux-firmware", "efibootmgr", "nano", "ntp", "iwd"] -__base_packages__ = __packages__[:6] +__packages__ = ["base", "base-devel", "linux-firmware", "linux", "linux-lts", "linux-zen", "linux-hardened"] class Installer(): """ @@ -39,8 +38,7 @@ class Installer(): :type hostname: str, optional """ - def __init__(self, target, *, base_packages='base base-devel linux-firmware', kernels='linux'): - kernels = kernels.split(",") + def __init__(self, target, *, base_packages=__packages__[:3], kernels=['linux']): self.target = target self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S') self.milliseconds = int(str(time.time()).split('.')[1]) @@ -53,10 +51,7 @@ class Installer(): self.base_packages = base_packages.split(' ') if type(base_packages) is str else base_packages for kernel in kernels: self.base_packages.append(kernel) - if hasUEFI(): - self.base_packages.append("efibootmgr") - else: - self.base_packages.append("grub") + self.post_base_install = [] storage['session'] = self @@ -364,12 +359,12 @@ class Installer(): boot_partition = partition elif partition.mountpoint == self.target: root_partition = partition - if hasUEFI(): - self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=logging.INFO) - else: - self.log(f'Adding bootloader {bootloader} to {root_partition}', level=logging.INFO) + + self.log(f'Adding bootloader {bootloader} to {boot_partition if boot_partition else root_partition}', level=logging.INFO) if bootloader == 'systemd-bootctl': + self.pacstrap('efibootmgr') + if not hasUEFI(): raise HardwareIncompatibilityError # TODO: Ideally we would want to check if another config @@ -432,6 +427,8 @@ class Installer(): raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.target}/boot/loader/entries/arch.conf will be broken until fixed.") elif bootloader == "grub-install": + self.pacstrap('grub') + if hasUEFI(): o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB')) sys_command('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg') diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index ed2c9d78..442e053c 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -1,7 +1,8 @@ import archinstall import json import urllib.request -import git + +__packages__ = ['nano', 'wget', 'git'] # Unmount and close previous runs (Mainly only used for re-runs, but won't hurt.) archinstall.sys_command(f'umount -R /mnt', suppress_errors=True) @@ -30,22 +31,19 @@ with archinstall.Filesystem(harddrive) as fs: if installation.minimal_installation(): installation.add_bootloader() - installation.add_additional_packages(['nano', 'wget', 'git']) + installation.add_additional_packages(__packages__) installation.install_profile('awesome') - installation.user_create('anton', 'test') + installation.user_create('devel', 'devel') installation.user_set_pw('root', 'toor') - repo = git.Repo('./') - commit = repo.head.commit.hexsha[:7] - - print(f'Submitting {commit}: success') + print(f'Submitting {archinstall.__version__}: success') conditions = { "project": "archinstall", "profile": "52-54-00-12-34-56", "status": "success", - "commit": commit + "version": archinstall.__version__ } req = urllib.request.Request("https://api.archlinux.life/build/success", data=json.dumps(conditions).encode('utf8'), diff --git a/profiles/awesome.py b/profiles/awesome.py index cbd52a3c..01566d0f 100644 --- a/profiles/awesome.py +++ b/profiles/awesome.py @@ -6,7 +6,7 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['nemo', 'gpicview-gtk3', 'scrot'] +__packages__ = ['nemo', 'gpicview-gtk3', 'maim'] def _prep_function(*args, **kwargs): """ diff --git a/profiles/i3.py b/profiles/i3.py index b82c03d6..148e591e 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -6,7 +6,7 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm'] +__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm'] def _prep_function(*args, **kwargs): """ @@ -48,13 +48,13 @@ if __name__ == 'i3': """ # Install common packages for all i3 configurations - installation.add_additional_packages(__packages__) + installation.add_additional_packages(__packages__[:4]) # Install dependency profiles installation.install_profile('xorg') - # gaps is installed by deafult so we are overriding it here - installation.add_additional_packages("lightdm-gtk-greeter lightdm") + # gaps is installed by deafult so we are overriding it here with lightdm + installation.add_additional_packages(__packages__[4:]) # Auto start lightdm for all users installation.enable_service('lightdm') diff --git a/profiles/xorg.py b/profiles/xorg.py index cd89668d..7546a01b 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -1,10 +1,12 @@ # A system with "xorg" installed import os -from archinstall import generic_select, sys_command, RequirementError import archinstall + is_top_level_profile = True +__packages__ = ['dkms', 'xorg-server', 'xorg-xinit', 'nvidia-dkms', 'xorg-server', *archinstall.lib.hardware.__packages__] + def _prep_function(*args, **kwargs): """ Magic function called by the importing installer -- cgit v1.2.3-70-g09d2 From 16a1a006431e5d6ac39f6b54e70a8d2511ebfa17 Mon Sep 17 00:00:00 2001 From: Jatin <40650341+jatin-cbs@users.noreply.github.com> Date: Thu, 29 Apr 2021 15:50:01 +0530 Subject: Fixed a typo in the last PR https://github.com/archlinux/archinstall/pull/378 replaced a `.` with a `,` in gnome.py profile. --- profiles/gnome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/gnome.py b/profiles/gnome.py index a480d713..77c90859 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -5,7 +5,7 @@ import archinstall is_top_level_profile = False # Note: GDM should be part of the gnome group, but adding it here for clarity -__packages__ = ["gnome". "gnome-tweaks", "gdm"] +__packages__ = ["gnome", "gnome-tweaks", "gdm"] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2 From eb2174eef92208da9b3e5ea80df54e216b68313b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 06:57:52 -0400 Subject: Add nginx profile --- profiles/applications/nginx.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/nginx.py (limited to 'profiles') diff --git a/profiles/applications/nginx.py b/profiles/applications/nginx.py new file mode 100644 index 00000000..50eb0506 --- /dev/null +++ b/profiles/applications/nginx.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["nginx"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('nginx') -- cgit v1.2.3-70-g09d2 From 5c6cd59aecde69c85676235ef0e739fba59a55fd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 07:03:57 -0400 Subject: Add Apache HTTPD Application Profile --- profiles/applications/httpd.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/httpd.py (limited to 'profiles') diff --git a/profiles/applications/httpd.py b/profiles/applications/httpd.py new file mode 100644 index 00000000..00d64b6e --- /dev/null +++ b/profiles/applications/httpd.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["apache"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('httpd') -- cgit v1.2.3-70-g09d2 From 9e8446a96abbd406fa8c037d008d0ada593de227 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 07:09:46 -0400 Subject: Add Tomcat application profile Using Tomcat 10 as that is the latest release --- profiles/applications/tomcat.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 profiles/applications/tomcat.py (limited to 'profiles') diff --git a/profiles/applications/tomcat.py b/profiles/applications/tomcat.py new file mode 100644 index 00000000..9c521390 --- /dev/null +++ b/profiles/applications/tomcat.py @@ -0,0 +1,12 @@ +import archinstall + +# This is using Tomcat 10 as that is the latest release at the time of implementation. +# This should probably be updated to use newer releases as they come out. + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["tomcat10"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('tomcat10') -- cgit v1.2.3-70-g09d2 From 5cf0419073699ef476d21feacb50f06cf96e4f94 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 07:14:34 -0400 Subject: Add Docker Application Profile --- profiles/applications/docker.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/docker.py (limited to 'profiles') diff --git a/profiles/applications/docker.py b/profiles/applications/docker.py new file mode 100644 index 00000000..afa3f8fb --- /dev/null +++ b/profiles/applications/docker.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["docker"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('docker') -- cgit v1.2.3-70-g09d2 From 9d5e9333c7a44dbdf6d3008a6ba61620b7e4d040 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 07:18:38 -0400 Subject: Add lighttpd application profile --- profiles/applications/lighttpd.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/lighttpd.py (limited to 'profiles') diff --git a/profiles/applications/lighttpd.py b/profiles/applications/lighttpd.py new file mode 100644 index 00000000..a1e6a371 --- /dev/null +++ b/profiles/applications/lighttpd.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["lighttpd"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('lighttpd') -- cgit v1.2.3-70-g09d2 From 0ebc6be7ae3b153f2baad722a08a2019bb04c905 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 29 Apr 2021 11:32:21 +0000 Subject: Added a postgresql application profile. (#383) * Added a postgres application profile. Also introducing runas to the arch_chroot of the installation, to run commands as emulated users. This is highly WIP at the moment. * Fixing top-level-listing of profiles. As well as testing some postgres installation steps. * Removed dupe functions. * Added safety check in case a comment mentions the top level profile thing. * Patching namespace corruption. * Avoiding runtime collision due to installation not being initiated yet. * Allow for parameterization of filesystem in guided. Co-authored-by: Anton Hvornum --- archinstall/lib/disk.py | 1 - archinstall/lib/installer.py | 3 +++ archinstall/lib/profiles.py | 53 +++++++------------------------------ examples/guided.py | 6 +++-- profiles/52-54-00-12-34-56.py | 8 +++++- profiles/applications/postgresql.py | 11 ++++++++ 6 files changed, 34 insertions(+), 48 deletions(-) create mode 100644 profiles/applications/postgresql.py (limited to 'profiles') diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index ff924f62..49bef1be 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -471,7 +471,6 @@ class Filesystem(): def raw_parted(self, string:str): x = sys_command(f'/usr/bin/parted -s {string}') - log(f"'parted -s {string}' returned: {b''.join(x)}", level=logging.DEBUG) return x def parted(self, string:str): diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index dbc6d1b4..a7b36481 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -196,6 +196,9 @@ class Installer(): return sys_command(f'/usr/bin/arch-chroot {self.target} {cmd}') def arch_chroot(self, cmd, *args, **kwargs): + if 'runas' in kwargs: + cmd = f"su - {kwargs['runas']} -c \"{cmd}\"" + return self.run_command(cmd) def drop_to_shell(self): diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index ad5d3bac..06237c1c 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -92,6 +92,9 @@ class Script(): if len(args) >= 2 and args[1]: raise args[1] + if self.original_namespace: + self.namespace = self.original_namespace + def localize_path(self, profile_path): if (url := urllib.parse.urlparse(profile_path)).scheme and url.scheme in ('https', 'http'): if not self.converted_path: @@ -202,51 +205,14 @@ class Profile(Script): with open(self.path, 'r') as source: source_data = source.read() - # TODO: I imagine that there is probably a better way to write this. - return 'top_level_profile = True' in source_data - - @property - def packages(self) -> list: - """ - Returns a list of packages baked into the profile definition. - If no package definition has been done, .packages() will return None. - """ - with open(self.path, 'r') as source: - source_data = source.read() - - # Some crude safety checks, make sure the imported profile has - # a __name__ check before importing. - # - # If the requirements are met, import with .py in the namespace to not - # trigger a traditional: - # if __name__ == 'moduleName' - if '__name__' in source_data and '__packages__' in source_data: - with self.load_instructions(namespace=f"{self.namespace}.py") as imported: - if hasattr(imported, '__packages__'): - return imported.__packages__ - return None - - - def has_post_install(self): - with open(self.path, 'r') as source: - source_data = source.read() - - # Some crude safety checks, make sure the imported profile has - # a __name__ check and if so, check if it's got a _prep_function() - # we can call to ask for more user input. - # - # If the requirements are met, import with .py in the namespace to not - # trigger a traditional: - # if __name__ == 'moduleName' - if '__name__' in source_data and '_post_install' in source_data: + if '__name__' in source_data and 'is_top_level_profile' in source_data: with self.load_instructions(namespace=f"{self.namespace}.py") as imported: - if hasattr(imported, '_post_install'): - return True + if hasattr(imported, 'is_top_level_profile'): + return imported.is_top_level_profile - def is_top_level_profile(self): - with open(self.path, 'r') as source: - source_data = source.read() - return 'top_level_profile = True' in source_data + # Default to True if nothing is specified, + # since developers like less code - omitting it should assume they want to present it. + return True @property def packages(self) -> list: @@ -268,7 +234,6 @@ class Profile(Script): if hasattr(imported, '__packages__'): return imported.__packages__ return None - class Application(Profile): def __repr__(self, *args, **kwargs): diff --git a/examples/guided.py b/examples/guided.py index 2b8a06f5..c281d033 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -136,12 +136,14 @@ def ask_user_questions(): archinstall.log('Using existing partition table reported above.') elif option == 'format-all': - archinstall.arguments['filesystem'] = archinstall.ask_for_main_filesystem_format() + if not archinstall.arguments.get('filesystem', None): + archinstall.arguments['filesystem'] = archinstall.ask_for_main_filesystem_format() archinstall.arguments['harddrive'].keep_partitions = False elif archinstall.arguments['harddrive']: # If the drive doesn't have any partitions, safely mark the disk with keep_partitions = False # and ask the user for a root filesystem. - archinstall.arguments['filesystem'] = archinstall.ask_for_main_filesystem_format() + if not archinstall.arguments.get('filesystem', None): + archinstall.arguments['filesystem'] = archinstall.ask_for_main_filesystem_format() archinstall.arguments['harddrive'].keep_partitions = False # Get disk encryption password (or skip if blank) diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index 442e053c..a3347760 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -4,6 +4,11 @@ import urllib.request __packages__ = ['nano', 'wget', 'git'] +if __name__ == '52-54-00-12-34-56': + awesome = archinstall.Application(installation, 'postgresql') + awesome.install() + +""" # Unmount and close previous runs (Mainly only used for re-runs, but won't hurt.) archinstall.sys_command(f'umount -R /mnt', suppress_errors=True) archinstall.sys_command(f'cryptsetup close /dev/mapper/luksloop', suppress_errors=True) @@ -51,4 +56,5 @@ with archinstall.Filesystem(harddrive) as fs: try: urllib.request.urlopen(req, timeout=5) except: - pass \ No newline at end of file + pass +""" \ No newline at end of file diff --git a/profiles/applications/postgresql.py b/profiles/applications/postgresql.py new file mode 100644 index 00000000..fcdce824 --- /dev/null +++ b/profiles/applications/postgresql.py @@ -0,0 +1,11 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["postgresql"] + +installation.add_additional_packages(__packages__) + +installation.arch_chroot("initdb -D /var/lib/postgres/data", runas='postgres') + +installation.enable_service('postgresql') \ No newline at end of file -- cgit v1.2.3-70-g09d2 From f7cb4c8fb9b5fbb8789ba988d77d2a58a70634c1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 07:33:46 -0400 Subject: Add MariaDB Application Profile (#386) --- profiles/applications/mariadb.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 profiles/applications/mariadb.py (limited to 'profiles') diff --git a/profiles/applications/mariadb.py b/profiles/applications/mariadb.py new file mode 100644 index 00000000..e458a45a --- /dev/null +++ b/profiles/applications/mariadb.py @@ -0,0 +1,11 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["mariadb"] + +installation.add_additional_packages(__packages__) + +installation.arch_chroot("mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql") + +installation.enable_service('mariadb') -- cgit v1.2.3-70-g09d2 From c3bb503fab0cca1b5eb92a13b9aac40c4686141e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 08:01:15 -0400 Subject: Add SSH Server Application Profile --- profiles/applications/sshd.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/sshd.py (limited to 'profiles') diff --git a/profiles/applications/sshd.py b/profiles/applications/sshd.py new file mode 100644 index 00000000..234638d5 --- /dev/null +++ b/profiles/applications/sshd.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["openssh"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('sshd') -- cgit v1.2.3-70-g09d2 From 3c5dd7b335f0618046bacc03900a4b8b354309cd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 08:08:15 -0400 Subject: First implementation of server top-level profile --- profiles/server.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 profiles/server.py (limited to 'profiles') diff --git a/profiles/server.py b/profiles/server.py new file mode 100644 index 00000000..fcb33ee8 --- /dev/null +++ b/profiles/server.py @@ -0,0 +1,30 @@ +# Used to select various server application profiles on top of a minimal installation. + +import archinstall, os, logging + +is_top_level_profile = True + +available_servers = ["docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] + +def _prep_function(*args, **kwargs): + """ + Magic function called by the importing installer + before continuing any further. + """ + selected_servers = archinstall.generic_multi_select(available_servers, f"Choose which servers to install and enable (leave blank for a minimal installation): ") + archinstall.storage['_selected_servers'] = selected_servers + + return True # Do nothing and just return True + +if __name__ == 'server': + """ + This "profile" is a meta-profile. + """ + archinstall.log(f'Now installing the selected servers.', level=logging.INFO) + archinstall.log(archinstall.storage['_selected_servers'], level=logging.DEBUG) + for server in archinstall.storage['_selected_servers']: + archinstall.log(f'Installing {server} ...', level=logging.INFO) + app = archinstall.Application(installation, server) + app.install() + + archinstall.log('If your selections included multiple servers with the same port, you may have to reconfigure them.', fg="yellow", level=logging.INFO) -- cgit v1.2.3-70-g09d2 From 5e567b6f3b1372e97bd97b7461b39db528c5a843 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Thu, 29 Apr 2021 10:39:01 -0400 Subject: Remove a comment --- profiles/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/server.py b/profiles/server.py index fcb33ee8..fab4e7cf 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -14,7 +14,7 @@ def _prep_function(*args, **kwargs): selected_servers = archinstall.generic_multi_select(available_servers, f"Choose which servers to install and enable (leave blank for a minimal installation): ") archinstall.storage['_selected_servers'] = selected_servers - return True # Do nothing and just return True + return True if __name__ == 'server': """ -- cgit v1.2.3-70-g09d2 From 89bc10ad9a7a546b2a4dcb0cde87cc27f0005a2b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 11:11:26 -0400 Subject: Add cockpit application package --- profiles/applications/cockpit.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 profiles/applications/cockpit.py (limited to 'profiles') diff --git a/profiles/applications/cockpit.py b/profiles/applications/cockpit.py new file mode 100644 index 00000000..f1cea1d2 --- /dev/null +++ b/profiles/applications/cockpit.py @@ -0,0 +1,9 @@ +import archinstall + +# Define the package list in order for lib to source +# which packages will be installed by this profile +__packages__ = ["cockpit", "udisks2", "packagekit"] + +installation.add_additional_packages(__packages__) + +installation.enable_service('cockpit.socket') -- cgit v1.2.3-70-g09d2 From af3d85dc7d2ff86531766b9b819009e0c1a659c1 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 11:41:57 -0400 Subject: Add cockpit, depends on #396 --- profiles/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/server.py b/profiles/server.py index fab4e7cf..9d28054d 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -4,7 +4,7 @@ import archinstall, os, logging is_top_level_profile = True -available_servers = ["docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] +available_servers = ["cockpit", "docker", "httpd", "lighttpd", "mariadb", "nginx", "postgresql", "sshd", "tomcat"] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2 From cef3a3a792a492fa91e464c8dd6d9323546e4e8d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 29 Apr 2021 12:11:23 -0400 Subject: Fix i3 --- profiles/i3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/i3.py b/profiles/i3.py index 4d400468..e2db5fc7 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -60,4 +60,4 @@ if __name__ == 'i3': installation.enable_service('lightdm') # install the i3 group now - installation.add_additional_packages(installation, archinstall.storage['_i3_configuration']) \ No newline at end of file + installation.add_additional_packages(archinstall.storage['_i3_configuration']) -- cgit v1.2.3-70-g09d2 From d27fe9715f357d0a3d98ed166f480d27de3e920f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 1 May 2021 09:28:42 -0400 Subject: Attempt to fix #406 I think this should fix the comment Torxed made --- profiles/sway.py | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'profiles') diff --git a/profiles/sway.py b/profiles/sway.py index db94ae2c..8e256a87 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -4,7 +4,19 @@ import archinstall is_top_level_profile = False -__packages__ = ["sway", "swaylock", "swayidle", "waybar", "dmenu", "light", "grim", "slurp", "pavucontrol", "alacritty"] +__packages__ = [ + "sway", + "swaylock", + "swayidle", + "waybar", + "dmenu", + "light", + "grim", + "slurp", + "pavucontrol", + "alacritty", +] + def _prep_function(*args, **kwargs): """ @@ -13,18 +25,26 @@ def _prep_function(*args, **kwargs): other code in this stage. So it's a safe way to ask the user for more input before any other installer steps start. """ - if "nvidia" in _gfx_driver_packages: - choice = input("The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] ") - if choice.lower() in ("n", ""): - raise archinstall.lib.exceptions.HardwareIncompatibilityError("Sway does not support the proprietary nvidia drivers.") - - __builtins__['_gfx_driver_packages'] = archinstall.select_driver() + __builtins__["_gfx_driver_packages"] = archinstall.select_driver() return True + # Ensures that this code only gets executed if executed # through importlib.util.spec_from_file_location("sway", "/somewhere/sway.py") # or through conventional import sway -if __name__ == 'sway': +if __name__ == "sway": + if "nvidia" in _gfx_driver_packages: + choice = input( + "The proprietary Nvidia driver is not supported by Sway. It is likely that you will run into issues. Continue anyways? [y/N] " + ) + if choice.lower() in ("n", ""): + raise archinstall.lib.exceptions.HardwareIncompatibilityError( + "Sway does not support the proprietary nvidia drivers." + ) + # Install the Sway packages installation.add_additional_packages(__packages__) + + # Install the graphics driver packages + installation.add_additional_packages(_gfx_driver_packages) -- cgit v1.2.3-70-g09d2 From 3c23f5e810b095dbe1714ff1047709c7c8f237d3 Mon Sep 17 00:00:00 2001 From: Ondřej Nekola Date: Thu, 6 May 2021 13:01:43 +0200 Subject: add dmenu dependency to i3 profile dmenu is configured as the default launcher (Penguin-SPACE key) in the default i3 configuartion. --- profiles/i3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/i3.py b/profiles/i3.py index e2db5fc7..8492d36f 100644 --- a/profiles/i3.py +++ b/profiles/i3.py @@ -6,7 +6,7 @@ is_top_level_profile = False # New way of defining packages for a profile, which is iterable and can be used out side # of the profile to get a list of "what packages will be installed". -__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm'] +__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm', 'dmenu'] def _prep_function(*args, **kwargs): """ -- cgit v1.2.3-70-g09d2 From 69d079e63a00caf9268575a6ca4789962776761b Mon Sep 17 00:00:00 2001 From: advaithm Date: Wed, 12 May 2021 15:45:45 +0530 Subject: some type hint fixes and a bad catch fix --- .vscode/settings.json | 3 +++ archinstall/lib/disk.py | 5 +++-- archinstall/lib/general.py | 9 +++++---- archinstall/lib/hardware.py | 1 + archinstall/lib/output.py | 2 +- archinstall/lib/profiles.py | 5 +++-- examples/__init__.py | 0 profiles/__init__.py | 0 profiles/applications/__init__.py | 0 setup.py | 2 +- 10 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 examples/__init__.py create mode 100644 profiles/__init__.py create mode 100644 profiles/applications/__init__.py (limited to 'profiles') diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..d2a6c127 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python" +} \ No newline at end of file diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 44462a21..fd08ea63 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -1,3 +1,4 @@ +from typing import Optional import glob, re, os, json, time, hashlib import pathlib, traceback, logging from collections import OrderedDict @@ -205,7 +206,7 @@ class Partition(): return f'Partition(path={self.path}, size={self.size}, fs={self.filesystem}{mount_repr})' @property - def uuid(self) -> str: + def uuid(self) -> Optional[str]: """ Returns the PARTUUID as returned by lsblk. This is more reliable than relying on /dev/disk/by-partuuid as @@ -214,7 +215,7 @@ class Partition(): lsblk = b''.join(sys_command(f'lsblk -J -o+PARTUUID {self.path}')) for partition in json.loads(lsblk.decode('UTF-8'))['blockdevices']: return partition.get('partuuid', None) - + return None @property def encrypted(self): return self._encrypted diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index eb0c5d14..72f8677f 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -5,6 +5,7 @@ from subprocess import Popen, STDOUT, PIPE, check_output from select import epoll, EPOLLIN, EPOLLHUP from .exceptions import * from .output import log +from typing import Optional, Union def gen_uid(entropy_length=256): return hashlib.sha512(os.urandom(entropy_length)).hexdigest() @@ -160,16 +161,15 @@ class sys_command():#Thread): 'exit_code': self.exit_code } - def peak(self, output :str): + def peak(self, output : Union[str, bytes]) -> bool: if type(output) == bytes: try: output = output.decode('UTF-8') except UnicodeDecodeError: - return None - + return False output = output.strip('\r\n ') if len(output) <= 0: - return None + return False if self.peak_output: from .user_interaction import get_terminal_width @@ -191,6 +191,7 @@ class sys_command():#Thread): # And print the new output we're peaking on: sys.stdout.write(output) sys.stdout.flush() + return True def run(self): self.status = 'running' diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 185ec1d6..009a3a6c 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -91,6 +91,7 @@ def cpuVendor()-> Optional[str]: if info.get('field',None): if info.get('field',None) == "Vendor ID:": return info.get('data',None) + return None def isVM() -> bool: try: diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py index 06d99778..d6a197f1 100644 --- a/archinstall/lib/output.py +++ b/archinstall/lib/output.py @@ -19,7 +19,7 @@ class journald(dict): @abc.abstractmethod def log(message, level=logging.DEBUG): try: - import systemd.journal + import systemd.journal # type: ignore except ModuleNotFoundError: return False diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index 06237c1c..1feba1cd 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -1,3 +1,4 @@ +from typing import Optional import os, urllib.request, urllib.parse, ssl, json, re import importlib.util, sys, glob, hashlib, logging from collections import OrderedDict @@ -49,7 +50,7 @@ def list_profiles(filter_irrelevant_macs=True, subpath='', filter_top_level_prof except urllib.error.HTTPError as err: print(f'Error: Listing profiles on URL "{profiles_url}" resulted in:', err) return cache - except: + except json.decoder.JSONDecodeError as err: print(f'Error: Could not decode "{profiles_url}" result as JSON:', err) return cache @@ -215,7 +216,7 @@ class Profile(Script): return True @property - def packages(self) -> list: + def packages(self) -> Optional[list]: """ Returns a list of packages baked into the profile definition. If no package definition has been done, .packages() will return None. diff --git a/examples/__init__.py b/examples/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/profiles/__init__.py b/profiles/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/profiles/applications/__init__.py b/profiles/applications/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/setup.py b/setup.py index a4f49f92..8b95d978 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,2 @@ -import setuptools +import setuptools # type: ignore setuptools.setup() -- cgit v1.2.3-70-g09d2