History

Add global systemd var

Ypnose committed 12 years ago

Commit 1e28a7a1 parent df8e6631 file · +10 −5Browse files

Unified · Split

installer.sh.in+10−5
@@ -58,6 +58,11 @@ if [ -e /sys/firmware/efi/systab ]; then · 57 unmodified lines
58 EFI_SYSTEM=158 EFI_SYSTEM=1
59fi59fi
60 60
61# Detect if systemd is installed
62if [ "$(cat /proc/1/comm)" = "systemd" ]; then
63 SYSTEMD_INIT=1
64fi
65
61# dialog colors66# dialog colors
62BLACK="\Z0"67BLACK="\Z0"
63RED="\Z1"68RED="\Z1"
@@ -262,7 +267,7 @@ ${RESET}\n" 18 80 · 198 unmodified lines
262}267}
263 268
264menu_keymap() {269menu_keymap() {
265 if [ -x "/usr/bin/localectl" ]; then270 if [ "$SYSTEMD_INIT" -eq 1 ]; then
266 local _keymaps="$(localectl --no-pager list-keymaps)"271 local _keymaps="$(localectl --no-pager list-keymaps)"
267 else272 else
268 local _keymaps="$(find /usr/share/kbd/keymaps/ -type f -iname "*.map.gz" -printf "%f\n" | sed 's|.map.gz||g' | sort)"273 local _keymaps="$(find /usr/share/kbd/keymaps/ -type f -iname "*.map.gz" -printf "%f\n" | sed 's|.map.gz||g' | sort)"
@@ -323,10 +328,10 @@ set_locale() { · 54 unmodified lines
323}328}
324 329
325menu_timezone() {330menu_timezone() {
326 if [ -x "/usr/bin/timedatectl" ]; then331 if [ "$SYSTEMD_INIT" -eq 1 ]; then
327 local _tzones="$(timedatectl --no-pager list-timezones)"332 local _tzones="$(timedatectl --no-pager list-timezones)"
328 else333 else
329 local _tzones="$(find /usr/share/zoneinfo Africa/ America/ Antarctica/ Arctic/ Asia/ Atlantic/ Australia/ Europe/ Indian/ Pacific/ -type f | sort)"334 local _tzones="$(cd /usr/share/zoneinfo; find Africa/ America/ Antarctica/ Arctic/ Asia/ Atlantic/ Australia/ Europe/ Indian/ Pacific/ -type f | sort)"
330 fi335 fi
331 local _TIMEZONES=336 local _TIMEZONES=
332 337
@@ -778,7 +783,7 @@ install_packages() { · 445 unmodified lines
778}783}
779 784
780enable_dhcpd() {785enable_dhcpd() {
781 if [ -x "/usr/bin/systemctl" ]; then786 if [ "$SYSTEMD_INIT" -eq 1 ]; then
782 chroot $TARGETDIR systemctl enable dhcpcd.service >$LOG 2>&1787 chroot $TARGETDIR systemctl enable dhcpcd.service >$LOG 2>&1
783 else788 else
784 ln -s /etc/sv/dhcpcd $TARGETDIR/etc/runit/runsvdir/default/dhcpcd789 ln -s /etc/sv/dhcpcd $TARGETDIR/etc/runit/runsvdir/default/dhcpcd
@@ -869,7 +874,7 @@ ${BOLD}Do you want to continue?${RESET}" 20 80 || return · 84 unmodified lines
869 elif [ "$_type" = "dhcp" ]; then874 elif [ "$_type" = "dhcp" ]; then
870 if [ -f /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf ]; then875 if [ -f /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf ]; then
871 cp /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf $TARGETDIR/etc/wpa_supplicant876 cp /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf $TARGETDIR/etc/wpa_supplicant
872 if [ -x "/usr/bin/systemctl" ]; then877 if [ "$SYSTEMD_INIT" -eq 1 ]; then
873 chroot $TARGETDIR systemctl enable dhcpcd@${_dev}.service >$LOG 2>&1878 chroot $TARGETDIR systemctl enable dhcpcd@${_dev}.service >$LOG 2>&1
874 else879 else
875 ln -s /etc/sv/dhcpcd-${_dev} $TARGETDIR/etc/runit/runsvdir/default/dhcpcd-${_dev}880 ln -s /etc/sv/dhcpcd-${_dev} $TARGETDIR/etc/runit/runsvdir/default/dhcpcd-${_dev}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t