@@ -31,11 +31,6 @@ parse_args() {
# Create a persistent directory to mount the data partition at.
mender_fixup() {
pushd "${TARGET_DIR}"
- if [[ -L var/lib/mender ]]; then
- rm var/lib/mender
- mkdir -p var/lib/mender
- fi
-
# The common paradigm is to have the persistent data volume at /data for mender.
if [[ ! -L data ]]; then
ln -s var/lib/mender data
@@ -8,22 +8,6 @@ PIDFILE="/var/run/${DAEMON}.pid"
DAEMON_ARGS="daemon"
start() {
- # If /var/lib/mender is a symlink to /var/run/mender, and
- # - the filesystem is RO (i.e. we can not rm the symlink),
- # create the directory pointed to by the symlink.
- # - the filesystem is RW (i.e. we can rm the symlink),
- # replace the symlink with an actual directory
- if [ -L /var/lib/mender ] && [ "$(readlink /var/lib/mender)" = "/var/run/mender" ]
- then
- if rm -f /var/lib/mender >/dev/null 2>&1; then
- mkdir -p /var/lib/mender
- else
- echo "No persistent location to store mender data. Data will be lost"
- echo "at reboot. Are you sure this is what you want to do?"
- mkdir -p "$(readlink /var/lib/mender)"
- fi
- fi
-
printf "Starting mender service: "
umask 077
start-stop-daemon -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${DAEMON_ARGS}
@@ -6,17 +6,6 @@ After=systemd-resolved.service
Type=idle
User=root
Group=root
-ExecStartPre=/bin/sh -c '\
-if [ -L /var/lib/mender \
- -a "$(readlink /var/lib/mender)" = "/var/run/mender" ]; then \
- if rm -f /var/lib/mender >/dev/null 2>&1; then \
- mkdir -p /var/lib/mender; \
- else \
- echo "No persistent location to store mender data. Data will be lost" \
- echo "at reboot. Are you sure this is what you want to do?"; \
- mkdir -p "$(readlink /var/lib/mender)"; \
- fi; \
-fi'
ExecStart=/usr/bin/mender daemon
Restart=on-abort
@@ -72,8 +72,7 @@ define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -D -m 0755 $(MENDER_PKGDIR)/device_type \
$(TARGET_DIR)/etc/mender/device_type
- mkdir -p $(TARGET_DIR)/var/lib
- ln -snf /var/run/mender $(TARGET_DIR)/var/lib/mender
+ mkdir -p $(TARGET_DIR)/var/lib/mender
$(foreach f,$(MENDER_UPDATE_MODULES_FILES), \
$(INSTALL) -D -m 0755 $(@D)/support/modules/$(notdir $(f)) \
$(TARGET_DIR)/usr/share/mender/modules/v3/$(notdir $(f))
The logic behind making /var/lib/mender a symlink to itself is to detect if a filesystem is read-only. However, this creates a few problems: 1) The logic confusing. 2) The official mender documentation suggests four partitions minimum: - boot - rootfs A - rootfs B - data If a user is to follow the official documentation, which they should, then there is no need for any additional logic for a system setup with a read-only filesystem, as the data partition is always read-write. 3) The post-build.sh script in the board/mender/x86_64 directory removes the symlink. - Remove symlinking /var/lib/mender to itself - Remove the difficult to understand logic dealing with the symlinks in S42mender, mender-client.service. - Remove the logic dealing with the symlink in board/mender/x86_64/post-build.sh Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> --- board/mender/x86_64/post-build.sh | 5 ----- package/mender/S42mender | 16 ---------------- package/mender/mender-client.service | 11 ----------- package/mender/mender.mk | 3 +-- 4 files changed, 1 insertion(+), 34 deletions(-)