Compare commits
	
		
			74 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 4739509ac7 | |||
| 2d8d60c0bc | |||
| 04363a50bb | |||
| f1368b1aa7 | |||
| 51ef407331 | |||
| 33d9fd2da3 | |||
| 56f1455c77 | |||
| 5b35f20375 | |||
| 730908dc51 | |||
| 9672ce5b46 | |||
| 9cf651405e | |||
| 65c79b931c | |||
| 19fae52dc0 | |||
| 1f62798998 | |||
| 231acc723b | |||
| dafee38770 | |||
| 91f8c5d64a | |||
| 0bff2c5715 | |||
| 88ebe2ee63 | |||
| d253e889c5 | |||
| 71cb6715a5 | |||
| a4c443b658 | |||
| a1c122c058 | |||
| bea63084ab | |||
| 83b9a674a8 | |||
| 26ffee5d7c | |||
| 8c3a81d0ee | |||
| 91b23a5265 | |||
| aa58c995eb | |||
| 68b91bc6ec | |||
| e3c3b5d9a5 | |||
| edaf1d8c0b | |||
| 3d97503604 | |||
| e9e2ec9d9e | |||
| 320dc22775 | |||
| 759f8236f1 | |||
| 51017c4789 | |||
| 9fafba1f67 | |||
| 1bb3f828fe | |||
| 76618b8ffe | |||
| b0accd6320 | |||
| 186c4cc944 | |||
| 36b3def4df | |||
| bff662b2bb | |||
| 6a830fd09e | |||
| 53738530d9 | |||
| 2008d08da2 | |||
| f1a229a2b2 | |||
| 8163c1574f | |||
| 61bc0ee372 | |||
| dd34bf3df9 | |||
| 36614abf6a | |||
| 96cc41dcde | |||
| b2d2877df9 | |||
| d051f3f73b | |||
| 90bb86cec1 | |||
| e9e0e0be8f | |||
| 82e6b1edea | |||
| bea5c4dfd6 | |||
| a3751e733b | |||
| 88cae232da | |||
| 3861ade296 | |||
| 20401b1e4f | |||
| a5920b81da | |||
| 5a1bddf043 | |||
| c24367f987 | |||
| 0ccfdbfc21 | |||
| c30cd6999b | |||
| e5b37014d0 | |||
| 96ae6855ac | |||
| 22014421b1 | |||
| ccebe7ecf3 | |||
| 7557a84a7d | |||
| 712774d585 | 
							
								
								
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| BSD 2-Clause License | ||||
|  | ||||
| Copyright (c) 2017, Cromnix GNU/Linux | ||||
| Copyright (c) 2018-2021, Artix Linux | ||||
| All rights reserved. | ||||
|  | ||||
| Redistribution and use in source and binary forms, with or without | ||||
|   | ||||
							
								
								
									
										139
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										139
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,29 +1,30 @@ | ||||
| VERSION = 0.5 | ||||
| VERSION = 0.13.3 | ||||
|  | ||||
| PKG = live-services | ||||
| TOOLS = artools | ||||
|  | ||||
| SYSCONFDIR = /etc | ||||
| ifdef PREFIX | ||||
| PREFIX = /usr/local | ||||
| endif | ||||
| PREFIX ?= /usr | ||||
| BINDIR = $(PREFIX)/bin | ||||
| LIBDIR = $(PREFIX)/lib | ||||
| DATADIR = $(PREFIX)/share | ||||
| SYSUSERSDIR = $(PREFIX)/lib/sysusers.d | ||||
| LIVEUSER ?= artix | ||||
|  | ||||
| HOOKSDIR = $(DATADIR)/libalpm/hooks | ||||
| SCRIPTSDIR = $(DATADIR)/libalpm/scripts | ||||
|  | ||||
| FMODE = -m0644 | ||||
| DMODE = -dm0755 | ||||
| BMODE = -m0755 | ||||
| RM = rm -f | ||||
| M4 = m4 -P | ||||
| CHAW = chmod a-w | ||||
| CHX = chmod +x | ||||
|  | ||||
|  | ||||
| ALPMSCRIPTS = $(wildcard libalpm/scripts/*) | ||||
| ALPMHOOKS = $(wildcard libalpm/hooks/*) | ||||
|  | ||||
| BIN = \ | ||||
| 	bin/artix-live | ||||
|  | ||||
| LIBS = $(wildcard lib/*.sh) | ||||
|  | ||||
| SHARED = \ | ||||
| 	$(wildcard data/*.map) \ | ||||
| 	data/live.conf | ||||
| @@ -39,38 +40,77 @@ RUNIT_SVD = \ | ||||
| RUNIT_SV = \ | ||||
| 	data/runit/pacman-init.run | ||||
|  | ||||
| GRUB_DEFAULT = \ | ||||
| 	data/grub2-portable-efi | ||||
| S6_LIVE = \ | ||||
| 	data/s6/artix-live/up \ | ||||
| 	data/s6/artix-live/type | ||||
|  | ||||
| GRUB_D = \ | ||||
| 	data/99_zzz-portable-efi | ||||
| S6_PI = \ | ||||
| 	data/s6/pacman-init/type \ | ||||
| 	data/s6/pacman-init/up \ | ||||
| 	data/s6/pacman-init/down | ||||
|  | ||||
| all: $(BIN) $(RC) $(RUNIT_SV) $(XBIN) $(GRUB_D) | ||||
| 66_LIVE = \ | ||||
| 	data/66/artix-live | ||||
|  | ||||
| EDIT = sed -e "s|@datadir[@]|$(DATADIR)/$(TOOLS)|g" \ | ||||
| 	-e "s|@sysconfdir[@]|$(SYSCONFDIR)/$(TOOLS)|g" \ | ||||
| 	-e "s|@libdir[@]|$(LIBDIR)/$(TOOLS)|g" | ||||
| 66_PI = \ | ||||
| 	data/66/pacman-init | ||||
|  | ||||
| %: %.in Makefile | ||||
| DINIT_LIVE = \ | ||||
| 	data/dinit/artix-live | ||||
|  | ||||
| DINIT_PI = \ | ||||
| 	data/dinit/pacman-init | ||||
|  | ||||
| DINIT_PI_SCRIPT = \ | ||||
| 	data/dinit/pacman-init.script | ||||
|  | ||||
| XDG = $(wildcard data/*.desktop) | ||||
|  | ||||
| XBIN = bin/desktop-items | ||||
|  | ||||
| SYSUSERS = \ | ||||
| 	data/sysusers | ||||
|  | ||||
| RM = rm -f | ||||
| M4 = m4 -P | ||||
| CHMODAW = chmod a-w | ||||
| CHMODX = chmod +x | ||||
|  | ||||
| all: $(BIN) $(SYSUSERS) $(XBIN) $(RC) $(RUNIT_SVD) $(S6_PI) $(S6_LIVE) | ||||
|  | ||||
| EDIT = sed -e "s|@datadir[@]|$(DATADIR)|g" \ | ||||
| 	-e "s|@sysconfdir[@]|$(SYSCONFDIR)|g" \ | ||||
| 	-e "s|@bindir[@]|$(BINDIR)|g" \ | ||||
| 	-e "s|@libdir[@]|$(LIBDIR)|g" \ | ||||
| 	-e "s|@live[@]|$(LIVEUSER)|g" | ||||
|  | ||||
| %: %.in Makefile lib/util-live.sh | ||||
| 	@echo "GEN $@" | ||||
| 	@$(RM) "$@" | ||||
| 	@$(M4) $@.in | $(EDIT) >$@ | ||||
| 	@$(CHAW) "$@" | ||||
| 	@$(CHX) "$@" | ||||
| 	@{ echo -n 'm4_changequote([[[,]]])'; cat $@.in; } | $(M4) | $(EDIT) >$@ | ||||
| 	@$(CHMODAW) "$@" | ||||
| 	@$(CHMODX) "$@" | ||||
| 	@bash -O extglob -n "$@" | ||||
|  | ||||
| clean: | ||||
| 	$(RM) $(BIN) $(RC) $(GRUB_D) | ||||
| 	$(RM) $(BIN) $(SYSUSERS) $(XBIN) $(RC) $(RUNIT_SVD) $(S6_PI) $(S6_LIVE) | ||||
|  | ||||
| install_base: | ||||
| 	install $(DMODE) $(DESTDIR)$(BINDIR) | ||||
| 	install $(BMODE) $(BIN) $(DESTDIR)$(BINDIR) | ||||
|  | ||||
| 	install $(DMODE) $(DESTDIR)$(LIBDIR)/$(TOOLS) | ||||
| 	install $(FMODE) $(LIBS) $(DESTDIR)$(LIBDIR)/$(TOOLS) | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSUSERSDIR) | ||||
| 	install $(FMODE) $(SYSUSERS) $(DESTDIR)$(SYSUSERSDIR)/live-artix.conf | ||||
|  | ||||
| 	install $(DMODE) $(DESTDIR)$(DATADIR)/$(TOOLS) | ||||
| 	install $(FMODE) $(SHARED) $(DESTDIR)$(DATADIR)/$(TOOLS) | ||||
|  | ||||
| install_alpm: | ||||
| 	install $(DMODE) $(DESTDIR)$(SCRIPTSDIR) | ||||
| 	install $(DMODE) $(DESTDIR)$(HOOKSDIR) | ||||
| 	install $(BMODE) $(ALPMSCRIPTS) $(DESTDIR)$(SCRIPTSDIR) | ||||
| 	install $(FMODE) $(ALPMHOOKS) $(DESTDIR)$(HOOKSDIR) | ||||
|  | ||||
| install_rc: | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/init.d | ||||
| 	install $(BMODE) $(RC) $(DESTDIR)$(SYSCONFDIR)/init.d | ||||
| @@ -79,40 +119,43 @@ install_runit: | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/rc/sysinit | ||||
| 	install $(DMODE) $(DESTDIR)$(LIBDIR)/rc/sv.d | ||||
|  | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init | ||||
| 	install $(BMODE) $(RUNIT_SVD) $(DESTDIR)$(LIBDIR)/rc/sv.d | ||||
| 	ln -sf $(LIBDIR)/rc/sv.d/live $(DESTDIR)$(SYSCONFDIR)/rc/sysinit/98-live | ||||
|  | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init | ||||
| 	install $(BMODE) $(RUNIT_SV) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init/run | ||||
|  | ||||
| install_portable_efi: | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/default | ||||
| 	install $(BMODE) $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default | ||||
| install_s6: install_alpm | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv | ||||
|  | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/grub.d | ||||
| 	install $(BMODE) $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/pacman-init | ||||
| 	install $(BMODE) $(S6_PI) $(DESTDIR)$(SYSCONFDIR)/s6/sv/pacman-init/ | ||||
|  | ||||
| uninstall_base: | ||||
| 	for f in $(notdir $(BIN)); do $(RM) $(DESTDIR)$(BINDIR)/$$f; done | ||||
| 	for f in $(notdir $(SHARED)); do $(RM) $(DESTDIR)$(DATADIR)/$(TOOLS)/$$f; done | ||||
| 	for f in $(notdir $(LIBS)); do $(RM) $(DESTDIR)$(LIBDIR)/$(TOOLS)/$$f; done | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live | ||||
| 	install $(BMODE) $(S6_LIVE) $(DESTDIR)$(SYSCONFDIR)/s6/sv/artix-live/ | ||||
|  | ||||
| uninstall_portable_efi: | ||||
| 	for f in $(notdir $(GRUB_DEFAULT)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/default/$$f; done | ||||
| 	for f in $(notdir $(GRUB_D)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/grub.d/$$f; done | ||||
| install_66: install_alpm | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/66/service | ||||
|  | ||||
| uninstall_rc: | ||||
| 	for f in $(notdir $(RC)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done | ||||
| 	install $(FMODE) $(66_LIVE) $(DESTDIR)$(SYSCONFDIR)/66/service/artix-live | ||||
| 	install $(FMODE) $(66_PI) $(DESTDIR)$(SYSCONFDIR)/66/service/pacman-init | ||||
|  | ||||
| uninstall_runit: | ||||
| 	for f in $(notdir $(RUNIT_SV)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/runit/sv/$$f; done | ||||
| install_dinit: | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts | ||||
| 	install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d | ||||
| 	install $(FMODE) $(DINIT_LIVE) $(DESTDIR)$(SYSCONFDIR)/dinit.d/artix-live | ||||
| 	install $(FMODE) $(DINIT_PI) $(DESTDIR)$(SYSCONFDIR)/dinit.d/pacman-init | ||||
| 	install $(BMODE) $(DINIT_PI_SCRIPT) $(DESTDIR)$(SYSCONFDIR)/dinit.d/scripts/pacman-init | ||||
| 	ln -s ../artix-live $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d | ||||
| 	ln -s ../pacman-init $(DESTDIR)$(SYSCONFDIR)/dinit.d/live.d | ||||
|  | ||||
| install: install_base install_rc install_portable_efi | ||||
| install_xdg: | ||||
| 	install -dm0755 $(DESTDIR)$(PREFIX)/bin | ||||
| 	install -m0755 ${XBIN} $(DESTDIR)$(PREFIX)/bin | ||||
|  | ||||
| uninstall: uninstall_base uninstall_rc uninstall_runit uninstall_portable_efi | ||||
| 	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart | ||||
| 	install -m0755 ${XDG} $(DESTDIR)$(SYSCONFDIR)/skel/.config/autostart | ||||
|  | ||||
| dist: | ||||
| 	git archive --format=tar --prefix=$(PKG)-$(VERSION)/ $(VERSION) | gzip -9 > $(PKG)-$(VERSION).tar.gz | ||||
| 	gpg --detach-sign --use-agent $(PKG)-$(VERSION).tar.gz | ||||
| install: install_base install_rc install_runit install_s6 install_xdg | ||||
|  | ||||
| .PHONY: all clean install uninstall dist | ||||
| .PHONY: install | ||||
|   | ||||
| @@ -1,62 +1,23 @@ | ||||
| #!/bin/sh | ||||
| #!/bin/bash | ||||
|  | ||||
| m4_include(lib/util-live.sh) | ||||
|  | ||||
| LIBDIR='@libdir@' | ||||
| DATADIR='@datadir@' | ||||
| SYSCONFDIR='@sysconfdir@' | ||||
| LOGFILE='/var/log/artix-live.log' | ||||
|  | ||||
| export LC_MESSAGES=C | ||||
| export LANG=C | ||||
|  | ||||
| livetimer=$(date +%s%3N) | ||||
|  | ||||
| [[ -r ${LIBDIR}/util-live.sh ]] && source ${LIBDIR}/util-live.sh | ||||
|  | ||||
| load_live_config "${SYSCONFDIR}/live.conf" || load_live_config "${DATADIR}/live.conf" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| detect_desktop_env | ||||
| echo "Detected ${default_desktop_executable} ${default_desktop_file}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| CONSOLEFONT="$(kernel_cmdline vconsole.font)" | ||||
| CONSOLEMAP="$(kernel_cmdline vconsole.font.map)" | ||||
| arch=$(uname -m) | ||||
| echo "Got consolefont and arch $arch: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
| #echo "Got consolefont ${CONSOLEFONT} and consolemap ${CONSOLEMAP}" >> "${LOGFILE}" | ||||
|  | ||||
| # Activate swap | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_swap | ||||
| echo "Activated swap and added to fstab: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_language | ||||
| echo "Finished localization: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_user | ||||
| echo "Created user ${username} with password ${password}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_sudoers_d | ||||
| echo "Configured sudoers: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
| detect_desktop_env | ||||
|  | ||||
| # livetimer=$(get_timer_ms) | ||||
| # configure_machine_id | ||||
| # echo "Configured machine-id: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
| configure_accountsservice | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_accountsservice "${username}" | ||||
| echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_displaymanager | ||||
| echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| # livetimer=$(get_timer_ms) | ||||
| # configure_calamares | ||||
| # echo "Configured calamares netinstall ${netinstall} $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
| livetimer=$(get_timer_ms) | ||||
| configure_user_root / | ||||
| echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
| configure_branding | ||||
|   | ||||
							
								
								
									
										39
									
								
								bin/desktop-items.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								bin/desktop-items.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # Ensure the user directories are created, some DEs (MATE) | ||||
| # create them after autostart scripts are run | ||||
| xdg-user-dirs-update --force | ||||
|  | ||||
| xdg=$(xdg-user-dir DESKTOP) | ||||
| src=@datadir@/applications | ||||
|  | ||||
| # if [[ -f $src/org.kde.konversation.desktop ]]; then | ||||
| #     install -m644 $src/org.kde.konversation.desktop \ | ||||
| #     $xdg/org.kde.konversation.desktop | ||||
| # fi | ||||
|  | ||||
| if [[ -f @bindir@/calamares ]]; then | ||||
|     cp -f $src/calamares.desktop "$xdg/" | ||||
|     sed -i s/Icon.*=calamares/Icon=artixlinux-logo/g "$xdg"/calamares.desktop | ||||
|     chmod +x "$xdg/calamares.desktop" | ||||
| fi | ||||
|  | ||||
| docs=@datadir@/doc/artix | ||||
|  | ||||
| for f in {Configuration,Troubleshooting}.pdf; do | ||||
|     ln -s $docs/$f "$xdg"/$f | ||||
| done | ||||
|  | ||||
| if [[ -d /run/openrc ]]; then | ||||
|     ln -s $docs/OpenRC.pdf "$xdg"/OpenRC.pdf | ||||
| elif [[ -d /run/runit ]]; then | ||||
|     ln -s $docs/Runit.pdf "$xdg"/Runit.pdf | ||||
| elif [[ -d /run/66 ]]; then | ||||
|     ln -s $docs/Suite66.pdf "$xdg"/Suite66.pdf | ||||
| elif [[ -d /run/dinit ]]; then | ||||
|     ln -s $docs/Dinit.pdf "$xdg"/Dinit.pdf | ||||
| else | ||||
|     ln -s $docs/S6.pdf "$xdg"/S6.pdf | ||||
| fi | ||||
|  | ||||
| echo "live session details: /var/log/artix-live.log" > "$xdg"/README.txt | ||||
							
								
								
									
										8
									
								
								data/66/artix-live
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								data/66/artix-live
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| [main] | ||||
| @type = oneshot | ||||
| @version = 0.0.1 | ||||
| @description = "artix-live service" | ||||
| @user = ( root ) | ||||
|  | ||||
| [start] | ||||
| @execute = (artix-live) | ||||
							
								
								
									
										13
									
								
								data/66/pacman-init
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								data/66/pacman-init
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| [main] | ||||
| @type = oneshot | ||||
| @description = "pacman init service" | ||||
| @version = 0.0.2 | ||||
| @user = ( root ) | ||||
| @extdepends = ( haveged ) | ||||
|  | ||||
| [start] | ||||
| @execute = ( | ||||
| foreground { mkdir -p /etc/pacman.d/gnupg } | ||||
| foreground { mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg } | ||||
| foreground { pacman-key --init } | ||||
| foreground { pacman-key --populate artix } ) | ||||
| @@ -1,49 +0,0 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| # grub-mkconfig helper script. | ||||
| # | ||||
| # Copyright © 2014 Niall Walsh <niallwalsh@celtux.org> | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or | ||||
| # modify it under the terms of the GNU General Public License | ||||
| # as published by the Free Software Foundation; either version 2 | ||||
| # of the License, or (at your option) any later version. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
|  | ||||
| set -e | ||||
|  | ||||
| AT_EFI_STANDALONE="" | ||||
| AT_EFI_PORTABLE_PATH="/boot/efi/EFI/BOOT" | ||||
|  | ||||
| # override tool behaviour through /etc/default/grub2-fll-standalone | ||||
| if [ -r /etc/default/grub2-portable-efi ]; then | ||||
| 	. /etc/default/grub2-portable-efi | ||||
| fi | ||||
|  | ||||
| patt='[[:space:]]-o[[:space:]]\+/boot/grub/grub.cfg' | ||||
| # do nothing if disabled or grub-mkconfig is generating /boot/grub/grub.cfg | ||||
| ( [ "${AT_EFI_STANDALONE}" != "disable" ] && \ | ||||
| 	ps x | grep 'grub-mkconfig[[:space:]]' | grep -q -e "${patt}[[:space:]]" -e "${patt}$" ) || exit | ||||
|  | ||||
| beeb="${AT_EFI_PORTABLE_PATH}" | ||||
| if [ -e "${beeb}" ]; then | ||||
| 	# do not do anything to a beeb we didn't create | ||||
| 	[ ! -e "${beeb}/fullstory" ] && exit | ||||
| else | ||||
| 	# create beeb and mark it as ours | ||||
| 	mkdir -p "${beeb}" | ||||
| 	touch "${beeb}/fullstory" | ||||
| fi | ||||
|  | ||||
| for platform in i386-efi x86_64-efi ; do | ||||
| 	filename="bootx64" | ||||
| 	[ "${platform}" = "i386-efi" ] && filename="bootia32" | ||||
| 	[ -e /usr/lib/grub/${platform} ] && grub-mkstandalone \ | ||||
| 		-o ${beeb}/${filename}.efi --compress=xz  -O ${platform} \ | ||||
| 		/boot/grub/grub.cfg=/boot/grub/grub.cfg.new 2>&1 > /dev/null | ||||
| done | ||||
|  | ||||
| @@ -4,15 +4,15 @@ jwm:jwm | ||||
| i3:i3 | ||||
| fluxbox:startfluxbox | ||||
| pekwm:pekwm | ||||
| plasma:startkde | ||||
| gnome:gnome-session | ||||
| xfce:startxfce4 | ||||
| cinnamon:cinnamon-session-cinnamon | ||||
| mate:mate-session | ||||
| enlightenment:enlightenment_start | ||||
| Lumina-DE:start-lumina-desktop | ||||
| LXDE:lxsession | ||||
| plasma:startplasma-x11 | ||||
| lxqt:lxqt-session | ||||
| pantheon:pantheon-session | ||||
| budgie-desktop:budgie-desktop | ||||
| deepin:startdde | ||||
| Lumina-DE:start-lumina-desktop | ||||
| mate:mate-session | ||||
| cinnamon:cinnamon-session-cinnamon | ||||
| xfce:startxfce4 | ||||
| gnome:gnome-session | ||||
|   | ||||
							
								
								
									
										4
									
								
								data/dinit/artix-live
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								data/dinit/artix-live
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| type      = scripted | ||||
| command   = /usr/bin/artix-live | ||||
| restart   = false | ||||
| waits-for = setup | ||||
							
								
								
									
										5
									
								
								data/dinit/pacman-init
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								data/dinit/pacman-init
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| type         = scripted | ||||
| command      = /etc/dinit.d/scripts/pacman-init | ||||
| stop-command = /usr/bin/umount -l /etc/pacman.d/gnupg | ||||
| restart      = false | ||||
| waits-for    = setup | ||||
							
								
								
									
										4
									
								
								data/dinit/pacman-init.script
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								data/dinit/pacman-init.script
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| #!/bin/sh | ||||
| /usr/bin/mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg | ||||
| /usr/bin/pacman-key --init | ||||
| /usr/bin/pacman-key --populate artix | ||||
| @@ -1,15 +0,0 @@ | ||||
| # Defaults for grub2-portable-efi update-grub helper | ||||
| # sourced by grub2's update-grub | ||||
| # installed at /etc/default/grub2-portable-efi by the maintainer scripts | ||||
|  | ||||
| # | ||||
| # This is a POSIX shell fragment | ||||
| # | ||||
|  | ||||
| # specify is this should be disabled (set to "disable") | ||||
| # default: | ||||
| #AT_EFI_STANDALONE="" | ||||
|  | ||||
| # specify where to install the portable efi | ||||
| # default: /boot/efi/EFI/BOOT | ||||
| #AT_EFI_PORTABLE_PATH="/boot/efi/EFI/BOOT" | ||||
| @@ -1,20 +1,7 @@ | ||||
| # live session configuration | ||||
|  | ||||
| # autologin | ||||
| autologin=true | ||||
|  | ||||
| # live username | ||||
| username=artix | ||||
| AUTOLOGIN=true | ||||
|  | ||||
| # live password | ||||
| password=artix | ||||
|  | ||||
| # live group membership | ||||
| addgroups='video,power,disk,storage,optical,network,lp,scanner,wheel' | ||||
|  | ||||
| # default_desktop_file | ||||
| default_desktop_file=lxqt | ||||
|  | ||||
| # default_desktop_executable | ||||
| default_desktop_executable=lxqt-session | ||||
|  | ||||
| PASSWORD=artix | ||||
|   | ||||
| @@ -1,15 +1,17 @@ | ||||
| #!/usr/bin/openrc-run | ||||
| # Copyright 2014 Aaditya Bagga (aaditya_gnulinux@zoho.com) | ||||
| # Copyright 2017-2021 The Artix Linux developers | ||||
| # Distributed under the terms of the GNU General Public License v2 | ||||
|  | ||||
| description="LiveMedia Config Script" | ||||
|  | ||||
| depend() { | ||||
|     need localmount | ||||
|     before display-manager ly | ||||
| } | ||||
|  | ||||
| start() { | ||||
| 	ebegin "Starting artix live script" | ||||
| 	/usr/bin/artix-live | ||||
| 	eend $? | ||||
|     ebegin "Starting artix live script" | ||||
|     /usr/bin/artix-live | ||||
|     eend $? | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| #!/usr/bin/openrc-run | ||||
| # Copyright 2015 artoo (artoo@cromnix.org) | ||||
| # Copyright 2019 artoo (artoo@artixlinux.org) | ||||
| # Distributed under the terms of the GNU General Public License v2 | ||||
|  | ||||
| target_dir=/etc/pacman.d/gnupg | ||||
|   | ||||
| @@ -12,6 +12,6 @@ depend() { | ||||
| start() { | ||||
| 	ebegin "Running pacman initialization" | ||||
| 	/usr/bin/pacman-key --init &> /dev/null | ||||
| 	/usr/bin/pacman-key --populate archlinux artix &> /dev/null | ||||
| 	/usr/bin/pacman-key --populate artix &> /dev/null | ||||
| 	eend $? | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| . /usr/lib/rc/functions | ||||
| . @libdir@/rc/functions | ||||
| 
 | ||||
| case "$1" in | ||||
|     start) | ||||
| @@ -1,5 +1,5 @@ | ||||
| #!/bin/sh | ||||
| mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg | ||||
| pacman-key --init 1>&2 | ||||
| pacman-key --populate archlinux artix 1>&2 | ||||
| pacman-key --populate artix 1>&2 | ||||
| exec chpst -b pacman-init pause | ||||
|   | ||||
							
								
								
									
										1
									
								
								data/s6/artix-live/type.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								data/s6/artix-live/type.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| oneshot | ||||
							
								
								
									
										2
									
								
								data/s6/artix-live/up.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								data/s6/artix-live/up.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| #!@bindir@/execlineb -P | ||||
| exec @bindir@/artix-live | ||||
							
								
								
									
										2
									
								
								data/s6/pacman-init/down.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								data/s6/pacman-init/down.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| #!@bindir@/execlineb -P | ||||
| umount -l /etc/pacman.d/gnupg | ||||
							
								
								
									
										1
									
								
								data/s6/pacman-init/type.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								data/s6/pacman-init/type.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| oneshot | ||||
							
								
								
									
										5
									
								
								data/s6/pacman-init/up.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								data/s6/pacman-init/up.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| #!@bindir@/execlineb -P | ||||
| foreground { mkdir -p /etc/pacman.d/gnupg } | ||||
| foreground { mount -t tmpfs -o size=10M,mode=0755 tmpfs /etc/pacman.d/gnupg } | ||||
| foreground { pacman-key --init } | ||||
| foreground { pacman-key --populate artix } | ||||
							
								
								
									
										12
									
								
								data/sysusers.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								data/sysusers.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # artix live user | ||||
| u @live@ 1000 - /home/@live@ /bin/bash | ||||
|  | ||||
| m @live@ video | ||||
| m @live@ power | ||||
| m @live@ cdrom | ||||
| m @live@ network | ||||
| m @live@ lp | ||||
| m @live@ scanner | ||||
| m @live@ wheel | ||||
| m @live@ log | ||||
| m @live@ users | ||||
							
								
								
									
										305
									
								
								lib/util-live.sh
									
									
									
									
									
								
							
							
						
						
									
										305
									
								
								lib/util-live.sh
									
									
									
									
									
								
							| @@ -1,19 +1,15 @@ | ||||
| #!/bin/bash | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; version 2 of the License. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
| #!/hint/bash | ||||
|  | ||||
| export LC_MESSAGES=C | ||||
| export LANG=C | ||||
|  | ||||
| # {{{ functions | ||||
|  | ||||
| kernel_cmdline(){ | ||||
|     for param in $(cat /proc/cmdline); do | ||||
|         case "${param}" in | ||||
|             $1=*) echo "${param##*=}"; return 0 ;; | ||||
|             $1) return 0 ;; | ||||
|             "$1") return 0 ;; | ||||
|             *) continue ;; | ||||
|         esac | ||||
|     done | ||||
| @@ -22,185 +18,131 @@ kernel_cmdline(){ | ||||
| } | ||||
|  | ||||
| get_lang(){ | ||||
|     echo $(kernel_cmdline lang) | ||||
|     kernel_cmdline lang | ||||
| } | ||||
|  | ||||
| get_keytable(){ | ||||
|     echo $(kernel_cmdline keytable) | ||||
|     kernel_cmdline keytable | ||||
| } | ||||
|  | ||||
| get_tz(){ | ||||
|     echo $(kernel_cmdline tz) | ||||
| } | ||||
|  | ||||
| get_cal_mode(){ | ||||
|     echo $(kernel_cmdline netinstall) | ||||
| } | ||||
|  | ||||
| get_timer_ms(){ | ||||
|     echo $(date +%s%3N) | ||||
| } | ||||
|  | ||||
| # $1: start timer | ||||
| elapsed_time_ms(){ | ||||
|     echo $(echo $1 $(get_timer_ms) | awk '{ printf "%0.3f",($2-$1)/1000 }') | ||||
| } | ||||
|  | ||||
| load_live_config(){ | ||||
|  | ||||
|     [[ -f $1 ]] || return 1 | ||||
|  | ||||
|     live_conf="$1" | ||||
|  | ||||
|     [[ -r ${live_conf} ]] && source ${live_conf} | ||||
|  | ||||
|     [[ -z ${autologin} ]] && autologin=true | ||||
|  | ||||
|     [[ -z ${username} ]] && username="artix" | ||||
|  | ||||
|     [[ -z ${password} ]] && password="artix" | ||||
|  | ||||
|     [[ -z ${addgroups} ]] && addgroups="video,power,storage,optical,network,lp,scanner,wheel,users,audio" | ||||
|  | ||||
|     echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}" | ||||
|  | ||||
|     return 0 | ||||
|     kernel_cmdline tz | ||||
| } | ||||
|  | ||||
| is_valid_de(){ | ||||
|     if [[ ${default_desktop_executable} != "none" ]] && \ | ||||
|     [[ ${default_desktop_file} != "none" ]]; then | ||||
|     if [[ ${DEFAULT_DESKTOP_EXECUTABLE} != "none" ]] && \ | ||||
|     [[ ${DEFAULT_DESKTOP_FILE} != "none" ]]; then | ||||
|         return 0 | ||||
|     else | ||||
|         return 1 | ||||
|     fi | ||||
| } | ||||
|  | ||||
| load_desktop_map(){ | ||||
|     local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \ | ||||
|         file=${DATADIR}/desktop.map | ||||
|     local desktop_map=$(sed "$_com_rm" "$file" | sed "$_space" | sed "$_clean") | ||||
|     echo ${desktop_map} | ||||
|     return 1 | ||||
| } | ||||
|  | ||||
| detect_desktop_env(){ | ||||
|     local xs=/usr/share/xsessions ex=/usr/bin key val map=( $(load_desktop_map) ) | ||||
|     default_desktop_file="none" | ||||
|     default_desktop_executable="none" | ||||
|     for item in "${map[@]}";do | ||||
|     local key val map | ||||
|     map="${DATADIR}"/artools/desktop.map | ||||
|     DEFAULT_DESKTOP_FILE="none" | ||||
|     DEFAULT_DESKTOP_EXECUTABLE="none" | ||||
|     while read -r item; do | ||||
|         key=${item%:*} | ||||
|         val=${item#*:} | ||||
|         if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then | ||||
|             default_desktop_file="$key" | ||||
|             default_desktop_executable="$val" | ||||
|         if [[ -f "${DATADIR}"/xsessions/$key.desktop ]] && [[ -f ${BINDIR}/$val ]];then | ||||
|             DEFAULT_DESKTOP_FILE="$key" | ||||
|             DEFAULT_DESKTOP_EXECUTABLE="$val" | ||||
|         fi | ||||
|     done | ||||
|     done < "$map" | ||||
|     echo "Detected ${DEFAULT_DESKTOP_EXECUTABLE} ${DEFAULT_DESKTOP_FILE}" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| configure_accountsservice(){ | ||||
|     local path=/var/lib/AccountsService/users | ||||
|     local path=/var/lib/AccountsService/users user="${1:-${LIVEUSER}}" | ||||
|     if [ -d "${path}" ] ; then | ||||
|         echo "[User]" > ${path}/$1 | ||||
|         echo "XSession=${default_desktop_file}" >> ${path}/$1 | ||||
|         if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then | ||||
|             echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1 | ||||
|         echo "[User]" > ${path}/"$user" | ||||
|         echo "XSession=${DEFAULT_DESKTOP_FILE}" >> ${path}/"$user" | ||||
|         if [[ -f "/var/lib/AccountsService/icons/$user.png" ]];then | ||||
|             echo "Icon=/var/lib/AccountsService/icons/$user.png" >> ${path}/"$user" | ||||
|         fi | ||||
|     fi | ||||
|     echo "Configured accountsservice" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
|  set_lightdm_greeter(){ | ||||
|     local greeters=$(ls /usr/share/xgreeters/*greeter.desktop) name | ||||
|     for g in ${greeters[@]};do | ||||
|     local name | ||||
|     for g in "${DATADIR}"/xgreeters/*.desktop;do | ||||
|         name=${g##*/} | ||||
|         name=${name%%.*} | ||||
|         case ${name} in | ||||
|             lightdm-gtk-greeter) break ;; | ||||
|             lightdm-*-greeter) | ||||
|                 sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" /etc/lightdm/lightdm.conf | ||||
|                 sed -e "s/^.*greeter-session=.*/greeter-session=${name}/" \ | ||||
|                     -i /etc/lightdm/lightdm.conf | ||||
|             ;; | ||||
|         esac | ||||
|     done | ||||
|  } | ||||
|  | ||||
|  set_lightdm_vt(){ | ||||
| 	sed -i -e 's/^.*minimum-vt=.*/minimum-vt=7/' /etc/lightdm/lightdm.conf | ||||
|  } | ||||
|  | ||||
| configure_displaymanager(){ | ||||
|     # Try to detect desktop environment | ||||
|     # Configure display manager | ||||
|     if [[ -f /usr/bin/lightdm ]];then | ||||
|  | ||||
|     if [[ -f "${BINDIR}"/lightdm ]];then | ||||
|         groupadd -r autologin | ||||
|         set_lightdm_vt | ||||
|         gpasswd -a "${LIVEUSER}" autologin &> /dev/null | ||||
|         set_lightdm_greeter | ||||
|         if $(is_valid_de); then | ||||
|                 sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" /etc/lightdm/lightdm.conf | ||||
|         if is_valid_de; then | ||||
|             sed -e "s/^.*user-session=.*/user-session=$DEFAULT_DESKTOP_FILE/" \ | ||||
|                 -e 's/^.*minimum-vt=.*/minimum-vt=7/' \ | ||||
|                 -i /etc/lightdm/lightdm.conf | ||||
|         fi | ||||
|         if ${autologin};then | ||||
|             gpasswd -a ${username} autologin &> /dev/null | ||||
|             sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf | ||||
|             sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf | ||||
|             sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf | ||||
|         fi | ||||
|     elif [[ -f /usr/bin/gdm ]];then | ||||
|         ${AUTOLOGIN} && sed -e "s/^.*autologin-user=.*/autologin-user=${LIVEUSER}/" \ | ||||
|                 -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" \ | ||||
|                 -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" \ | ||||
|                 -i /etc/lightdm/lightdm.conf | ||||
|     elif [[ -f "${BINDIR}"/gdm ]];then | ||||
|         configure_accountsservice "gdm" | ||||
|         if ${autologin};then | ||||
|             sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf | ||||
|         ${AUTOLOGIN} && sed -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${LIVEUSER}\nAutomaticLoginEnable=True/" \ | ||||
|                 -i /etc/gdm/custom.conf | ||||
|     elif [[ -f "${BINDIR}"/sddm ]];then | ||||
|         if is_valid_de; then | ||||
|             sed -e "s|^Session=.*|Session=$DEFAULT_DESKTOP_FILE.desktop|" \ | ||||
|                 -i /etc/sddm.conf | ||||
|         fi | ||||
|     elif [[ -f /usr/bin/sddm ]];then | ||||
|         if $(is_valid_de); then | ||||
|             sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf | ||||
|         fi | ||||
|         if ${autologin};then | ||||
|             sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf | ||||
|         fi | ||||
|     elif [[ -f /usr/bin/lxdm ]];then | ||||
|         if $(is_valid_de); then | ||||
|             sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf | ||||
|         fi | ||||
|         if ${autologin};then | ||||
|             sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf | ||||
|         ${AUTOLOGIN} && sed -e "s|^User=.*|User=${LIVEUSER}|" \ | ||||
|                 -i /etc/sddm.conf | ||||
|     elif [[ -f "${BINDIR}"/lxdm ]];then | ||||
|         if is_valid_de; then | ||||
|             sed -e "s|^.*session=.*|session=${BINDIR}/${DEFAULT_DESKTOP_EXECUTABLE}|" \ | ||||
|                 -i /etc/lxdm/lxdm.conf | ||||
|         fi | ||||
|         ${AUTOLOGIN} && sed -e "s/^.*autologin=.*/autologin=${LIVEUSER}/" \ | ||||
|                 -i /etc/lxdm/lxdm.conf | ||||
|     fi | ||||
| } | ||||
|  | ||||
| gen_pw(){ | ||||
|     echo $(perl -e 'print crypt($ARGV[0], "password")' ${password}) | ||||
| } | ||||
|  | ||||
| configure_user(){ | ||||
|     # set up user and password | ||||
|     if [[ -n ${password} ]];then | ||||
|             useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username} | ||||
|     else | ||||
|             useradd -m -G ${addgroups} -s /bin/bash ${username} | ||||
|     fi | ||||
|     echo "Configured displaymanager" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| find_legacy_keymap(){ | ||||
|     local file="${DATADIR}/kbd-model.map" | ||||
|     local file="${DATADIR}/artools/kbd-model.map" kt="$1" | ||||
|     while read -r line || [[ -n $line ]]; do | ||||
|         if [[ -z $line ]] || [[ $line == \#* ]]; then | ||||
|             continue | ||||
|         fi | ||||
|  | ||||
|         mapping=( $line ); # parses columns | ||||
|         local mapping=( "$line" ); # parses columns | ||||
|         if [[ ${#mapping[@]} != 5 ]]; then | ||||
|             continue | ||||
|         fi | ||||
|  | ||||
|         if  [[ "${keytable}" != "${mapping[0]}" ]]; then | ||||
|         if  [[ "$kt" != "${mapping[0]}" ]]; then | ||||
|             continue | ||||
|         fi | ||||
|  | ||||
|         if [[ "${mapping[3]}" = "-" ]]; then | ||||
|         if [[ "${mapping[3]}" == "-" ]]; then | ||||
|             mapping[3]="" | ||||
|         fi | ||||
|  | ||||
|         X11_LAYOUT=${mapping[1]} | ||||
|         X11_MODEL=${mapping[2]} | ||||
|         X11_VARIANT=${mapping[3]} | ||||
|         x11_OPTIONS=${mapping[4]} | ||||
|         X11_OPTIONS=${mapping[4]} | ||||
|     done < $file | ||||
| } | ||||
|  | ||||
| @@ -212,12 +154,13 @@ write_x11_config(){ | ||||
|     local X11_MODEL="pc105" | ||||
|     local X11_VARIANT="" | ||||
|     local X11_OPTIONS="terminate:ctrl_alt_bksp" | ||||
|     local kt="$1" | ||||
|  | ||||
|     find_legacy_keymap | ||||
|     find_legacy_keymap "$kt" | ||||
|  | ||||
|     # layout not found, use KBLAYOUT | ||||
|     if [[ -z "$X11_LAYOUT" ]]; then | ||||
|         X11_LAYOUT="${keytable}" | ||||
|         X11_LAYOUT="$kt" | ||||
|     fi | ||||
|  | ||||
|     # create X11 keyboard layout config | ||||
| @@ -225,74 +168,92 @@ write_x11_config(){ | ||||
|  | ||||
|     local XORGKBLAYOUT="/etc/X11/xorg.conf.d/00-keyboard.conf" | ||||
|  | ||||
|     echo "" >> "$XORGKBLAYOUT" | ||||
|     echo "Section \"InputClass\"" > "$XORGKBLAYOUT" | ||||
|     echo " Identifier \"system-keyboard\"" >> "$XORGKBLAYOUT" | ||||
|     echo " MatchIsKeyboard \"on\"" >> "$XORGKBLAYOUT" | ||||
|     echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" >> "$XORGKBLAYOUT" | ||||
|     echo " Option \"XkbModel\" \"$X11_MODEL\"" >> "$XORGKBLAYOUT" | ||||
|     echo " Option \"XkbVariant\" \"$X11_VARIANT\"" >> "$XORGKBLAYOUT" | ||||
|     echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" >> "$XORGKBLAYOUT" | ||||
|     echo "EndSection" >> "$XORGKBLAYOUT" | ||||
|     { | ||||
|     echo " Identifier \"system-keyboard\"" | ||||
|     echo " MatchIsKeyboard \"on\"" | ||||
|     echo " Option \"XkbLayout\" \"$X11_LAYOUT\"" | ||||
|     echo " Option \"XkbModel\" \"$X11_MODEL\"" | ||||
|     echo " Option \"XkbVariant\" \"$X11_VARIANT\"" | ||||
|     echo " Option \"XkbOptions\" \"$X11_OPTIONS\"" | ||||
|     echo "EndSection" | ||||
|     } >> "$XORGKBLAYOUT" | ||||
| } | ||||
|  | ||||
| configure_language(){ | ||||
|     # hack to be able to set the locale on bootup | ||||
|     local lang=$(get_lang) | ||||
|     local lang keytable timezone | ||||
|     lang=$(get_lang) | ||||
|     keytable=$(get_keytable) | ||||
|     local timezone=$(get_tz) | ||||
|     # Fallback | ||||
| #     [[ -z "${lang}" ]] && lang="en_US" | ||||
| #     [[ -z "${keytable}" ]] && keytable="us" | ||||
| #     [[ -z "${timezone}" ]] && timezone="Etc/UTC" | ||||
|     timezone=$(get_tz) | ||||
|  | ||||
|     sed -e "s/#${lang}.UTF-8/${lang}.UTF-8/" -i /etc/locale.gen | ||||
|  | ||||
|     # 	echo "LANG=${lang}.UTF-8" >> /etc/environment | ||||
|  | ||||
|     if [[ -d /run/openrc ]]; then | ||||
|         sed -i "s/keymap=.*/keymap=\"${keytable}\"/" /etc/conf.d/keymaps | ||||
|     fi | ||||
|     echo "KEYMAP=${keytable}" > /etc/vconsole.conf | ||||
|     echo "LANG=${lang}.UTF-8" > /etc/locale.conf | ||||
|     ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime | ||||
|     ln -sf "${DATADIR}"/zoneinfo/"${timezone}" /etc/localtime | ||||
|  | ||||
|     write_x11_config | ||||
|     write_x11_config "${keytable}" | ||||
|  | ||||
|     loadkeys "${keytable}" | ||||
|  | ||||
|     locale-gen ${lang} | ||||
|     echo "Configured language: ${lang}" >> "${LOGFILE}" | ||||
|     echo "Configured keymap: ${keytable}" >> "${LOGFILE}" | ||||
|     echo "Configured timezone: ${timezone}" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| configure_calamares(){ | ||||
|     if [[ -f /usr/bin/calamares ]];then | ||||
|         netinstall=$(get_cal_mode) | ||||
|         if [[ "${netinstall}" == 'no' ]];then | ||||
|             sed -e "/- netinstall/d" \ | ||||
|                 -e "s|- chrootcfg|- unpackfs|" -i /etc/calamares/settings.conf | ||||
|  | ||||
|             sed -e '$ d' -i /etc/calamares/modules/welcome.conf | ||||
|         fi | ||||
|     fi | ||||
| } | ||||
|  | ||||
| configure_sudoers_d(){ | ||||
|     echo "%wheel  ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel | ||||
|     echo "root ALL=(ALL) ALL"  > /etc/sudoers.d/u_root | ||||
|     locale-gen "${lang}" | ||||
|     { | ||||
|     echo "Configured language: ${lang}" | ||||
|     echo "Configured keymap: ${keytable}" | ||||
|     echo "Configured timezone: ${timezone}" | ||||
|     echo "Finished localization" | ||||
|     } >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| configure_swap(){ | ||||
|     local swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" | ||||
|     local swapdev | ||||
|     swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" | ||||
|     if [ -e "${swapdev}" ]; then | ||||
|         swapon ${swapdev} | ||||
|         swapon "${swapdev}" | ||||
|     fi | ||||
|     echo "Activated swap and added to fstab" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| configure_branding(){ | ||||
|     if [[ -f "${BINDIR}"/neofetch ]]; then | ||||
|         neofetch >| /etc/issue | ||||
|         echo "Configured branding" >> "${LOGFILE}" | ||||
|     fi | ||||
| } | ||||
|  | ||||
| configure_user_root(){ | ||||
|     # set up root password | ||||
|     echo "root:${password}" | chroot $1 chpasswd | ||||
| configure_user(){ | ||||
|     echo "root:${PASSWORD}" | chroot / chpasswd | ||||
|     cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/ | ||||
|  | ||||
|     mkdir /home/${LIVEUSER} | ||||
|     chown ${LIVEUSER}:${LIVEUSER} /home/${LIVEUSER} | ||||
|     echo "${LIVEUSER}:${PASSWORD}" | chroot / chpasswd | ||||
|     cp -r /etc/skel/.[^.]* /home/${LIVEUSER} | ||||
|     chown -R ${LIVEUSER}:${LIVEUSER} /home/${LIVEUSER} | ||||
|     echo "Configured live user ${LIVEUSER} with password ${PASSWORD}" >> "${LOGFILE}" | ||||
| } | ||||
|  | ||||
| # }}} | ||||
|  | ||||
|  | ||||
| load_live_config(){ | ||||
|  | ||||
|     [[ -f $1 ]] || return 1 | ||||
|  | ||||
|     local live_conf="$1" | ||||
|  | ||||
|     [[ -r "${live_conf}" ]] && source "${live_conf}" | ||||
|  | ||||
|     AUTOLOGIN=${AUTOLOGIN:-true} | ||||
|  | ||||
|     PASSWORD=${PASSWORD:-artix} | ||||
|  | ||||
|     return 0 | ||||
| } | ||||
|  | ||||
| load_live_config "@sysconfdir@/artools/live.conf" || load_live_config "@datadir@/artools/live.conf" | ||||
|  | ||||
| LIVEUSER=@live@ | ||||
| DATADIR=@datadir@ | ||||
| BINDIR=@bindir@ | ||||
|   | ||||
							
								
								
									
										12
									
								
								libalpm/hooks/60-enable-liveservices.hook
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								libalpm/hooks/60-enable-liveservices.hook
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| [Trigger] | ||||
| Operation = Install | ||||
| Operation = Upgrade | ||||
| Type = Package | ||||
| Target = artix-live-s6 | ||||
| Target = artix-live-suite66 | ||||
|  | ||||
| [Action] | ||||
| Description = Enabling live services ... | ||||
| When = PostTransaction | ||||
| Exec = /usr/share/libalpm/scripts/liveservices-hook enable | ||||
| NeedsTargets | ||||
							
								
								
									
										11
									
								
								libalpm/hooks/65-disable-liveservices.hook
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								libalpm/hooks/65-disable-liveservices.hook
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| [Trigger] | ||||
| Operation = Remove | ||||
| Type = Package | ||||
| Target = artix-live-s6 | ||||
| Target = artix-live-suite66 | ||||
|  | ||||
| [Action] | ||||
| Description = Disabling live services ... | ||||
| When = PreTransaction | ||||
| Exec = /usr/share/libalpm/scripts/liveservices-hook disable | ||||
| NeedsTargets | ||||
							
								
								
									
										94
									
								
								libalpm/scripts/liveservices-hook
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										94
									
								
								libalpm/scripts/liveservices-hook
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,94 @@ | ||||
| #!/bin/sh -e | ||||
| # Only needed for s6 and suite66. | ||||
|  | ||||
| s6_enable_live_services(){ | ||||
|     if [ -d /etc/s6/sv/gdm/dependencies.d ]; then | ||||
|         touch /etc/s6/sv/gdm/dependencies.d/artix-live | ||||
|     fi | ||||
|     if [ -d /etc/s6/sv/lightdm-srv/dependencies.d ]; then | ||||
|         touch /etc/s6/sv/lightdm-srv/dependencies.d/artix-live | ||||
|     fi | ||||
|     if [ -d /etc/s6/sv/sddm/dependencies.d ]; then | ||||
|         touch /etc/s6/sv/sddm/dependencies.d/artix-live | ||||
|     fi | ||||
|     # TODO: instead touch files under dependencies.d when s6-scripts updates | ||||
|     echo "artix-live" >> /etc/s6/sv/default/contents | ||||
|     echo "pacman-init" >> /etc/s6/sv/default/contents | ||||
| } | ||||
|  | ||||
| s6_disable_live_services(){ | ||||
|     # TODO: delete files under dependencies.d when s6-scripts updates | ||||
|     sed -i '/artix-live/d' /etc/s6/sv/default/contents | ||||
|     sed -i '/pacman-init/d' /etc/s6/sv/default/contents | ||||
|     rm -f /etc/s6/sv/gdm/dependencies.d/artix-live | ||||
|     rm -f /etc/s6/sv/lightdm-srv/dependencies.d/artix-live | ||||
|     rm -f /etc/s6/sv/sddm/dependencies.d/artix-live | ||||
| } | ||||
|  | ||||
| suite66_enable_live_services(){ | ||||
|     [ -d /var/lib/66/system/boot ] || 66-tree -n boot | ||||
|     [ -d /var/lib/66/system/default ] || 66-tree -ncE default | ||||
|     66-enable -t default artix-live pacman-init | ||||
|  | ||||
|     if [ -f /usr/bin/gdm ]; then | ||||
|         66-disable -t default logind gdm | ||||
|         sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/gdm | ||||
|         66-enable -t default logind gdm | ||||
|     elif [ -f /usr/bin/lightdm ]; then | ||||
|         66-disable -t default logind lightdm | ||||
|         sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/lightdm | ||||
|         66-enable -t default logind lightdm | ||||
|     elif [ -f /usr/bin/sddm ]; then | ||||
|         66-disable -t default logind sddm | ||||
|         sed -i -E 's#@depends\s*=\s*\(\s*([^)]+)\s*\)#@depends = ( \1artix-live pacman-init )#' /etc/66/service/sddm | ||||
|         66-enable -t default logind sddm | ||||
|     fi | ||||
|  | ||||
|     66-enable -t boot -F boot@system | ||||
| } | ||||
|  | ||||
| suite66_disable_live_services(){ | ||||
|     66-disable -t default artix-live pacman-init | ||||
|  | ||||
|     if [ -f /usr/bin/gdm ]; then | ||||
|         66-disable -t default logind gdm | ||||
|         sed -i -E 's# artix-live pacman-init##' /etc/66/service/gdm | ||||
|         66-enable -t default logind gdm | ||||
|     elif [ -f /usr/bin/lightdm ]; then | ||||
|         66-disable -t default logind lightdm | ||||
|         sed -i -E 's# artix-live pacman-init##' /etc/66/service/lightdm | ||||
|         66-enable -t default logind lightdm | ||||
|     elif [ -f /usr/bin/sddm ]; then | ||||
|         66-disable -t default logind sddm | ||||
|         sed -i -E 's# artix-live pacman-init##' /etc/66/service/sddm | ||||
|         66-enable -t default logind sddm | ||||
|     fi | ||||
|  | ||||
|     66-enable -t boot -F boot@system | ||||
| } | ||||
|  | ||||
| enable_live_services() { | ||||
|     if [ -f /usr/bin/s6-init ]; then | ||||
|         s6_enable_live_services | ||||
|     fi | ||||
|  | ||||
|     if [ -f /usr/bin/suite66-init ]; then | ||||
|         suite66_enable_live_services | ||||
|     fi | ||||
| } | ||||
|  | ||||
| disable_live_services() { | ||||
|     if [ -f /usr/bin/s6-init ]; then | ||||
|         s6_disable_live_services | ||||
|     fi | ||||
|  | ||||
|     if [ -f /usr/bin/suite66-init ]; then | ||||
|         suite66_disable_live_services | ||||
|     fi | ||||
| } | ||||
|  | ||||
| case "$1" in | ||||
|     enable) enable_live_services ;; | ||||
|     disable) disable_live_services ;; | ||||
|     *) echo >&2 "  Invalid operation '$1'"; exit 1 ;; | ||||
| esac | ||||
		Reference in New Issue
	
	Block a user