Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb1f0fbdc0 | |||
![]() |
f879bf8965 | ||
![]() |
7e93c77b9a | ||
8832d21deb | |||
189ceeb7e7 | |||
9c6b20fea3 | |||
9a514cc3ca | |||
![]() |
4f3899f6c6 | ||
![]() |
0efd3bdfa9 | ||
![]() |
f5d07a597f | ||
![]() |
c48893ded2 | ||
![]() |
781f6de35a | ||
![]() |
6131156806 |
93
Makefile
93
Makefile
@@ -1,7 +1,23 @@
|
|||||||
Version=0.1
|
VERSION = 0.5
|
||||||
|
|
||||||
|
PKG = live-services
|
||||||
|
TOOLS = artools
|
||||||
|
|
||||||
PREFIX = /usr/local
|
|
||||||
SYSCONFDIR = /etc
|
SYSCONFDIR = /etc
|
||||||
|
ifdef PREFIX
|
||||||
|
PREFIX = /usr/local
|
||||||
|
endif
|
||||||
|
BINDIR = $(PREFIX)/bin
|
||||||
|
LIBDIR = $(PREFIX)/lib
|
||||||
|
DATADIR = $(PREFIX)/share
|
||||||
|
|
||||||
|
FMODE = -m0644
|
||||||
|
DMODE = -dm0755
|
||||||
|
BMODE = -m0755
|
||||||
|
RM = rm -f
|
||||||
|
M4 = m4 -P
|
||||||
|
CHAW = chmod a-w
|
||||||
|
CHX = chmod +x
|
||||||
|
|
||||||
BIN = \
|
BIN = \
|
||||||
bin/artix-live
|
bin/artix-live
|
||||||
@@ -17,67 +33,82 @@ RC = \
|
|||||||
data/rc/pacman-init \
|
data/rc/pacman-init \
|
||||||
data/rc/artix-live
|
data/rc/artix-live
|
||||||
|
|
||||||
|
RUNIT_CORE = \
|
||||||
|
data/runit/89-artix-live.sh
|
||||||
|
|
||||||
|
RUNIT_SV = \
|
||||||
|
data/runit/pacman-init.run
|
||||||
|
|
||||||
GRUB_DEFAULT = \
|
GRUB_DEFAULT = \
|
||||||
data/grub2-portable-efi
|
data/grub2-portable-efi
|
||||||
|
|
||||||
GRUB_D = \
|
GRUB_D = \
|
||||||
data/99_zzz-portable-efi
|
data/99_zzz-portable-efi
|
||||||
|
|
||||||
all: $(BIN) $(RC) $(XBIN) ${GRUB_D}
|
all: $(BIN) $(RC) $(RUNIT_SV) $(XBIN) $(GRUB_D)
|
||||||
|
|
||||||
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/artools|g" \
|
EDIT = sed -e "s|@datadir[@]|$(DATADIR)$(TOOLS)|g" \
|
||||||
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/artools|g" \
|
-e "s|@sysconfdir[@]|$(SYSCONFDIR)/$(TOOLS)|g" \
|
||||||
-e "s|@libdir[@]|$(DESTDIR)$(PREFIX)/lib/artools|g"
|
-e "s|@libdir[@]|$(LIBDIR)/$(TOOLS)|g"
|
||||||
|
|
||||||
%: %.in Makefile
|
%: %.in Makefile
|
||||||
@echo "GEN $@"
|
@echo "GEN $@"
|
||||||
@$(RM) "$@"
|
@$(RM) "$@"
|
||||||
@m4 -P $@.in | $(edit) >$@
|
@$(M4) $@.in | $(EDIT) >$@
|
||||||
@chmod a-w "$@"
|
@$(CHAW) "$@"
|
||||||
@chmod +x "$@"
|
@$(CHX) "$@"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BIN) $(RC) ${GRUB_D}
|
$(RM) $(BIN) $(RC) $(GRUB_D)
|
||||||
|
|
||||||
install_base:
|
install_base:
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
install $(DMODE) $(DESTDIR)$(BINDIR)
|
||||||
install -m0755 ${BIN} $(DESTDIR)$(PREFIX)/bin
|
install $(BMODE) $(BIN) $(DESTDIR)$(BINDIR)
|
||||||
|
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/lib/artools
|
install $(DMODE) $(DESTDIR)$(LIBDIR)/$(TOOLS)
|
||||||
install -m0644 ${LIBS} $(DESTDIR)$(PREFIX)/lib/artools
|
install $(FMODE) $(LIBS) $(DESTDIR)$(LIBDIR)/$(TOOLS)
|
||||||
|
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/share/artools
|
install $(DMODE) $(DESTDIR)$(DATADIR)$(TOOLS)
|
||||||
install -m0644 ${SHARED} $(DESTDIR)$(PREFIX)/share/artools
|
install $(FMODE) $(SHARED) $(DESTDIR)$(DATADIR)$(TOOLS)
|
||||||
|
|
||||||
install_rc:
|
install_rc:
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/init.d
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
install -m0755 ${RC} $(DESTDIR)$(SYSCONFDIR)/init.d
|
install $(BMODE) $(RC) $(DESTDIR)$(SYSCONFDIR)/init.d
|
||||||
|
|
||||||
|
install_runit:
|
||||||
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/core-services
|
||||||
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init
|
||||||
|
install $(BMODE) $(RUNIT_CORE) $(DESTDIR)$(SYSCONFDIR)/runit/core-services
|
||||||
|
install $(BMODE) $(RUNIT_SV) $(DESTDIR)$(SYSCONFDIR)/runit/sv/pacman-init/run
|
||||||
|
|
||||||
install_portable_efi:
|
install_portable_efi:
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/default
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/default
|
||||||
install -m0755 $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
|
install $(BMODE) $(GRUB_DEFAULT) $(DESTDIR)$(SYSCONFDIR)/default
|
||||||
|
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/grub.d
|
install $(DMODE) $(DESTDIR)$(SYSCONFDIR)/grub.d
|
||||||
install -m0755 $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d
|
install $(BMODE) $(GRUB_D) $(DESTDIR)$(SYSCONFDIR)/grub.d
|
||||||
|
|
||||||
uninstall_base:
|
uninstall_base:
|
||||||
for f in ${BIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
for f in $(notdir $(BIN)); do $(RM) $(DESTDIR)$(PREFIX)/bin/$$f; done
|
||||||
for f in ${SHARED}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/$$f; done
|
for f in $(notdir $(SHARED)); do $(RM) $(DESTDIR)$(DATADIR)$(TOOLS)/$$f; done
|
||||||
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done
|
for f in $(notdir $(LIBS)); do $(RM) $(DESTDIR)$(LIBDIR)/$(TOOLS)/$$f; done
|
||||||
|
|
||||||
uninstall_portable_efi:
|
uninstall_portable_efi:
|
||||||
for f in ${GRUB_DEFAULT}; do rm -f $(DESTDIR)$(SYSCONFDIR)/default/$$f; done
|
for f in $(notdir $(GRUB_DEFAULT)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/default/$$f; done
|
||||||
for f in ${GRUB_D}; do rm -f $(DESTDIR)$(SYSCONFDIR)/grub.d/$$f; done
|
for f in $(notdir $(GRUB_D)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/grub.d/$$f; done
|
||||||
|
|
||||||
uninstall_rc:
|
uninstall_rc:
|
||||||
for f in ${RC}; do rm -f $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
|
for f in $(notdir $(RC)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/init.d/$$f; done
|
||||||
|
|
||||||
|
uninstall_runit:
|
||||||
|
for f in $(notdir $(RUNIT_SV)); do $(RM) $(DESTDIR)$(SYSCONFDIR)/runit/sv/$$f; done
|
||||||
|
|
||||||
install: install_base install_rc install_portable_efi
|
install: install_base install_rc install_portable_efi
|
||||||
|
|
||||||
uninstall: uninstall_base uninstall_rc uninstall_portable_efi
|
uninstall: uninstall_base uninstall_rc uninstall_runit uninstall_portable_efi
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
git archive --format=tar --prefix=live-services-$(Version)/ $(Version) | gzip -9 > live-services-$(Version).tar.gz
|
git archive --format=tar --prefix=$(PKG)-$(VERSION)/ $(VERSION) | gzip -9 > $(PKG)-$(VERSION).tar.gz
|
||||||
gpg --detach-sign --use-agent live-services-$(Version).tar.gz
|
gpg --detach-sign --use-agent $(PKG)-$(VERSION).tar.gz
|
||||||
|
|
||||||
.PHONY: all clean install uninstall dist
|
.PHONY: all clean install uninstall dist
|
||||||
|
@@ -53,6 +53,10 @@ livetimer=$(get_timer_ms)
|
|||||||
configure_displaymanager
|
configure_displaymanager
|
||||||
echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
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)
|
livetimer=$(get_timer_ms)
|
||||||
configure_user_root /
|
configure_user_root /
|
||||||
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
2
data/runit/89-artix-live.sh
Normal file
2
data/runit/89-artix-live.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
msg "Initializing artix-live script"
|
||||||
|
artix-live
|
5
data/runit/pacman-init.run
Normal file
5
data/runit/pacman-init.run
Normal file
@@ -0,0 +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
|
||||||
|
exec chpst -b pacman-init pause
|
@@ -33,6 +33,10 @@ get_tz(){
|
|||||||
echo $(kernel_cmdline tz)
|
echo $(kernel_cmdline tz)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_cal_mode(){
|
||||||
|
echo $(kernel_cmdline netinstall)
|
||||||
|
}
|
||||||
|
|
||||||
get_timer_ms(){
|
get_timer_ms(){
|
||||||
echo $(date +%s%3N)
|
echo $(date +%s%3N)
|
||||||
}
|
}
|
||||||
@@ -52,11 +56,11 @@ load_live_config(){
|
|||||||
|
|
||||||
[[ -z ${autologin} ]] && autologin=true
|
[[ -z ${autologin} ]] && autologin=true
|
||||||
|
|
||||||
[[ -z ${username} ]] && username="cromnix"
|
[[ -z ${username} ]] && username="artix"
|
||||||
|
|
||||||
[[ -z ${password} ]] && password="cromnix"
|
[[ -z ${password} ]] && password="artix"
|
||||||
|
|
||||||
[[ -z ${addgroups} ]] && addgroups=""
|
[[ -z ${addgroups} ]] && addgroups="video,power,storage,optical,network,lp,scanner,wheel,users,audio"
|
||||||
|
|
||||||
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
@@ -75,9 +79,7 @@ is_valid_de(){
|
|||||||
load_desktop_map(){
|
load_desktop_map(){
|
||||||
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \
|
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \
|
||||||
file=${DATADIR}/desktop.map
|
file=${DATADIR}/desktop.map
|
||||||
local desktop_map=$(sed "$_com_rm" "$file" \
|
local desktop_map=$(sed "$_com_rm" "$file" | sed "$_space" | sed "$_clean")
|
||||||
| sed "$_space" \
|
|
||||||
| sed "$_clean")
|
|
||||||
echo ${desktop_map}
|
echo ${desktop_map}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,10 +147,6 @@ configure_displaymanager(){
|
|||||||
if ${autologin};then
|
if ${autologin};then
|
||||||
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/mdm ]];then
|
|
||||||
if $(is_valid_de); then
|
|
||||||
sed -i "s|default.desktop|$default_desktop_file.desktop|g" /etc/mdm/custom.conf
|
|
||||||
fi
|
|
||||||
elif [[ -f /usr/bin/sddm ]];then
|
elif [[ -f /usr/bin/sddm ]];then
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
|
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
|
||||||
@@ -269,17 +267,17 @@ configure_language(){
|
|||||||
echo "Configured timezone: ${timezone}" >> "${LOGFILE}"
|
echo "Configured timezone: ${timezone}" >> "${LOGFILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# configure_machine_id(){
|
configure_calamares(){
|
||||||
# if [ -e "/etc/machine-id" ] ; then
|
if [[ -f /usr/bin/calamares ]];then
|
||||||
# # delete existing machine-id
|
netinstall=$(get_cal_mode)
|
||||||
# echo "Deleting existing machine-id ..." >> "${LOGFILE}"
|
if [[ "${netinstall}" == 'no' ]];then
|
||||||
# rm /etc/machine-id
|
sed -e "/- netinstall/d" \
|
||||||
# fi
|
-e "s|- chrootcfg|- unpackfs|" -i /etc/calamares/settings.conf
|
||||||
# # set unique machine-id
|
|
||||||
# echo "Setting machine-id ..." >> "${LOGFILE}"
|
sed -e '$ d' -i /etc/calamares/modules/welcome.conf
|
||||||
# dbus-uuidgen --ensure=/etc/machine-id
|
fi
|
||||||
# ln -sf /etc/machine-id /var/lib/dbus/machine-id
|
fi
|
||||||
# }
|
}
|
||||||
|
|
||||||
configure_sudoers_d(){
|
configure_sudoers_d(){
|
||||||
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel
|
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/g_wheel
|
||||||
|
Reference in New Issue
Block a user