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