Run A Script Automatically from USB

Black Hole

May contain traces of nut
I'm searching for a way to automate not just CF installation but configuration as well, as a means to remove the uncertainties when it's in the hands of the technically naive.

Bundles install automatically, but I can't find any documentation. Do they contain a script which could be modified to one's own needs?
 

xyz321

Well-Known Member
A bundle is just a collection of packages contained within a tarball, so it is probably not what you want.

A single package can be setup to run a script on installation so that might be one option.

There are also signed packages which will run scripts (e.g. the enable and disable safe mode packages) but they have to be signed with the private key.

Another option might be to create a diagnostic script and submit it to af123 but it would only be available when connected to the internet.
 
OP
Black Hole

Black Hole

May contain traces of nut
Hmm, yes, I had a distant recollection of that being there. It is going to require a degree of study I can't really process at the moment.

Anyone up for some hand-holding? I figure "all" I need to do is configure a system as required, then just zip up the /mod tree and find a way to automagically unzip it to root on the target system (without user intervention). If that's by cooking up a .opk containing a preinst to check for non-existence of /mod and then do the unzipping, so be it.

It strikes me this could be a handy little tool: a universal .opk which, when added to a UPD containing a .zip (or .tar) simply loads the .zip contents to the HDD.
 
OP
Black Hole

Black Hole

May contain traces of nut
It's dawned on me that won't work, because of bits installed to flash and markers placed outside /mod. Perhaps what I need is a bundle of all the relevant packages plus a custom package containing a specially crafted postinst.

Comments?
 

bottletop

Active Member
So you wish to completely automate and configure a custom firmware install?
Similar to unattended install in Windows?
Do you wish to also do it remotely without your direct access to the HDR?
If so, there's a couple of sticking points
  • there's a chance an old HDR may have remnants of an old CF install and not properly removed (i.e. maybe system flush then overwrite certain hard drive areas on initial install)
  • you'll probably rely on auto IP setting and may need to retrieve that IP later
  • how will you verify it's installed and configured correctly? Won't you need to log into the HDR?
 
OP
Black Hole

Black Hole

May contain traces of nut
So you wish to completely automate and configure a custom firmware install?
Yep. No network.

Do you wish to also do it remotely without your direct access to the HDR?
Just by sending a UPD with some simple instructions.

there's a chance an old HDR may have remnants of an old CF install and not properly removed (i.e. maybe system flush then overwrite certain hard drive areas on initial install)
I shouldn't think so. The CF will need to be flashed, which should take care of that. The only risk (in my proposed scheme) is if there's a pre-existing /mod.

If somebody auto-installs a package or a bundle by USB, what prevents the system repeatedly running the install?

you'll probably rely on auto IP setting and may need to retrieve that IP later
No network.

how will you verify it's installed and configured correctly?
By testing and retesting before dispatch, and then fingers crossed.

All I aim to install and configure is ntfs-3g, auto-unprotect, and recursive autodecrypt. That would be one hell of a lot easier if unencrypt had been maintained as a stand-alone package. It seems to me there is a use-case for a self-contained version of CF which comes with those facilities and requires no user intervention or network (yes, I know it will require a loopback).
 
Last edited:

/df

Well-Known Member
The CF looks for packages (.opk) in the root of any removable drive that it finds after a /mod Ext2/3 filesystem has been mounted. Packages are copied to a directory under /tmp and installed.

The CF will also install signed packages (.spk) regardless of /mod. Such a package is a tar archive that may contain an archived and/or a script or program. In each case a signature file must also be present that (I believe) is verified against the Hummy repository public key /etc/hpkg.key by /sbin/spkg. A valid (correctly signed) archive is extracted over the root directory; a valid script or program is made executable and run in the root directory. Of course this is only useful for someone who has the private key and signing utility.
 
Top