Jump to content











Photo
- - - - -

Is it possible to Script specific disk filter drivers?

e2b easy2boot pe3 win7pe

  • Please log in to reply
14 replies to this topic

#1 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 05:50 AM

A few months back I made an awesome custom multi boot drive using the awesome 'easy2boot' tool by Steve, it worked perfectly based on using iso files mostly. I recently got a new jump drive and instead of copying everything directly over, I noticed e2b has been updated and supports uefi now if you use a new image partition thing Steve has developed (kudos to him btw great developer), so I am updating my setup as I am  loading the new drive.

 

anyway in my testing of the new way he has to easy2boot working, I see it dose some fancy partition mapping and prevents access (sort of by design due to necessity of what is being accomplished) to the normal files on the e2b drive.

 

Problem is most of my bootable environments look to that as I keep a mass of driver packs there for maximum pc support (6gigs of drivers), to add them to the image of each environment that uses them would be highly redundant and prevent normal windows from also benefiting if some driver is missing.

 

Doing some research I found a way to make a removable drive have 2 partitions, and found a filter driver that masks the removable disk as a local disk.(it works in 64 bit pe3, found another same folks supposedly for 32 bit haven't tested yet, oddly full windows says better driver already present and wont load it but I have an idea how to deal solve not the problem but the effects that I care about) However in various PE3 builds I need this driver (a ini & sys file) to find a very particular flash drive (the one its booting from) and get loaded as its driver by some manner of scripting.

 

Alas I don't know how to even attempt to install a driver via script much less detect the proper drive, I suppose it could be hard coded some how via device ID or something, any help on this would be Greatly appreciated.

 

Attaching the 64 bit drivers (I know where to find but have not yet procured the 32 bit drivers)(ok apparently only the ini as the .sys file isn't allowed to be uploaded...)

Attached Files



#2 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 06:14 AM

Just to clarify a few points regarding what I have done and some informative tidbits for people who haven't messed with partitioning flash drives, this follow up post is to head off some questions I expect most.

 

Flash drives and/or removable drives in windows generally do not have more then 1 partition and windows will not recognize any but the first. however Steve's RMprep tool can manipulate which partition if multiple are present windows sees as the first.

 

I have found a way to put make 2 partitions making the first partition have all the bootable stuff, second partition to have all the driver files diagnostic tools and program installers, going to make the first partition be bootable & use rmprep to make windows see the second partition and be able to use its files. This works for a installed windows and has the added benefit of protecting the bootable portion from tampering.

 

However when booted to one of the pe3 environments partition 1 is in active use by them and partition 2 has drivers they need to access, the solution is a filter driver that makes them think its a local non removable drive that is allowed to have multiple partitions and use them. Problem to that solution is a bunch of scripts run at pe3 startup to load the drivers they cant see until that filter driver is applied, adding another script is trivially easy but this is a script I do not have a clue how to write.



#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 September 2014 - 09:14 AM

I am not sure to understand what your question is.

 

JFYI, nowadays it is more common to use this other filter driver which adds a couple of "characteristics":

http://reboot.pro/to...-usb-hard-disk/

that cfadisk does not provide. (pagefile, windows update and "external removable" seen as "internal"):

See also:

http://agnipulse.com...d-disk-windows/

and:

http://www.911cd.net...showtopic=24419

 

Generically speaking, installing a driver to a PE 3.x is pretty much straightforward, you just service the .wim:

http://www.windows-n...ustom-winpe-30/

 

(if this is the question :unsure:)

 

:duff:

Wonko



#4 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 06:23 PM

Thanks wonko for the other options I will research them to see what they offer.

 

As for my question I don't want a blanket driver to be applied to every removable device that happens to be plugged in. So I want a script that finds the specific flash/removable drive that the PE was loaded from (or some hardware ID could be used as I dont foresee switching phisical drives often and once I understand how to do this, when I do swtich editing shouldnt be a problem), and after finding the drive the script would then apply cfadisk or one of these others just to that drive. leaving other removable drives with the normal driver.



#5 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 06:52 PM

wonko based on the info provided in the link  http://www.windows-n...ustom-winpe-30/ and other research and the fact I had to edit CFA's ini file for it to work with usb drives, is there a way to edit this driver to be specific to the flash drive I want via the .ini file so that then inserting it in the way the linked to post would result in an automatic effect?

 

Also I came across the http://agnipulse.com...d-disk-windows/ before my first post, upon reading the comments I saw that most of the options did not work or had significant issues in 64bit builds, however I found a link to a german forum (which as I dont read german was 'fun' to sign up/ register for just so I could download a file) where a 64bit version of cfa was available.



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 September 2014 - 06:57 PM

The filter driver can be "applied" to both a "generic" class or to a specific device.

cdob :worship: posted about this (generic class):

http://www.msfn.org/...er-integration/

And online detailed at length on the "specific device":

http://reboot.pro/to...-logical-drive/

 

So you don't really want to "integrate" it but rather "load on demand", you will need basic scripting knowledge, more or less it amounts to:

  1. make sure the filter driver is NOT installed (and if it is uninstall it)
  2. make a "dedicated" .inf file with the specific USB VID/PID
  3. install the filter driver through the "customized" .inf

 

 

:duff:

Wonko

 

P.S.: If you want to attach something, compress it in a .zip or .7z archive and attach the archive NOT a binary file!



#7 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 08:46 PM

@ wonko

I am still seeing what I can learn from the links your provided and thank you!

 

You did hit the nail on the head for the 'load on demand' tidbit instead of just integrated, the purpose of this post is to get help writing such a script.

 

I have seen some truely amazing scripts the ones I have wriiten are not amazing like those, the ones I have written for myself accomplish what I try to do but are generally one command after another.

 

if loops, conditionals, auto directories eg. $win$, and all the more programtic scripting I have toyed a little with sometimes getting it to work sometimes finding an alternate solution to whatever I am up to but I generally dont make scritps like that as I dont have an exapansive enough scripting vocabulary and any error in my lame scripts takes more effort then it should to find (I am always learning and one day hope to be able to script with the best, but I also tend to learn as I need something for a project I am working on, often itself a learning experience).

 

However a script to install somthing and detect something are out of the leauge I currently reside in, so I am asking for a bit of help in that regard. Wonko you did hit the nail on the head for the idea though.



#8 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 14 September 2014 - 11:58 PM

I believe dpinst is part of my pe3 builds as I am thinking its part of winbuilder w/ was the cornerstone of how I made them.

 

came across this bat script line on some site researching 'c:\drivers\dpinst.exe /lm /path C:\drivers\pnp' which gives me a clue how to use it in a bat script, I also found a list of cmd switches it supports including /f to force install even if better driver already present.... I think this info + adding the pid/vid to the inf may be the key, will be testing this shortly. I hope it works, and I hope that if it does I dont have to figure out how to script the assigning of a new drive letter, which may happen.

 

Any input or advice from wonko or anyone else in the peanut gallery is appreciated!



#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 September 2014 - 08:39 AM

Well, there is no real need for dpinst, I believe. :unsure:

 

The "clever" part should be checking the conditions, and detecting the hardware to create the "custom" .inf file, a "generic filter driver" should not behave much different from a "Filesystem Filter driver", rundll32 should be good enough :dubbio::

http://msdn.microsof...1(v=vs.85).aspx

 

Maybe, just maybe, these batches here (and related .inf information):

http://reboot.pro/to...wimtoolbatches/

 

can give you some ideas.

 

:duff:

Wonko



#10 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 18 September 2014 - 07:27 PM

between work and school I haven't been able to touch this project in a few days, anyways my work in progress script (most of it works and while the portion of it dealing with the drivers does not return an error it also does not affect a change as both device and disk manager show no change before vs after)

@ECHO OFF
echo ***********************************************
echo ** Standby, Initializing Secondary Functions **
echo ***********************************************

for %%a in ( b c d e f g h i j k l m n o p q r s t u v w x y z) do (
IF EXIST %%a:\X64.id SET Dir=%%a:)

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultunInstall 132 %Dir%\usbdrive\disk.inf

ping 127.0.0.1 -n 10

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 %Dir%\usbdrive\cfadisk.inf 

ping 127.0.0.1 -n 10

%Dir%"\e2b\RestoreE2B (run as admin).cmd"

ping 127.0.0.1 -n 10

for %%b in ( b c d e f g h i j k l m n o p q r s t u v w x y z) do (
IF EXIST %%b:\usb1.id SET usb=%%b:)

imdisk -a -o cd -f %usb%\_ISO\Diag\1OmegaPE.imgPTN -m #:

ping 127.0.0.1 -n 2

for %%a in ( b c d e f g h i j k l m n o p q r s t u v w x y z) do (
IF EXIST %%a:\X64.id SET Dir=%%a:)

%Dir%\optin\CMD\init.cmd

Prior to this attempt to update all this script did was call the other init script, in order to be run the way I want it to be run it has to be in the wim file, but that adds a level of tediousness to editing it, so I have a simple script in the wim that calls an a easier to edit script in the iso file.

 

I discovered that the partition mapping that e2b does prevents the rest of the drive including the other partition from being accessible regardless of driver(I had assumed the partition mapping e2b does for this would only affect partition 1.). My solution to this problem is to run the e2b script that undoes the mapping and then use imdisk to remap the image file to an available drive, as PE3 boots into a ramdisk and all my scripts in this project check for drive letter, the bootable media can be removed or moved with out causing issues.

 

So the idea of this script is to install the driver that lets multiple partitions to be seen, unmounts the e2b partition map that prevents the drives other partitions from being seen as even existing, remounts the image file that was previously mounted via partition map via disk drive virtualization thus still allowing access to the image file while also allowing full drive control. (The pings are just a safety to buy time for a task to finish) I also had attempted to modify the disk.inf so that running the uninstall cmd wouldn't uninstall every drive (see attached)

 

alas though while there does not seem to be an error the desired change does not appear to happen also this is far from the idea install on demand method I would like as if any other flash drive are plugged in they too would be affected.

 

advice, tips ideas?

Attached Files

  • Attached File  disk.inf   11.75KB   5 downloads


#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 September 2014 - 09:02 PM

WHICH driver is disk.sys?

WHERE does it come from?

WHAT is the scope of that driver?

 

(it seems like the standard generic disk.sys driver, for which there is no reason AFAIK to be installed or uninstalled at all)

 

WHAT has  a virtual volume mounted through IMDISK have to do in all this?

WHERE is the CFADISK.INF?

 

About the batch, you will find issues if you happen to have one of those machines with a combo CF card/SD card reader.

 

See starting from here:

http://www.msfn.org/...image/?p=895119

http://www.msfn.org/...72#entry1005836

 

More generally, a good idea is to NEVER, for ANY reason use a file or path with a space or brackets in the file name (nor any other "strange" characters) in a batch script, as - before or later - this will "bite you". 

 

:duff:

Wonko



#12 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 20 September 2014 - 04:09 AM

Sorry for the late reply and the ambiguity in my prior post.

 

Disk.inf appears to be the default driver for the flash drive before doing anything, it is also the default driver for all the disks in the system. I modified the disk.inf commenting out all devices already listed and added the same usbstor/gendisk I had to add to cfadisk the idea being/hoping that by modifying the uninstall would remove it from being installed for the flash drive but not remove it from the other disk drives.

 

Also I was aware of the bug where CF card readers stall it out, it was posted by someone (I think you) on the forum page where I was conversing with Steve when I was first putting my first multi-boot jump drive together using e2b around last November. However, I have never ran into that problem as yet (don't work on many computers with those).

 

the current version of e2b with the file format I am using, it takes the image file and adjust the MBR of the flash drive in such a way to point to the image file and say in-fact that file is a partition in doing so it renders the rest of the drive temporarily in-accessible the script with the spaces re-modifies the MBR back to normal, this whole scheme is Steve's way of make uefi boot work. As once booted pe3 no longer relies on the bootable media to keep going as its in a ram-disk so running the script to undo the MBR mapping poses no issue. however there are a few tools in my pe3 that are really scripts to install silently on demand (as I couldn't make them persist reboot when building said PE3) said scripts do rely on files in the disk image so if I am going to use them the disk image must be mounted somewhere someway. As its safe to remove the MBR map & I want access to my jump drive I do run the script for that, but as I do want access to files in the image I am using IMDISK to remount said file elsewhere (next available drive letter) so if needed it can be used.

 

the spaces I tried to remove by renaming the script in question but it would not run when so renamed so I had to improvise(I have not yet looked into its code to see if that could be fixed.).



#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13752 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 September 2014 - 08:27 AM

You are IMHO trying to do too many things at once, which usually turns out as *nothing good*.

You should (temporarily) forget anything about Easy2boot, the *whatever* it does to partitions, the IMDISK mounted volume and just have the CFADISK (or whatever other fiter driver) working on a plain, simple multi-partitioned USB thingy.

Leave alone disk.sys, that is a driver, it is needed and it is usually fine "as is".

A filter driver is something that is installed "additionally" to the device driver, not "instead" of it.

Imagine an inline filter in a pipe, water (containing impurities) flows towards the filter and on the other side of the filter water is cleaner as the filter captures these particles, specific types of filter may be able to filter only particular kind of particles or transform them into another type of particle.

A filter driver works similarly, it is placed in the "pipe" between the device and the OS, whenever from the device a particle of the type "Hi, I am removable" is sent through the pipe, the filter captures it and lets pass through a particle of the type "Hi, I am fixed".

:duff:
Wonko

#14 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 20 September 2014 - 11:51 PM

As for trying too much, if I was developing  my PE3 from scratch trying to get it to work and so on I would quite agree with you!

 

However I used winbuilder last november applied the wim to a vmware hdd installed apps used regshot imported changed reg entries manually to the registry store, created silent install scripts for applications that created services I couldnt figure out how to preserve their installation over reboot so and gave said scripts a icon and place in the startmenu so it would appear and work as if installed though first launch would take a bit longer. I also troubleshooted all boot issues and related. This was all last november and it has worked as intended sense then. This project amounts to making use of new e2b features and learning new skills by adapting an exsisting working project.

 

If I wanted to keep the status quo and keep the images as .iso files and keep my drive compatible with only MBR systems, I could just copy my old usb drive to my newone.

 

The point of this project which results in 'me doing to much' was to change the file fromat from .iso to .imgpart which e2b maps as a partition via mbr to make it compatible with uefi system, but renders all data not contained in the .imgpart image file inaccessible which includes the driver packs the PE3 looks for. Creating the second partition I had hoped would provide a seprate area that it could still be read from however said mapping makes the entirety of the rest of the drive inaccessible regardless of partitioning, hence my 'unmounting' to make the drive reaccessible and using imdisk to still have access to the image file as needed.



#15 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 21 September 2014 - 12:00 AM

which now that I wrote that prior post and step back to think about it, if I scrap the multi partition idea sense its intended function straight up didnt work anyway, drivers and filter drivers becomes a moot point and its just a game of unmounting the partition mapping and remounting via IMDISK.







Also tagged with one or more of these keywords: e2b, easy2boot, pe3, win7pe

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users