Not sure why this fails. Probably adding a short delay after running kpartx is enough to fix this.
No problem with that on Debian.
% ./mkfdosusboot -vn
==> OS: Linux
==> Creating temporary directories in /tmp/tmp.iGG2a2a20O …
==> Creating image file, 250M bytes…
250+0 records in
250+0 records out
262144000 bytes (262 MB) copied, 1.80421 s, 145 MB/s
==> Running parted to create partition table…
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 3.2
Using /home/ct/freedos/usbootimg/usbimage-250M.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit %
(parted) mklabel msdos
(parted) mkpart primary fat16 0 100%
(parted) set 1 boot on
(parted) q
==> kpartx returned 'add map loop1p1 (254:1): 0 509952 linear /dev/loop1 2048', using '/dev/mapper/loop1p1'
==> Making filesystem on /dev/mapper/loop1p1
mkfs.fat 3.0.26 (2014-03-07)
/dev/mapper/loop1p1: No such file or directory
!!! ERROR: Could not make filesystem.
==> Doing no cleanup upon users request.
==> Please unmount filesystems /tmp/tmp.iGG2a2a20O/{iso,image} and then remove /tmp/tmp.iGG2a2a20O on your own.
% sudo mkfs -t msdos -F 16 -n FREEDOS /dev/mapper/loop1p1
mkfs.fat 3.0.26 (2014-03-07)
unable to get drive geometry, using default 255/63
% sudo syslinux -i /dev/mapper/loop1p1
%
Not sure why this fails. Probably adding a short delay after running
kpartx
is enough to fix this.No problem with that on Debian.