[H-GEN] Problem updating modules

Tony Nugent tony at linuxworks.com.au
Sun Jul 9 21:38:08 EDT 2006


> From: general-bounces at lists.humbug.org.au on behalf Of Geoff Shang
> Sent: Monday, July 10, 2006 4:07 AM

> > Aha.  addfile() in /sbin/update-modules.modutils runs the file as a 
> > shell script if it has the execute bit set.
> >
> > It's a feature, not a bug!  Huzzah!
> 
> Excellent!  I knew there had to be a reason why it was doing that.
> Thank you very much.  That'll learn me to transfer a file using a
> VFAT-formatted flash drive. <grin>

Ouch!  If you are going to transfer/backup/restore files like that, then the
best way is to use .tar (or .tar.gz/.tar.bz2) files to retain all the unix
permissions/ownerships/links etc.

It has always seemed to me to be a rather silly way for linux/unix to handle
files coming off dos/win drives, as very few (hardly any) would really be
executables.  Even samba does the same thing by default with files being copied
from smb network shares - so never restore unix files directly from smb shares
or fat/ntfs drives without checking the resulting permissions.

Very annoying, a total pain at times.  It has become one of these "little
quirks" that can easily bite hard for the inexperienced, forgetful or careless
user (as in this case under discussion).

There must have been some reason for why it was done like this as default, but
the logic doesn't seem to be very logical to me :-)

However, samba can be told to do otherwise for mounting smb shares (on either a
per-share or global basis), and (if I recall correctly - it has been a while)
fat/vfat/ntfs drives (indeed, any drive) can be configured to be mounted so that
any files copied from them to unix filesystems will not have the execute bit set
- but both are total kludges to cope with the differences (ie, fat/vfat not
having built-in file permission and ownership flags).

It is certainly possible to reformat flash drives unix-style, but that means
dos/win-based boxes can't read them unless something like "Ext2FS Anywhere" is
installed on the dos/win box.

Flash drives are inevitably fat-formatted, so some magic in /etc/fstab for
auto-mounting them in a sane way can be very useful. (See the man pages for
fstab and mount etc).

BTW, that Ext2FS driver is a great (and an almost essential) utility for
accessing unix filesystems from win98/2k/xp on a dual-boot box.  I'm sure it's
freeware (I've been using it for a long time), so a google search should find
it.

Another big issue with dealing with dos/win is CRLF<->NL conversion (end-of-line
in text files), unix in particular doesn't like them in things like shell
scripts, and notepad.exe doesn't handle unix NL-deliminated files well at all
(even wordpad.exe has some quirks to watch out for).  CR/LF conversion is
possible to be done automatically when copying (text) files to unix, although
that has its problems and gotyas too.  But all this is another story.

Cheers
Tony





More information about the General mailing list