Unified · Split
| @@ -58,6 +58,11 @@ if [ -e /sys/firmware/efi/systab ]; then · 57 unmodified lines | |||
| 58 | EFI_SYSTEM=1 | 58 | EFI_SYSTEM=1 |
| 59 | fi | 59 | fi |
| 60 | 60 | ||
| 61 | # Detect if systemd is installed | ||
| 62 | if [ "$(cat /proc/1/comm)" = "systemd" ]; then | ||
| 63 | SYSTEMD_INIT=1 | ||
| 64 | fi | ||
| 65 | |||
| 61 | # dialog colors | 66 | # dialog colors |
| 62 | BLACK="\Z0" | 67 | BLACK="\Z0" |
| 63 | RED="\Z1" | 68 | RED="\Z1" |
| @@ -262,7 +267,7 @@ ${RESET}\n" 18 80 · 198 unmodified lines | |||
| 262 | } | 267 | } |
| 263 | 268 | ||
| 264 | menu_keymap() { | 269 | menu_keymap() { |
| 265 | if [ -x "/usr/bin/localectl" ]; then | 270 | if [ "$SYSTEMD_INIT" -eq 1 ]; then |
| 266 | local _keymaps="$(localectl --no-pager list-keymaps)" | 271 | local _keymaps="$(localectl --no-pager list-keymaps)" |
| 267 | else | 272 | 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 | ||
| 325 | menu_timezone() { | 330 | menu_timezone() { |
| 326 | if [ -x "/usr/bin/timedatectl" ]; then | 331 | if [ "$SYSTEMD_INIT" -eq 1 ]; then |
| 327 | local _tzones="$(timedatectl --no-pager list-timezones)" | 332 | local _tzones="$(timedatectl --no-pager list-timezones)" |
| 328 | else | 333 | 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 | fi | 335 | fi |
| 331 | local _TIMEZONES= | 336 | local _TIMEZONES= |
| 332 | 337 | ||
| @@ -778,7 +783,7 @@ install_packages() { · 445 unmodified lines | |||
| 778 | } | 783 | } |
| 779 | 784 | ||
| 780 | enable_dhcpd() { | 785 | enable_dhcpd() { |
| 781 | if [ -x "/usr/bin/systemctl" ]; then | 786 | if [ "$SYSTEMD_INIT" -eq 1 ]; then |
| 782 | chroot $TARGETDIR systemctl enable dhcpcd.service >$LOG 2>&1 | 787 | chroot $TARGETDIR systemctl enable dhcpcd.service >$LOG 2>&1 |
| 783 | else | 788 | else |
| 784 | ln -s /etc/sv/dhcpcd $TARGETDIR/etc/runit/runsvdir/default/dhcpcd | 789 | 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" ]; then | 874 | elif [ "$_type" = "dhcp" ]; then |
| 870 | if [ -f /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf ]; then | 875 | if [ -f /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf ]; then |
| 871 | cp /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf $TARGETDIR/etc/wpa_supplicant | 876 | cp /etc/wpa_supplicant/wpa_supplicant-${_dev}.conf $TARGETDIR/etc/wpa_supplicant |
| 872 | if [ -x "/usr/bin/systemctl" ]; then | 877 | if [ "$SYSTEMD_INIT" -eq 1 ]; then |
| 873 | chroot $TARGETDIR systemctl enable dhcpcd@${_dev}.service >$LOG 2>&1 | 878 | chroot $TARGETDIR systemctl enable dhcpcd@${_dev}.service >$LOG 2>&1 |
| 874 | else | 879 | 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} |