[Cbe-oss-dev] [patch 08/18] petitboot: Add URL test to resolve_path

Geoff Levand geoffrey.levand at am.sony.com
Sun Apr 12 04:52:47 EST 2009


Hi Jeremy,

On 03/30/2009 01:34 AM, Jeremy Kerr wrote:
>> +	/* test for urls */
>> +
>> +	if (!strncasecmp(path, s_file, sizeof(s_file) - 1))
>> +		path += sizeof(s_file) - 1;
>> +	else if (strstr(path, "://"))
>> +		return talloc_strdup(alloc_ctx, path);
>> +
>>  	sep = strchr(path, ':');
>>  	if (!sep) {
>>  		devpath = mountpoint_for_device(current_dev);
> 
> We're going to run into problems with this 'sep' test there, we should 
> probably only do that chunk of code when it's not a URL.

I think this should be OK.  Here is what I considered:

 1 = /boot/vmlinux
 2 = /dev/ps3da1:/boot/vmlinux
 3 = tftp://192.168.0.5/ps3/vmlinux
 4 = file:///boot/vmlinux

(1) will be relative to the .conf file.

(2) will use the specified device.

(3) just returns path (the full URL).

(4) is the same as (1), except for the leading 'file://',
so just strip that off and process it like (1).

Is there something I missed?

-Geoff





More information about the cbe-oss-dev mailing list