blob: 1bf15bfd45b4744053d9bf911b266257f8e6c232 [file] [log] [blame]
Adriana Kobylak22b01152017-04-13 12:36:01 -05001[Unit]
2Description=Mount SquashFS image pnor-ro-%I
3Requires=obmc-flash-bios-ubiattach.service
4After=obmc-flash-bios-ubiattach.service
5
6[Service]
7Type=oneshot
8RemainAfterExit=yes
9ExecStart=/bin/sh -c '{sbindir}/ubimkvol /dev/ubi0 -N pnor-ro-%i -s 32MiB --type=static; \
10 mkdir /media/pnor-ro-%i; \
11 volumeid%i=`ubinfo -d 0 -N pnor-ro-%i | grep "Volume ID" | sed -e "s|Volume ID:||" -e "s/^ *//" | grep -o "^\S*"`; \
12 ubiblock --create /dev/ubi0_$volumeid%i; \
13 ubiupdatevol /dev/ubi0_$volumeid%i /tmp/images/%i/pnor.xz.squashfs; \
14 mount -t squashfs -o ro /dev/ubiblock0_$volumeid%i /media/pnor-ro-%i'