tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Second stage bootloader (i386) hangs on ls command for ext2



Evgeniy Ivanov wrote:

> Here is a fix for the issue. Independent on what fs partition
> contains, ufs_ls() was called. Because of ext2 and ufs similarity it
> worked successfully in some cases.
> 
> netbsd_boot2_ls_fix.diff
>     Fix ls command used in second stage bootloader.
 :
> Could someone please review and commit it?

Looks good, but one concern.

>> --- a/sys/arch/i386/stand/bootxx/Makefile.bootxx
>> +++ b/sys/arch/i386/stand/bootxx/Makefile.bootxx
>> @@ -87,7 +87,8 @@ CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=xxfs \
>>              -D"blkdevioctl(x,y,z)=EINVAL" \
>>              -D"blkdevclose(f)=0" \
>>              -D"devopen(f,n,fl)=(*(fl)=(void *)n,0)" \
>> -            -DLIBSA_NO_DISKLABEL_MSGS
>> +            -DLIBSA_NO_DISKLABEL_MSGS \
>> +            -DLIBSA_NO_LS_OP
 :

>> --- a/sys/arch/i386/stand/libsa/nfs.c
>> +++ b/sys/arch/i386/stand/libsa/nfs.c
 :
>> +__compactcall void
>> +nfs_ls(struct open_file *f, const char *pattern)
>> +{
>> +#if !defined(LIBSA_NO_LS_OP)
>> +    printf("Currently ls command is unsupported by nfs\n");
>> +#endif
>> +    return;
>> +}

I think it's better to use a positive LIBSA_ENABLE_LS_OP option rather
than LIBSA_NO_LS_OP, and make whole (fs_ops)->ls op part optional because
 - there are many primary bootloaders (bootxx_foo) which don't need
   the ls op and have size restrictions (alpha, atari, pmax ...)
 - there are few bootloaders which support command prompt mode where
   the `ls' op is actually required (some ports don't have even getchar())

We also have to check all other non-x86 bootloaders which refer ufs_ls().
(ews4800mips, ia64, landisk, x68k, zaurus etc)

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index