summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/libs')
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh1
-rw-r--r--src/core/libs/lib-misc.sh17
-rw-r--r--src/core/libs/lib-pacman.sh14
-rw-r--r--src/core/libs/lib-ui-interactive.sh23
4 files changed, 41 insertions, 14 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index 01e91e9..5b078a7 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -91,6 +91,7 @@ get_possible_fs () {
do
which ${filesystem_programs[$fs]} &>/dev/null && possible_fs=("${possible_fs[@]}" $fs)
done
+ true
}
supported_bootloaders=('grub')
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 13379a2..2dee841 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -122,17 +122,26 @@ cleanup_runtime ()
dohwclock() {
# TODO: we probably only need to do this once and then actually use adjtime on next invocations
inform "Resetting hardware clock adjustment file"
- [ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock
+ [ -d /var/lib/hwclock ] || mkdir -p /var/lib/hwclock || return 1
if [ ! -f /var/lib/hwclock/adjtime ]; then
- echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
+ echo "0.0 0 0.0" > /var/lib/hwclock/adjtime || return 1
fi
inform "Syncing clocks ($2), hc being $1 ..."
if [ "$1" = "UTC" ]; then
- hwclock --$2 --utc
+ if ! hwclock --$2 --utc
+ then
+ show_warning 'Hwclock failure' "Could not hwclock --$2 --utc"
+ return 1
+ fi
else
- hwclock --$2 --localtime
+ if ! hwclock --$2 --localtime
+ then
+ show_warning 'Hwclock failure' "Could not hwclock --$2 --localtime"
+ return 1
+ fi
fi
+ return 0
}
target_configure_initial_keymap_font ()
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh
index 78e800e..bfd307c 100644
--- a/src/core/libs/lib-pacman.sh
+++ b/src/core/libs/lib-pacman.sh
@@ -47,14 +47,20 @@ do
#TODO: this is a VERY, VERY dirty hack. we fall back to net for any non-core repo because we only have core on the CD. also user maybe didn't pick a mirror yet
if [ "$repo" != core ]
then
- add_pacman_repo target ${repo} "Include = $var_MIRRORLIST"
+ add_pacman_repo target ${repo} "Include = $var_MIRRORLIST" || return 1
else
- add_pacman_repo target ${repo} "Server = ${serverurl/\$repo/$repo}" # replace literal '$repo' in the serverurl string by "$repo" where $repo is our variable.
+ # replace literal '$repo' in the serverurl string by "$repo" where $repo is our variable.
+ add_pacman_repo target ${repo} "Server = ${serverurl/\$repo/$repo}" || return 1
fi
done
# Set up the necessary directories for pacman use
- [ ! -d "${var_TARGET_DIR}/var/cache/pacman/pkg" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/cache/pacman/pkg"
- [ ! -d "${var_TARGET_DIR}/var/lib/pacman" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/lib/pacman"
+ for dir in var/cache/pacman/pkg var/lib/pacman
+ do
+ if [ ! -d "${var_TARGET_DIR}/$dir" ]
+ then
+ mkdir -m 755 -p "${var_TARGET_DIR}/$dir" || return 1
+ fi
+ done
inform "Refreshing package database..."
$PACMAN_TARGET -Sy >$LOG 2>&1 || return 1
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 89e62bd..8281bc0 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -125,9 +125,10 @@ interactive_timezone () {
then
# This changes probably also the systemtime (UTC->$TIMEZONE)!
# localtime users will have a false time after that!
- /bin/rm -f /etc/localtime
- /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+ /bin/rm -f /etc/localtime || return 1
+ /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime || return 1
fi
+ return 0
}
@@ -138,8 +139,12 @@ interactive_time () {
# To avoid a false time for localtime users after above
# we must re-read the hwclock value again, but now into the
# correct timezone.
- [ "$HARDWARECLOCK" == "localtime" ] && dohwclock $HARDWARECLOCK hctosys
+ if [ "$HARDWARECLOCK" == "localtime" ]
+ then
+ dohwclock $HARDWARECLOCK hctosys || return $?
+ fi
+ timeset=
local default=no
while true; do
current=$(date)
@@ -153,21 +158,27 @@ interactive_time () {
inform "Syncing clock with internet pool ..."
if ntpdate pool.ntp.org >/dev/null; then
notify "Synced clock with internet pool successfully."
- dohwclock $HARDWARECLOCK systohc && default=3
+ dohwclock $HARDWARECLOCK systohc && default=3 || return $?
+ timeset=1
else
show_warning 'Ntp failure' "An error has occured, time was not changed!"
+ timeset=0
fi
fi
if [ "$ANSWER_OPTION" = manual ]; then
ask_datetime || continue
if date -s "$ANSWER_DATETIME"; then
- dohwclock $HARDWARECLOCK systohc && default=3
+ dohwclock $HARDWARECLOCK systohc && default=3 || return $?
+ timeset=1
else
show_warning "Date/time setting failed" "Something went wrong when doing date -s $ANSWER_DATETIME"
+ timeset=0
fi
fi
- [ "$ANSWER_OPTION" = return ] && break
+ [ "$ANSWER_OPTION" = return ] && timeset=1 && break
done
+ [ "$timeset" = '0' ] && return 1
+ return 0
}