FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Studio User

 
 
LinkBack Thread Tools
 
Old 11-09-2009, 01:08 PM
Martin Sivak
 
Default Add cdroms and other non-partition based devices to blkid database (#485060)

I did talk to blkid maintainer. They are not fixing the API in RHEL5. We may get what we need for RHEL6 though.

Martin

----- "Jeremy Katz" <katzj@fedoraproject.org> wrote:

> On Mon, Nov 9, 2009 at 8:07 AM, Martin Sivak <msivak@redhat.com>
> wrote:
> >> + * */* List all block devices from /sys/block and add them to
> blkid
> >> db
> >> + * * * libblkid should be doing that, so lets consider this as a
> >> workaround */
>
> Did you file a bug against libblkid? Seems better to fix it there
> than to add a workaround like this deep in the bowels of anaconda
>
> - Jeremy
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-09-2009, 01:16 PM
Hans de Goede
 
Default Add cdroms and other non-partition based devices to blkid database (#485060)

Ack.

On 11/09/2009 03:07 PM, Martin Sivak wrote:

---
loader2/driverdisk.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index eca8605..3a0a13c 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -23,6 +23,8 @@
#include<string.h>
#include<sys/stat.h>
#include<unistd.h>
+#include<sys/types.h>
+#include<dirent.h>

#include<blkid/blkid.h>

@@ -591,6 +593,8 @@ struct ddlist* findDriverDiskByLabel(void)
char *ddLabel = "OEMDRV";
struct ddlist *ddDevice = NULL;
blkid_cache bCache;
+ struct dirent *direntry;
+ DIR *sysblock;

int res;
blkid_dev_iterate bIter;
@@ -600,6 +604,25 @@ struct ddlist* findDriverDiskByLabel(void)
logMessage(ERROR, _("Cannot initialize cache instance for blkid"));
return NULL;
}
+
+ /* List all block devices from /sys/block and add them to blkid db
+ * libblkid should be doing that, so lets consider this as a workaround */
+ sysblock = opendir("/sys/block");
+ if(sysblock){
+ while((direntry = readdir(sysblock))!=NULL){
+ /* add only h(d?), s(d?) and s(cd?) devices */
+ if(direntry->d_name[0]!='h'&&
+ direntry->d_name[0]!='s') continue;
+
+ char *devname;
+ if(asprintf(&devname, "/dev/%s", direntry->d_name)!=-1){
+ blkid_get_dev(bCache, devname, BLKID_DEV_NORMAL);
+ free(devname);
+ }
+ }
+ closedir(sysblock);
+ }
+
if((res = blkid_probe_all(bCache))<0){
logMessage(ERROR, _("Cannot probe devices in blkid: %d"), res);
return NULL;


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-09-2009, 02:45 PM
Martin Sivak
 
Default Add cdroms and other non-partition based devices to blkid database (#485060)

OK, we have a bug number now #533874

----- "Jeremy Katz" <katzj@fedoraproject.org> wrote:

> On Mon, Nov 9, 2009 at 9:08 AM, Martin Sivak <msivak@redhat.com>
> wrote:
> > I did talk to blkid maintainer. They are not fixing the API in
> RHEL5. We may get what we need for RHEL6 though.
>
> "may" doesn't mean will :-) Unless there's some sort of commitment
> for the API upstream, then we really should avoid hacking it in for
> RHEL5 because we'll end up needing to do the same sort of thing for
> the future and then we'll have widely divergent code.
>
> - Jeremy
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org