Customizing USB bootable IFL

User discussion and information resource forum for Image products.

Customizing USB bootable IFL

Postby timg11 » Thu Jun 30, 2016 9:07 am

I'd like to customize my IFL environment on my bootable USB.
Specifically, I'd like to set some of the [BACKUP_DEFAULTS] values normally found in ifl.ini. They are not saved from the running IFL environment back to the USB stick (even if it is writable). In addition, I'd like to have my network shares connect automatically. I assume I need a script to do that.

In the IFL manual, there is a section titled "Creating Customized Image for Linux Boot Media".

It seems to assume the creation process is done on a Linux system, using the makeHDD script.

Is it possible to customize the IFL environment when the USB is created with Makedisk.exe on Windows?
Could the ifl-custom.ini and config.txt files inside the config.zip be edited with my custom settings?

Also, is it possible to edit makedisk.cfg so Makedisk will default to my normally chosen options? Is the format of makedisk.cfg documented?
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby TeraByte Support(PP) » Thu Jun 30, 2016 11:06 am

In MakeDisk, use the "Traditional - ..... (Custom)" build type to have access to the options you need.

For the ifl.ini file with your custom settings, you would need to copy it into the folder with MakeDisk. One of the steps will give you the option to include it. Have the file configured with the IFL options you want.

To mount the network shares you would need to run a script on startup. This is done in a later MakeDisk step. The script would be in the "scripts" folder. For example, you could create a bash script to mount the shares.
-----------
#! /bin/bash
mkdir /mnt1
mount -t cifs -o username=username,password=mypassword //192.168.0.21/share /mnt1
mkdir /mnt2
mount -t cifs -o username="user name",password="my password" "//192.168.0.21/share 2" /mnt2
-----------

Change the log-in and share details to match what you have. Use quotes if they contain spaces.
Paul Purviance
TeraByte Support
TeraByte Support(PP)
 
Posts: 1089
Joined: Thu Aug 11, 2011 5:51 pm

Re: Customizing USB bootable IFL

Postby timg11 » Thu Jun 30, 2016 12:51 pm

Thanks for the quick reply....
TeraByte Support(PP) wrote:
> In MakeDisk, use the "Traditional - ..... (Custom)" build type to
> have access to the options you need.
>
> For the ifl.ini file with your custom settings, you would need to copy it
> into the folder with MakeDisk. One of the steps will give you the option to
> include it. Have the file configured with the IFL options you want.

So just copy the ifl.ini with my custom options into the same folder as iflnetgui-299.iso and makedisk.exe? No need to edit the ifl.ini inside the config.zip file?

>
> To mount the network shares you would need to run a script on startup. This
> is done in a later MakeDisk step. The script would be in the
> "scripts" folder. For example, you could create a bash script to
> mount the shares.
> -----------
> #! /bin/bash
> mkdir /mnt1
> mount -t cifs -o username=username,password=mypassword //192.168.0.21/share
> /mnt1
> mkdir /mnt2
> mount -t cifs -o username="user name",password="my
> password" "//192.168.0.21/share 2" /mnt2
> -----------
>
> Change the log-in and share details to match what you have. Use quotes if
> they contain spaces.

So just put the lines above (edited of course) into a file "myscript" and then copy that into the "scripts" folder that is at the same level as makedisk.exe. Then makedisk.exe will pick it up and include it on the USB?


Regarding custom settings, is it possible to edit makedisk.cfg so Makedisk defaults to "Traditional - You have control over options. (Custom)"? Similarly can other settings that differ from defaults be editing into makedisk.cfg?
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby TeraByte Support(PP) » Thu Jun 30, 2016 1:59 pm

timg11 wrote:
> So just copy the ifl.ini with my custom options into the same folder as iflnetgui-299.iso
> and makedisk.exe? No need to edit the ifl.ini inside the config.zip file?

The ifl.ini file would be in the same folder as makedisk.exe, makedisk.cfg, iflnet.iso, etc. No need to edit the version inside the config.zip file. When you go through the MakeDisk wizard you'll have an option to include the ifl.ini file. If you do, the wizard will skip the IFL option steps.

Note that if you want to create a more custom build that you would do it from Linux. This can be an installed Linux (e.g. Ubuntu) or even when booted to the IFL boot media. The process is different, but you have a lot more control over the Linux files. Also, there are scripts you can run so you don't really have to even deal with the config.zip file.

> So just put the lines above (edited of course) into a file "myscript" and then copy
> that into the "scripts" folder that is at the same level as makedisk.exe. Then
> makedisk.exe will pick it up and include it on the USB?

Yes. You also have to select an appropriate option to run the script. In your case, if you just have the one script, the easy option is just to pick to run all the scripts in the scripts folder. Otherwise, you could edit the scriptslist.txt file (in scripts folder) with a list of the scripts you want to run. To run them manually you can have a menu shown on startup.

As for the commands, you can boot to IFL and run them from the terminal to make sure they're correct first, if you want.

> Regarding custom settings, is it possible to edit makedisk.cfg so Makedisk defaults
> to "Traditional - You have control over options. (Custom)"? Similarly can other
> settings that differ from defaults be editing into makedisk.cfg?

It is possible to edit some of the options, but it's not supported. You would also have to do it every release since it would be back to the defaults. You could play around with it -- if it breaks you can always copy back the original.

If you want the "Traditional .... (Custom)" option selected you would make it be Prod0 and change the others to Prod1 and Prod2.
Paul Purviance
TeraByte Support
TeraByte Support(PP)
 
Posts: 1089
Joined: Thu Aug 11, 2011 5:51 pm

Re: Customizing USB bootable IFL

Postby timg11 » Fri Jul 01, 2016 4:01 pm

OK, got the ifl.ini working, but the script does not. When it comes up with a menu, it does nothing.
When I run the script from a terminal, the response is:
ifl:~/scripts# ./myscript
mount error(13): permission denied
refer to the mount.cifs(8) manual page.

From the terminal I tried:

sudo mount -t cifs -o username=username,password=mypassword //192.168.0.21/share

That replied with " bash: sudo: command not found"

I tried mount -h, and got a page of help, but no details on the -o options. It said for more help use "man 8 mount"

Then I tried:
man 8 mount
results in "bash: man: command not found"

I searched online and found http://man7.org/linux/man-pages/man8/mount.8.html,

In that particular article, the list of valid options for -o does not include "username" or "password"
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby timg11 » Sat Jul 02, 2016 7:50 am

I found better information here: https://www.samba.org/samba/docs/man/ma ... ifs.8.html

I discovered that commands of the form:
"mount -t cifs -o username=username,password=mypassword //192.168.0.21/share /mnt1"

result in Permission Denied.

However, issuing the command like this:
"mount -t cifs -o username=username //192.168.0.21/share /mnt1"
will request the password from the prompt. Entering it results in a successful connection. But that kind of defeats the original idea of auto-mounting the share without user intervention.

The article above says "Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line."
My password does not contain a comma, but it does contain other non-alphanumeric characters.
Last edited by timg11 on Sat Jul 02, 2016 9:02 am, edited 1 time in total.
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby timg11 » Sat Jul 02, 2016 8:24 am

I tried the method of setting an environment variable PASSWD to my password.
The set command shows me that the password string is truncated at the "$" character. I'll pretend the password is "Pa$$word" for the sake of discussion.
After issuing PASSWD=Pa$$word, the set command reports
PASSWD=Pa

I tried escaping the $ with PASSWD=Pa\$\$word, but then the value is stored with quotes:
PASSWD='Pa$$word'

That is apparently not acceptable, because the mount command still requests the password interactively from the command line.

I tried the other method to create a credentials file:

username=myuser
password=Pa$$word
domain=MyWorkgroup

saved as mycreds.txt

The mount command becomes:

"mount -t cifs -o credentials=mycreds.txt //192.168.0.21/share /mnt1"

This results in "error -1 (unknown error 42944967295) opening credential file mycreds.txt"

I tried it with credentials=./mycreds.txt and got the same error.
Last edited by timg11 on Sat Jul 02, 2016 9:18 am, edited 1 time in total.
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby timg11 » Sat Jul 02, 2016 9:01 am

I created a new account on my server for IFL backups. It has a password that is alphanumeric only.

I can set the environment variable PASSWD to that password, and it displays correctly.

However, the command
"mount -t cifs -o username=username //192.168.0.21/share /mnt1"

still interactively prompts for the password.


So I went back to try the form:
mount -t cifs -o username=username,password=mypassword //192.168.0.21/share /mnt1

Finally success!
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby timg11 » Sat Jul 02, 2016 11:44 am

I updated everything in the Makedisk environment and re-burned the USB IFL boot drive.

I set the option it to prompt for the script at startup. It does prompt, but the script apparently does nothing. The dialog doesn't close and nothing visible happens. I have to cancel to get out of the script running application. From there I can start a terminal and run the script successfully.

The next time I run makedisk, I'll try the option to auto-run the scripts, and see if that works better.
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Re: Customizing USB bootable IFL

Postby timg11 » Tue Jul 05, 2016 11:45 am

After further examination, I found that the script does run, but it gives no visible indication. The text-mode GUI remains unchanged, and there is no visible output or result.
timg11
 
Posts: 157
Joined: Sun Oct 02, 2011 9:31 am

Next

Return to Image for DOS/Linux/Windows