Adriana Kobylak | e68378f | 2017-05-22 14:41:02 -0500 | [diff] [blame^] | 1 | [Unit] |
| 2 | Description=Remove UBIFS volume pnor-rw-%I |
| 3 | Wants=obmc-flash-bios-ubiattach.service |
| 4 | After=obmc-flash-bios-ubiattach.service |
| 5 | |
| 6 | [Service] |
| 7 | Type=oneshot |
| 8 | RemainAfterExit=no |
| 9 | ExecStart=/bin/sh -c 'rw=pnor-rw-%i; \ |
| 10 | if grep -q $rw /proc/mounts; then \ |
| 11 | umount /media/$rw; fi; \ |
| 12 | rw_ubi=`ubinfo -d 0 -a | grep $rw`; \ |
| 13 | if [ ! -z "$rw_ubi" ]; then \ |
| 14 | {sbindir}/ubirmvol /dev/ubi0 -N $rw; fi; \ |
| 15 | if [ -d "/media/$rw" ]; then \ |
| 16 | rm -r /media/$rw; fi;' |