]> git.ozlabs.org Git - petitboot/blobdiff - devices/udev-helper.c
Make kboot_parser global options array static
[petitboot] / devices / udev-helper.c
index f77777a0ccaf51a5f08d93cdf50e2ce5a8967c63..87a7fc19ab431827c15ec1615cd94a23b5b5d113 100644 (file)
@@ -430,7 +430,8 @@ static int is_removable_device(const char *sysfs_path)
 
 static int is_ignored_device(const char *devname)
 {
-       static const char *ignored_devices[] = { "/dev/ram", NULL };
+       static const char *ignored_devices[] =
+               { "/dev/ram", "/dev/loop", NULL };
        const char **dev;
 
        for (dev = ignored_devices; *dev; dev++)
@@ -488,35 +489,30 @@ static int poll_device_plug(const char *dev_path,
 
        /* Polling loop for optical drive */
        for (; (*optical) != 0; ) {
-               pb_log("poll for optical drive insertion ...\n");
                fd = open(dev_path, O_RDONLY|O_NONBLOCK);
                if (fd < 0)
                        return EXIT_FAILURE;
                rc = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT);
                close(fd);
-               if (rc == -1) {
-                       pb_log("not an optical drive, fallback...\n");
+               if (rc == -1)
                        break;
-               }
+
                *optical = 1;
                if (rc == CDS_DISC_OK)
                        return EXIT_SUCCESS;
 
-               pb_log("no... waiting\n");
                detach_and_sleep(REMOVABLE_SLEEP_DELAY);
        }
 
        /* Fall back to bare open() */
        *optical = 0;
        for (;;) {
-               pb_log("poll for non-optical drive insertion ...\n");
                fd = open(dev_path, O_RDONLY);
                if (fd < 0 && errno != ENOMEDIUM)
                        return EXIT_FAILURE;
                close(fd);
                if (fd >= 0)
                        return EXIT_SUCCESS;
-               pb_log("no... waiting\n");
                detach_and_sleep(REMOVABLE_SLEEP_DELAY);
        }
 }
@@ -526,7 +522,6 @@ static int poll_device_unplug(const char *dev_path, int optical)
        int rc, fd;
 
        for (;optical;) {
-               pb_log("poll for optical drive removal ...\n");
                fd = open(dev_path, O_RDONLY|O_NONBLOCK);
                if (fd < 0)
                        return EXIT_FAILURE;
@@ -534,20 +529,17 @@ static int poll_device_unplug(const char *dev_path, int optical)
                close(fd);
                if (rc != CDS_DISC_OK)
                        return EXIT_SUCCESS;
-               pb_log("no... waiting\n");
                detach_and_sleep(REMOVABLE_SLEEP_DELAY);
        }
 
        /* Fall back to bare open() */
        for (;;) {
-               pb_log("poll for non-optical drive removal ...\n");
                fd = open(dev_path, O_RDONLY);
                if (fd < 0 && errno != ENOMEDIUM)
                        return EXIT_FAILURE;
                close(fd);
                if (fd < 0)
                        return EXIT_SUCCESS;
-               pb_log("no... waiting\n");
                detach_and_sleep(REMOVABLE_SLEEP_DELAY);
        }
 }