Jump to content











Photo
- - - - -

Need help with 'mkisofs -sort'


  • Please log in to reply
21 replies to this topic

#1 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 01:18 AM

I'm going nuts here.
For the better part of 3 hours i try to change the order of files in a iso-image. First by trial end error then be googling.

Still, no matter what i do, no error message. But also no change in the image layout! :poke:

As a last resort, i downloaded a sort file for a PE and tryed it on NaughtyPE.
I even matched the case in the sortfile to the actual path - and file cases (one never knows with those Linux stuff) still no change. :poke:

Has anyone ever got this verfied working?


Also since i was unable to find any decent help on mkisofs. Maybe someone can answer a few questions for me.
- What is the range of the weighting?
- Is the sort file case sensitive?
- Does there need to be a specific end of line sign in the sort file or do all work?
- Does the sort file need to be ASCII or can it also be unicode?
- How do i get a detailed error log of what goes on with the sorting???

:poke: and good night!

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 09 February 2009 - 07:41 AM

Somehow related to this: ? :)
http://www.boot-land...?showtopic=6041


One of the original threads is here:
http://www.911cd.net...?showtopic=8053

Please :poke:, don't tell me that you tried to use directly pe_sort.txt to "feed" mkisofs. :poke:

Check the my_additional_commands.cmd here:
http://www.911cd.net...w...c=8053&st=1
This part may be of interest to you:
::=================

:: Generate Sortlist dynamically

::=================

echo generating sorting list automatically from pe_sort.txt

echo pe_sort.txt :  "%PEUtilsPath%\pe_sort.txt"

echo;generated automatically from pe_sort.txt > %my_temp%\pe_sort_temp.txt

echo;pe_sort.txt :  "%PEUtilsPath%\pe_sort.txt"  >> %my_temp%\pe_sort_temp.txt

FOR /f "tokens=1*" %%a IN ('date /t') DO echo; Date: %%a >> %my_temp%\pe_sort_temp.txt

FOR /f "tokens=1*" %%a IN ('time /t') DO echo; Time: %%a >> %my_temp%\pe_sort_temp.txt

echo;----------------------------------------- >> %my_temp%\pe_sort_temp.txt



FOR /f "tokens=1*" %%a IN (%PEUtilsPath%\pe_sort.txt) DO echo %Outdir2%/%%a %%b>> %my_temp%\pe_sort_temp.txt

set mkisofs_option=%mkisofs_option% -sort %my_temp%\pe_sort_temp.txt

:poke:

Would it be possible that the particular build of mkisofs you are running does not support -sort switch? :poke:

jaclaz

#3 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 08:07 AM

Would it be possible that the particular build of mkisofs you are running does not support -sort switch? :poke:

Since mkisofs -help shows me the -sort parameter, i assume that it works.

Will post back when i had a chance to go through your links.

:poke:

#4 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 08:16 AM

Somehow related to this: ? :poke:
http://www.boot-land...?showtopic=6041

No, not related to that.

Please :poke:, don't tell me that you tried to use directly pe_sort.txt to "feed" mkisofs. :poke:

What do you mean?

:)

#5 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 08:37 AM

So, i now finally found the help for the -sort parameter. It's in a file called Readme.sort. (:poke: Why do i need an extra file to get the help for a comandline tool?) Anyway it doesn't help one bit. :poke:

The way i understand it, the sort files needs to have the path and filename as they look from inside the folder which contains all the files that should end up on the CD. No matter where mkisofs.exe or the sortfile are located. Right?

:poke:

#6 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 09 February 2009 - 08:55 AM

That is the help for genisoimage, not for mkisofs. :poke:

http://www.math.temp...isoimage/README

Cdrkit carries a fork of the mkisofs program called genisoimage.


Please :poke:, don't tell me that you tried to use directly pe_sort.txt to "feed" mkisofs. :poke:

What do you mean?


The given example uses pe_sort_temp.txt and not pe_sort.txt as "target" for the -sort switch.

Try to adapt the batch snippet in order to create a pe_sort_temp.txt out of a pe_sort.txt....

Hint :):

FOR /f "tokens=1*" %%a IN (%PEUtilsPath%\pe_sort.txt) DO echo %Outdir2%/%%a %%b>> %my_temp%\pe_sort_temp.txt


jaclaz

#7 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 01:10 PM

Somehow seem our personality halfs are misaligned today. :poke:
I don't want to sort a pe and i don't want to automaticly create a sortfile for a PE.
I just tryed a sortfile for a PE to see if i might screwed my sort file up.

As far as i can tell, i did everything right, yet still the order is never changed.

Has nobody ever done this and checked if it really worked?


:poke:

PS:

That is the help for genisoimage, not for mkisofs.

Where do i find the help for the right mkisofs?

#8 dog

dog

    Frequent Member

  • Expert
  • 236 posts

Posted 09 February 2009 - 01:17 PM

- What is the range of the weighting?
Apparently it's -2^31 to 2^31, only ever seen +-8000 used though
- Is the sort file case sensitive?
Doesn't seem to be
- Does there need to be a specific end of line sign in the sort file or do all work?
CRLF works for me
- Does the sort file need to be ASCII or can it also be unicode?
I've only tried ascii


I hard code mine, works for being able to ram load just i386 or with programs as well, if that's what you're trying?
http://www.boot-land...?...ded&start=#
http://www.boot-land...?...ed&start=0#

; sort.txt

; use single space or tab between file or dir and weight

; weight is end of line, no other space or chars

; high sort first, use -2^31 to 2^31, default is 0

; if dir, all files in dir and subdir get weight

; cd written from center

; overriding weight for later dirs fails 

; 

P:/bart/pe/output 1000

P:/bart/pe/output/I386 900

P:/bart/pe/output/PROGRAMS 800

P:/bart/pe/output/0 -1

P:/bart/pe/output/pup41 -2

P:/bart/pe/output/ping -3


#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 01:40 PM

I just tested pebuilder with Sherpyas build scripts. Same effect.
With or without sort.txt the images are identical except for a few timestamps.

@dog
I see you use absolute paths in your sort.txt. Which is the folder holding the data to be burned?

I used in my sort.txt only

i386\txtsetup.sif 5000

instead of

D:\BootBuilder\Winbuilder\NaughtyPE\Target\NaughtyPE\i386\txtsetup.sif 5000

Is this the problem?

:poke:

#10 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 02:32 PM

Ok, unless someone tells me that this sort feature does not work on XPSP1, i can not see how this has ever worked for anyone.

4 differenet tools to create a sorted PE and the sorted and unsorted iso are always the same. :poke:

#11 dog

dog

    Frequent Member

  • Expert
  • 236 posts

Posted 09 February 2009 - 04:14 PM

It definitely does work with mkisofs version 2.01.01a42, with sort.txt in the same dir, and run with
-sort full-path-to-sort.txt
output\ held all the data to be burned, in the example before
You should swap the slash directions in sort.txt - windows uses \ but cygwin expects /

#12 cdob

cdob

    Gold Member

  • Expert
  • 1450 posts

Posted 09 February 2009 - 04:17 PM

Yes, 'mkisofs -sort' is a challenge.

Some parts are solved already and repeated anyway.

Also since i was unable to find any decent help on mkisofs.

Get the source code. http://cdrecord.berlios.de/
There is a readme.sort with requirements and examples.
readme.sort is from 2001 still.

Basically source file names at hard disk are used to sort files.
Given command line glob and sort list has to match.

Which 'mkisofs -version' do you use?

Remember mkisofs is unix application by design: '\' is a special char. '/' split directories.

Yes, file case is sensitive.
I got annoyed at a windows version and changed source code in 2005.
http://www.911cd.net...&...ost&p=71506
Current changes are at find.c and match.c.

Static sort list:
change directory first and and use . as glob.
Use ./I386 at sort directory.
This solution is used by UBCD4Win.

Or use 'Generate Sortlist dynamically' as jaclaz indicated.
This solve both: glob and file case.

Use a ASCII sort file.

i386\txtsetup.sif 5000

Won't work: \ is not a char

D:\BootBuilder\Winbuilder\NaughtyPE\Target\NaughtyPE\i386\txtsetup.sif 5000

This may work

D:/BootBuilder/Winbuilder/NaughtyPE/Target/NaughtyPE/i386/txtsetup.sif 5000

However: which command line do you use?

Again: both command line and sort file are importand.

#13 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 05:11 PM

OK the slashes i screwed up in my sort file, so i will have to test it again. But the other PE sort files have the right kind of slashes and still don't work.

It definitely does work with mkisofs version 2.01.01a42,

How can i find out which versions of mkisofs, i have? It does not seem to sport the version number anywhere. :poke:

Commandline:

mkisofs.exe -iso-level 4 -sort sort.txt -force-uppercase -volid NaughtyPE -b bootsect.bin -no-emul-boot -boot-load-size 4 -hide bootsect.bin -hide boot.catalog -duplicates-once -o NaughtyPE-sort.iso .\NaughtyPE

mkisofs.exe, sort.txt and Bat are in %TargetDir%

The sort.txt goes like this (not complete):

bootsect.bin 567
i386/setupldr.bin 566
bootfont.bin 565
ntdetect.com 564
i387/blabla.exe 560
i386/system32/txtsetup.sif 563
i386/system32/biosinfo.inf 562
i386/system32/halaacpi.dll 561
i386/system32/ntoskrnl.exe 560
i386/system32/ntkrnlmp.exe 559
i386/system32/kdcom.dll 558
i386/system32/bootvid.dll 557
i386/system32/setupreg.hiv 556
i386/system32/vgaoem.fon 555
i386/system32/vga850.fon 554
i386/system32/c_1252.nls 553
i386/system32/c_437.nls 552
i386/system32/c_850.nls 551
i386/system32/l_intl.nls 550
i386/system32/drivers/setupdd.sys 549
i386/system32/drivers/spddlang.sys 548
i386/system32/drivers/pci.sys 547
i386/system32/drivers/acpi.sys 546
i386/system32/drivers/wmilib.sys 545
i386/system32/drivers/isapnp.sys 544
i386/system32/drivers/acpiec.sys 543
i386/system32/drivers/oprghdlr.sys 542
i386/system32/drivers/ohci1394.sys 541
i386/system32/drivers/1394bus.sys 540
i386/system32/drivers/pcmcia.sys 539
i386/system32/drivers/pciide.sys 538
i386/system32/drivers/pciidex.sys 537
i386/system32/drivers/intelide.sys 536
i386/system32/drivers/viaide.sys 535



#14 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 05:31 PM

If the readme is exact, i think i found the problem.

The command:

mkisofs -o cdimage.iso -sort sort_file cd_dir

will sort the above file data as:

cd_dir/dir2/Y
cd_dir/dir2/X
cd_dir/dir2/Z
cd_dir/dir1/C
cd_dir/dir1/B
cd_dir/dir1/A

Note: files 'X' and 'Z' both have the weight 1000 - their sort order will then
be the normal ISO9660 sort order (i.e. alphabetical in this case).

File C will have the default weight of 0

Warning: the filenames in the sort list MUST match the whole path as seen by
mkisofs. i.e. in the above case, if the command line was:

mkisofs -o cdimage.iso -sort sort_file ./cd_dir

then the sort_file filename will have to changed as accordingly.


The name of the Dir given in the commandline, has to be exactly like this in the sort.txt.
Not a single sort.txt i have, has ever done this. :poke:

:poke:

#15 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 06:15 PM

Confirmed!
If the commandline states NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting works.
But if the commandline states .\NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting is skiped.

Strangely if the commandline states ./NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting works too, but the created iso is not identical to the one created with NaughtyPE as path. :poke:

:poke:

#16 cdob

cdob

    Gold Member

  • Expert
  • 1450 posts

Posted 09 February 2009 - 06:55 PM

If the readme is exact, i think i found the problem.

Yes, the readme describe requirements.

The name of the Dir given in the commandline, has to be exactly like this in the sort.txt.
Not a single sort.txt i have, has ever done this.

Mkisofs allows collecting different source directories.
In addition you may redirect target using -graft-points.
Overall requiremenst maybe strange, but make sense.

If the commandline states NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting works.
But if the commandline states .\NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting is skiped.

Use commandline ./NaughtyPE as folder and sortfile ./NaughtyPE/i386...
Commandline and sortfile has to match.

Strangely if the commandline states ./NaughtyPE as folder and the sortfile reads NaughtyPE/i386... sorting works too, but the created iso is not identical to the one created with NaughtyPE as path.

What's different?

Which 'mkisofs -version' do you use?

Open a command prompt, change directory to mkisofs directory, enter:
mkisofs -version

#17 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 07:41 PM

What's different?

The placement of the files.

Used versions (all) are mkisofs 2.01-bootcd.ru (i686-pc-mingw32)
Must be quite popular, that every project includes the same file. ?

And if my non existing Linux knowledge serves me right, mingw32 means mkisofs is not case sensitive.


:poke:

btw. UBCD4Win does not use mkisofs, it uses cdimage.

#18 cdob

cdob

    Gold Member

  • Expert
  • 1450 posts

Posted 09 February 2009 - 08:14 PM

Used versions (all) are mkisofs 2.01-bootcd.ru (i686-pc-mingw32)
Must be quite popular, that every project includes the same file. ?

Yes, that's the old unofficial release. I don't use this version.
Not supported since 2004. Timestamp bug is included still.
Do you use a infcache.1 at NauphtyPE? Don't you like a valid infcache.1?

And if my non existing Linux knowledge serves me right, mingw32 means mkisofs is not case sensitive.

I doubt this. http://www.911cd.net...?showtopic=6869

btw. UBCD4Win does not use mkisofs, it uses cdimage.

I doubt this strongly. I enabled 'mkisofs -sort' at UBCD4Win.
http://www.ubcd4win.com/

#19 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 08:51 PM

Yes, that's the old unofficial release. I don't use this version.
Not supported since 2004. Timestamp bug is included still.
Do you use a infcache.1 at NauphtyPE? Don't you like a valid infcache.1?

Sure would love to, if it's broken. :poke:
Where do i get a better version, which is precompiled for windows?

I doubt this strongly. I enabled 'mkisofs -sort' at UBCD4Win.
http://www.ubcd4win.com/

Sorry little typo. Not cdimage, cdrecord. (UBCD4Win 3.22)

:poke:

#20 cdob

cdob

    Gold Member

  • Expert
  • 1450 posts

Posted 09 February 2009 - 10:10 PM

Sure would love to, if it's broken. :poke:

Read the whole story from Nov 2004
http://www.911cd.net...?showtopic=9431

Summary
http://www.boot-land...?...ost&p=14216

Actually I feel responsible for this too.
I recommended mkisofs mingw32 version to Bart too.

Alex, the author of this mkisofs version and BCDW, released this version in summer 2004. And Alex disappeared in autum 2004.
Daylight saving bug was detected at winter 2004. The first winter time change after release.

Paraglider does use this for HWPNP: mkisofs2.01-bootcd.ru-cygwin.zip
http://www.paraglide...links/links.htm
That's Alex source files compiled at cygwin.

In addition there are Alex diff included to current source code. Cygwin compiled.
Sorry at localhost only so far.

Be aware there is a big drawback: cygwin1.dll is required.
There are different cygwin1.dll versions and possible conflicts.
The dll is backward compatible, use a current cygwin1.dll version.
http://www.cygwin.com


Another approach within old mingw32 version:
Thread at 911cd mention another solution:
change local time settings temporary, build ISO image, restore time settings.

#21 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 February 2009 - 10:54 PM

I did a test. NaughtyPE without XPE sort.txt with 'old' mkisofs against NaughtyPE with XPE sort.txt and recommended mkisofs from paragliders page.
And the result is ... :)
An improvement of 3 seconds! :poke:

At an overall boottime of a little over 4 min, that's even within the margin of error. :poke:
I would really like to know, what kind of drives those use, who claim to be able to load a full XPE in two and a half minutes.

And just in case anyone cares. The project which started this all also went nowhere. The stupid mp3 alarm clock does not care about the order of files just the order of the names. :poke:
Well, was a longshot anyway, but that it took a whole 24 hours to do a simple check if it would work? :poke:

:poke:

#22 cdob

cdob

    Gold Member

  • Expert
  • 1450 posts

Posted 10 February 2009 - 09:08 PM

An improvement of 3 seconds!

As for textmode boot, I expedted 10 to 20 seconds.

Do you have a setupapi.log? This may proofe a valid infcache.1
Watch for opened *.inf files. There should be less files opened, not all at everytime PNP device.

I would really like to know, what kind of drives those use, who claim to be able to load a full XPE in two and a half minutes.

Well, not a full XPE:

Plextor Premium, 8 MB internal cache
Verbatim High Speed CD-RW
BartPE
havily edited XPE plugin
no dll registration at boot
special 'mkisofs -sort' file for this machine
basic PNP: Nvidia Quadro 2 graphics card, 3com 905 network card and crystal sound card
no network connection loaded

Boot time from setupldr.bin to dektop:
1 minute, 38 seconds


'mkisofs -sort' is the last step. This may reduce boot time at seconds.
If you seek minutes, you have to search more thorougly.

There is bigger difference at drives with long acess time:
ususally notebook drives.


Add a watch to each RunOnceEx entry:
echo name RunOnceEx %date% %time% >> %temp%\time.log

Find the longest task first. Try to elimiate long tasks first.


The project which started this all also went nowhere. The stupid mp3 alarm clock does not care about the order of files just the order of the names.

To bad, names has to be sorted at CD.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users