summaryrefslogtreecommitdiffstats
path: root/projectroot/usr/lib/systemd/system/systemd-autoformat@.service
blob: 75221403398c4c9cf7f7973395fdcc73415c6cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[Unit]
Before=mnt-data.mount systemd-fsck@%i.service
Description=Create ext4 Data Partition
ConditionPathExists=/dev/%i

[Service]
Environment=DATAPARTITION=3
Type=oneshot
# resize partition to maximum
ExecStart=/bin/sh -c 'echo ",+" | sfdisk --force -N$DATAPARTITION /dev/mmcblk0'
# force kernel to reload the partition size of partition 3
ExecStart=/usr/sbin/partx -d -n $DATAPARTITION /dev/mmcblk0
ExecStart=/usr/sbin/partx -a -n $DATAPARTITION /dev/mmcblk0
# create filesystem (this service is only started if we have none)
ExecStart=/sbin/mkfs.ext4 /dev/%i