Browse Source

Merge pull request #228 from drewmoseley/master

Changes to allow custom options for filesystems
revert-252-rm-only-tag-2.2.x
Kristian Amlie 4 years ago
committed by GitHub
parent
commit
c3422f484f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      configs/mender_convert_config
  2. 2
      mender-convert-modify
  3. 12
      modules/disk.sh

12
configs/mender_convert_config

@ -32,9 +32,21 @@ MENDER_ARTIFACT_COMPRESSION="gzip"
# this. # this.
MENDER_ENABLE_SYSTEMD=y MENDER_ENABLE_SYSTEMD=y
# Custom mkfs options for creating the rootfs partition
MENDER_ROOT_PART_MKFS_OPTS=""
# Set the fstab options for mounting the root partition
MENDER_ROOT_PART_FSTAB_OPTS="defaults"
# Set to 0 to disable fsck; needed for read-only rootfs support
MENDER_ROOT_PART_FS_PASSNO="1"
# Set the fstab options for mounting the data partition # Set the fstab options for mounting the data partition
MENDER_DATA_PART_FSTAB_OPTS="defaults" MENDER_DATA_PART_FSTAB_OPTS="defaults"
# Custom mkfs options for creating the data partition
MENDER_DATA_PART_MKFS_OPTS=""
# The file system will be grown to occupy the full block device. If the file # The file system will be grown to occupy the full block device. If the file
# system is already at maximum size, no action will be performed. # system is already at maximum size, no action will be performed.
# #

2
mender-convert-modify

@ -267,7 +267,7 @@ log_info "Using data partition device in fstab: $data_part_device"
sudo bash -c "cat <<- EOF > work/rootfs/etc/fstab sudo bash -c "cat <<- EOF > work/rootfs/etc/fstab
# stock fstab - you probably want to override this with a machine specific one # stock fstab - you probably want to override this with a machine specific one
/dev/root / auto defaults 1 1 /dev/root / ext2 ${MENDER_ROOT_PART_FSTAB_OPTS} 1 ${MENDER_ROOT_PART_FS_PASSNO}
proc /proc proc defaults 0 0 proc /proc proc defaults 0 0
${boot_part_device} ${boot_part_mountpoint} auto defaults,sync 0 0 ${boot_part_device} ${boot_part_mountpoint} auto defaults,sync 0 0

12
modules/disk.sh

@ -114,13 +114,19 @@ disk_create_file_system_from_folder() {
run_and_log_cmd "dd if=/dev/zero of=${2} seek=${3} count=0 bs=512 status=none" run_and_log_cmd "dd if=/dev/zero of=${2} seek=${3} count=0 bs=512 status=none"
case ${1} in
*data/ ) EXTRA_OPTS="${MENDER_DATA_PART_MKFS_OPTS}";;
*rootfs/ ) EXTRA_OPTS="${MENDER_ROOT_PART_MKFS_OPTS}";;
* ) EXTRA_OPTS="";;
esac
case "$4" in case "$4" in
"ext4") "ext4")
MKFS_EXT4="/usr/bin/mkfs.ext4" MKFS_EXT4="/usr/bin/mkfs.ext4"
if [ ! -f ${MKFS_EXT4} ]; then if [ ! -f ${MKFS_EXT4} ]; then
MKFS_EXT4="/sbin/mkfs.ext4" MKFS_EXT4="/sbin/mkfs.ext4"
fi fi
run_and_log_cmd "${MKFS_EXT4} -q -F ${2}" run_and_log_cmd "${MKFS_EXT4} -q -F ${2} ${EXTRA_OPTS}"
;; ;;
"xfs") "xfs")
@ -128,7 +134,7 @@ disk_create_file_system_from_folder() {
if [ ! -f ${MKFS_XFS} ]; then if [ ! -f ${MKFS_XFS} ]; then
MKFS_XFS="/sbin/mkfs.xfs" MKFS_XFS="/sbin/mkfs.xfs"
fi fi
run_and_log_cmd "${MKFS_XFS} -q -f ${2}" run_and_log_cmd "${MKFS_XFS} -q -f ${2} ${EXTRA_OPTS}"
;; ;;
*) *)
log_fatal "Unknown file system type specified: ${4}" log_fatal "Unknown file system type specified: ${4}"
@ -360,4 +366,4 @@ disk_override_partition_variable() {
MENDER_STORAGE_DEVICE_BASE=$(disk_get_device_base "${2}") MENDER_STORAGE_DEVICE_BASE=$(disk_get_device_base "${2}")
fi fi
fi fi
} }

Loading…
Cancel
Save