index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds@gmail.com> | 2021-05-12 14:45:04 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds@gmail.com> | 2021-05-12 14:45:04 +0200 |
commit | 12dc55650d78dc41bbc0ab7013baa7b3ce61ec7c (patch) | |
tree | 945dd48af6c32e03f10aa14186149e92f2a120a1 /profiles | |
parent | 1708f1850d5d620e7a44ab4da4a9c5c028f5008b (diff) | |
parent | df6c4e77f721da2b03a510548d281992b25987b2 (diff) |
diff --git a/profiles/52-54-00-12-34-56.py b/profiles/52-54-00-12-34-56.py index ed2c9d78..a3347760 100644 --- a/profiles/52-54-00-12-34-56.py +++ b/profiles/52-54-00-12-34-56.py @@ -1,8 +1,14 @@ import archinstall import json import urllib.request -import git +__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) @@ -30,22 +36,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'), @@ -53,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/__init__.py b/profiles/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/profiles/__init__.py diff --git a/profiles/applications/__init__.py b/profiles/applications/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/profiles/applications/__init__.py 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/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') 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/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') 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/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') 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/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') 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/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') 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/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') 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 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') 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/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') 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 diff --git a/profiles/awesome.py b/profiles/awesome.py index cbd52a3c..a5dedccd 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', 'main', '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() 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 diff --git a/profiles/cinnamon.py b/profiles/cinnamon.py index 91a59811..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 @@ -27,8 +29,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..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): """ @@ -29,9 +30,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..77c90859 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 @@ -28,9 +31,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/i3.py b/profiles/i3.py index b82c03d6..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'] +__packages__ = ['i3lock', 'i3status', 'i3blocks', 'xterm', 'lightdm-gtk-greeter', 'lightdm', 'dmenu'] def _prep_function(*args, **kwargs): """ @@ -48,17 +48,16 @@ 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') # install the i3 group now - i3 = archinstall.Application(installation, archinstall.storage['_i3_configuration']) - i3.install() + installation.add_additional_packages(archinstall.storage['_i3_configuration']) diff --git a/profiles/kde.py b/profiles/kde.py index 6654dfa7..c8efdcde 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", "egl-wayland"] + # TODO: Remove hard dependency of bash (due to .bash_profile) def _prep_function(*args, **kwargs): @@ -37,9 +39,8 @@ if __name__ == 'kde': # Install dependency profiles installation.install_profile('xorg') - # Install the application kde from the template under /applications/ - kde = archinstall.Application(installation, 'kde') - kde.install() + # Install the KDE packages + installation.add_additional_packages(__packages__) # Enable autostart of KDE for all users installation.enable_service('sddm') diff --git a/profiles/lxqt.py b/profiles/lxqt.py index 871488ee..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 @@ -28,8 +30,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..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 @@ -27,8 +29,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/server.py b/profiles/server.py new file mode 100644 index 00000000..9d28054d --- /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 = ["cockpit", "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 + +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) diff --git a/profiles/sway.py b/profiles/sway.py index c3a6e31a..8e256a87 100644 --- a/profiles/sway.py +++ b/profiles/sway.py @@ -4,6 +4,20 @@ 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 @@ -11,19 +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': - # Install the application sway from the template under /applications/ - sway = archinstall.Application(installation, 'sway') - sway.install() +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) diff --git a/profiles/xfce4.py b/profiles/xfce4.py index fee8c37a..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 @@ -28,8 +30,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 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 |