mkswap: tolerate ENOTSUP when failing to relabel

It might be that the underlying filesystem just doesn't support SELinux
labeling. This fixes creating swap on vfat live media:

  # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ...

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
This commit is contained in:
Lubomir Rintel 2016-04-18 09:01:23 +02:00 committed by Karel Zak
parent a772281dff
commit d97dc0ee25
1 changed files with 1 additions and 1 deletions

View File

@ -522,7 +522,7 @@ int main(int argc, char **argv)
context_string = context_str(newcontext);
if (strcmp(context_string, oldcontext)!=0) {
if (fsetfilecon(ctl.fd, context_string))
if (fsetfilecon(ctl.fd, context_string) && errno != ENOTSUP)
err(EXIT_FAILURE, _("unable to relabel %s to %s"),
ctl.devname, context_string);
}