Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

genisoimage garbles filenames

Tags:

linux

rpm

iso

I am trying to build an ISO image for an offline RPM repository. I have the files and structure I need, but when I create the ISO image, the filenames are garbled:

ConsoleKit-32bit-0.2.10-64.65.1.x86_64.rpm

Becomes

ConsoleKit-32bit-0.2.10-64..r

I have tried this with the following options on the command line and had the same results:

genisoimage -f -U -o update.iso /data/iso
genisoimage -f -l -allow-lowercase -o update.iso /data/iso
genisoimage -f -l -allow-leading-dots -relaxed-filenames -allow-lowercase -allow-multidot -no-iso-translate -o update.iso /data/iso

Is there anything I might be missing that would allow the filenames to be preserved? This is critical for the ISO repo to work properly.

like image 986
MrDrMcCoy Avatar asked Dec 09 '22 04:12

MrDrMcCoy


1 Answers

As David Bugg's answer suggests, the flags you've enabled don't actually allow your file names to be their full length.

Pure ISO 9660 supports only 31 character file names, including a 3 character extension (genisoimage limits this to 8.3 format normally, but you're using -l which disables that limitation and allows the full 31). The file with the truncated name you mentioned was truncated to 29 characters including one character in the extension, so 31 including the two blank characters in the extension.

Joliet allows up to 64 unicode character names, and can be longer (103) with the flag David Bugg suggested. This however only works on Windows and to some extent Linux. The genisoimage man page suggests using -R (or -r which has better defaults for ownership) in addition since the Rock Ridge standard supports 255 byte file names and folder depths greater than 8 directories, and is a real standard unlike joliet.

There's no mention whether Windows supports Rock Ridge, but I doubt it does, so I'd recommend using both so Windows users don't mount the ISO in their drive to examine it and see broken file names.

add -J -joliet-long -r to your command and you should have no problems.

Final command updated from nakedhitman's comment:

genisoimage -f -J -joliet-long -r -allow-lowercase -allow-multidot -o update.iso /data/iso
like image 59
stonecrusher Avatar answered Dec 28 '22 01:12

stonecrusher