Browse Source

Merge pull request #423 from sensslen/master

modify fstab instead of replacing in order to keep modifications made
change-dependabot-prefix
oleorhagen 3 years ago
committed by GitHub
parent
commit
1c248f5356
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      configs/mender_convert_config
  2. 13
      mender-convert-modify

3
configs/mender_convert_config

@ -32,6 +32,9 @@ MENDER_ARTIFACT_COMPRESSION="gzip"
# this. # this.
MENDER_ENABLE_SYSTEMD=y MENDER_ENABLE_SYSTEMD=y
# Set the fstab options for mounting the boot partition
MENDER_BOOT_PART_FSTAB_OPTS="defaults,sync"
# Custom mkfs options for creating the rootfs partition # Custom mkfs options for creating the rootfs partition
MENDER_ROOT_PART_MKFS_OPTS="" MENDER_ROOT_PART_MKFS_OPTS=""

13
mender-convert-modify

@ -318,14 +318,17 @@ fi
log_info "Using boot partition device in fstab: $boot_part_device" log_info "Using boot partition device in fstab: $boot_part_device"
log_info "Using data partition device in fstab: $data_part_device" log_info "Using data partition device in fstab: $data_part_device"
sudo bash -c "cat <<- EOF > work/rootfs/etc/fstab fstab=$(sed '/\/boot/d' work/rootfs/etc/fstab)
# stock fstab - you probably want to override this with a machine specific one fstab=$(sed '/.*\s\/\s.*/d' <<< "$fstab")
cat <<- EOF > work/rootfs/etc/fstab
${boot_part_device} ${boot_part_mountpoint} auto ${MENDER_BOOT_PART_FSTAB_OPTS} 0 0
/dev/root / auto ${MENDER_ROOT_PART_FSTAB_OPTS} 1 ${MENDER_ROOT_PART_FS_PASSNO} /dev/root / auto ${MENDER_ROOT_PART_FSTAB_OPTS} 1 ${MENDER_ROOT_PART_FS_PASSNO}
proc /proc proc defaults 0 0
${boot_part_device} ${boot_part_mountpoint} auto defaults,sync 0 0
${data_part_device} /data auto ${MENDER_DATA_PART_FSTAB_OPTS} 0 0 ${data_part_device} /data auto ${MENDER_DATA_PART_FSTAB_OPTS} 0 0
EOF"
# entries kept from original fstab
$fstab
EOF
# #
# Make sure to re-label rootfs when selinux is in enforcing mode # Make sure to re-label rootfs when selinux is in enforcing mode

Loading…
Cancel
Save