Page 1 of 2

Customizing USB bootable IFL

Posted: Thu Jun 30, 2016 4:07 pm
by timg11
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?

Re: Customizing USB bootable IFL

Posted: Thu Jun 30, 2016 6:06 pm
by TeraByte Support(PP)
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.

Re: Customizing USB bootable IFL

Posted: Thu Jun 30, 2016 7:51 pm
by timg11
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?

Re: Customizing USB bootable IFL

Posted: Thu Jun 30, 2016 8:59 pm
by TeraByte Support(PP)
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.

Re: Customizing USB bootable IFL

Posted: Fri Jul 01, 2016 11:01 pm
by timg11
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"

Re: Customizing USB bootable IFL

Posted: Sat Jul 02, 2016 2:50 pm
by timg11
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.

Re: Customizing USB bootable IFL

Posted: Sat Jul 02, 2016 3:24 pm
by timg11
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.

Re: Customizing USB bootable IFL

Posted: Sat Jul 02, 2016 4:01 pm
by timg11
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!

Re: Customizing USB bootable IFL

Posted: Sat Jul 02, 2016 6:44 pm
by timg11
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.

Re: Customizing USB bootable IFL

Posted: Tue Jul 05, 2016 6:45 pm
by timg11
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.