|
|
@ -96,27 +96,22 @@ mkdir -p work/rootfs |
|
|
|
sudo mount ${boot_part} work/boot |
|
|
|
sudo mount ${root_part} work/rootfs |
|
|
|
|
|
|
|
mkdir -p work/mender-client-deb/files |
|
|
|
mkdir -p work/deb-packages |
|
|
|
|
|
|
|
log_info "Installing Mender client and related files" |
|
|
|
|
|
|
|
deb_arch=$(probe_debian_arch_name) |
|
|
|
|
|
|
|
if [ "${MENDER_CLIENT_VERSION}" = "latest" ]; then |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-client-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "stable" "mender-client" "latest") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "stable" "mender-client" "latest") |
|
|
|
elif [ "${MENDER_CLIENT_VERSION}" = "master" ]; then |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-client-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-client" "latest") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-client" "latest") |
|
|
|
else |
|
|
|
DEBIAN_REVISION="-1" |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-client-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-client" "${MENDER_CLIENT_VERSION}${DEBIAN_REVISION}") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-client" "${MENDER_CLIENT_VERSION}${DEBIAN_REVISION}") |
|
|
|
fi |
|
|
|
|
|
|
|
cd work/mender-client-deb |
|
|
|
run_and_log_cmd "ar -xv ${deb_name}" |
|
|
|
run_and_log_cmd "sudo tar xJf data.tar.xz -C files" |
|
|
|
cd - > /dev/null 2>&1 |
|
|
|
|
|
|
|
run_and_log_cmd "sudo rsync --archive --keep-dirlinks --verbose work/mender-client-deb/files/ work/rootfs/" |
|
|
|
deb_extract_package "work/deb-packages/${deb_name}" "work/rootfs/" |
|
|
|
|
|
|
|
if [ "${MENDER_ENABLE_SYSTEMD}" == "y" ]; then |
|
|
|
run_and_log_cmd "sudo ln -sf /lib/systemd/system/mender-client.service \ |
|
|
@ -125,24 +120,18 @@ fi |
|
|
|
|
|
|
|
if [ "${MENDER_ADDON_SHELL_INSTALL}" = "y" ]; then |
|
|
|
|
|
|
|
mkdir -p work/mender-shell-deb/files |
|
|
|
log_info "Installing Mender Shell addon" |
|
|
|
|
|
|
|
if [ "${MENDER_ADDON_SHELL_VERSION}" = "latest" ]; then |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-shell-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "stable" "mender-shell" "latest") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "stable" "mender-shell" "latest") |
|
|
|
elif [ "${MENDER_ADDON_SHELL_VERSION}" = "master" ]; then |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-shell-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-shell" "latest") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-shell" "latest") |
|
|
|
else |
|
|
|
DEBIAN_REVISION="-1" |
|
|
|
deb_name=$(deb_from_repo_get "work/mender-shell-deb" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-shell" "${MENDER_ADDON_SHELL_VERSION}${DEBIAN_REVISION}") |
|
|
|
deb_name=$(deb_from_repo_get "work/deb-packages" ${MENDER_APT_REPO_URL} ${deb_arch} "experimental" "mender-shell" "${MENDER_ADDON_SHELL_VERSION}${DEBIAN_REVISION}") |
|
|
|
fi |
|
|
|
|
|
|
|
cd work/mender-shell-deb |
|
|
|
run_and_log_cmd "ar -xv ${deb_name}" |
|
|
|
run_and_log_cmd "sudo tar xJf data.tar.xz -C files" |
|
|
|
cd - > /dev/null 2>&1 |
|
|
|
|
|
|
|
run_and_log_cmd "sudo rsync --archive --keep-dirlinks --verbose work/mender-shell-deb/files/ work/rootfs/" |
|
|
|
deb_extract_package "work/deb-packages/${deb_name}" "work/rootfs/" |
|
|
|
|
|
|
|
run_and_log_cmd "sudo ln -sf /lib/systemd/system/mender-shell.service \ |
|
|
|
work/rootfs/etc/systemd/system/multi-user.target.wants/mender-shell.service" |
|
|
|