Storing Configuration Files
ariane is a CD linux. As soon as you shutdown the system or unplug the power cable your changes are lost. Especially the changes to your configuration files. But it's a simple truth that each linux system (and other computers too) needs more or less configuration which would then have to be done again after a reboot.
The config program
config configuration
Target locations
Loading files during the system boot
Writing the configuration to a TFTP server
The good news is that ariane comes with a script to read and write configuration files (or any kind of text files like your own scripts) to various removable media.
config's first parameter is the requested operation followed by (operation dependend) additional arguments:
config operation args
where operation is one of the following:
list-
lists the set of configuration files.
filesis a synonym forlist. load location-
load the configuration files from location.
write location- write the configuration file to location.
The files which should be handled have to be configured. config expects them to be listed in the file /etc/config.files. Each line may contain more that one filename which have to be then separated by white space. Otherwise each filename must on a line of it's own. Filenames without a directory part are expected to be in /etc. Directory names and wildcards are not permitted. Comments are allowed (usual UNIX-style), blank lines too.
config has a predefined understanding of some system configuration files. See the output of "config list".
The interesting part is the location parameter. This parameter controls to which device and directory the files are written. The location can be one of the following:
a:[directory]-
writes to the floppy disk drive prompting for the disk.
b:[directory]-
same as
a:but expects the floppy to be already in the drive. If it's not there config prompts for it. usb:[directory]-
write to an USB disk.
- any other linux device name
-
writes to the given device.
- directory name
-
writes to the given directory which must exist.
tftp:serverip:directory- writes to the given TFTP server, see below for details.
If writing to a device the optional directory is created if it doesn't exist. Furthermore, if config detects that it's writing to a dos of vfat filesystem, it will automatically use CRLF as line terminator.
"config read" accepts the same location parameters as "config write". The only difference is that "config read" uses the source location's list of files, not the system's /etc/config.files. Furthermore "config read" has an interesting option. If called with the "-r" option config expects as parameter the name of a directory to which it should import the files, e.g.
# config load -r /tmp/import a:/etc
will not overwrite the system's configuration files but put the files under /tmp/export.
Notice: If you want to break the "prompt for device" loop you have to enter a dash "-".
Loading files during the system boot
ariane can load it's configuration files during it's system boot. If it find the config boot parameter set it will interpret the value the following way:
yes-
loads from the boot device's /etc directory.
/directory-
if the value starts with a slash it's taken as directory on the boot device which contains the configuration files.
- any other value
- if passed as-is to the config program.
The only thing that does not work out of the box here is loading the files from a TFTP server. This requires that ariane is in a PXE boot, or at least in the (what I call the) "upper half" of a PXE boot, see below.
Writing the configuration to a TFTP server
Another option is to write configuration files to a TFTP server. This needs first some preparation on the server side.
root@server:~ > cd /tmp/tftp-server root@server:/tmp/tftp-server > mkdir etc root@server:/tmp/tftp-server > chown nobody etc
This example uses an ariane installation as server. The TFTP server has it's data root under /tmp/tftp-server and runs as user nobody. To allow clients to write to the server the TFTP server must have permissions on the files (it requires also options to in.tftpd but these are set in the start script). This is the reason the etc directory is owned by nobody.
Now on the client side do a
root@ariane:~ config write tftp:serverip:/etc
As you can see, the configuration files are now on the server:
root@server:/tmp/tftp-server > ls -l etc/
To reload them in case of a PXE boot you must add the config parameter at the boot prompt.
boot: linux config=/etc
If you are booting from CD-ROM but want to load the config files from the TFTP server the boot prompt parameter should be
boot: linux tftpserver=serverip config=/etc
ariane will then enter it's PXE startup sequence when it boots, see ArianeBootSequence.