]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: allow creating swap on /dev/hd[ab]
authorPetr Uzel <petr.uzel@suse.cz>
Sun, 13 May 2012 11:44:31 +0000 (13:44 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 May 2012 09:19:53 +0000 (11:19 +0200)
Currently, mkswap does not allow swap to be created on /dev/hda and
/dev/hdb. There is no reason why /dev/hda and /dev/hdb should be treated
differently.

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491021
Cc: Russell Coker <russell@coker.com.au>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
disk-utils/mkswap.c

index c7dedd7c235ad4b18ae26e49b0874587560d043c..dec34e1ae381055e34ec5fb8dacf8b30883791af 100644 (file)
@@ -596,13 +596,8 @@ main(int argc, char **argv) {
                exit(EXIT_FAILURE);
        }
 
-       /* Want a block device. Probably not /dev/hda or /dev/hdb. */
        if (!S_ISBLK(statbuf.st_mode))
                check=0;
-       else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
-               errx(EXIT_FAILURE, _("error: "
-                       "will not try to make swapdevice on '%s'"),
-                       device_name);
        else if (is_mounted(device_name))
                errx(EXIT_FAILURE, _("error: "
                        "%s is mounted; will not make swapspace."),