|
From: Tim T. <t....@co...> - 2004-05-21 04:13:43
Attachments:
save-config
save-config.diff
|
This patch includes the following:
1. Adds new command switches, and this help output:
save-config [-hqs] [-d DEVICE] [-f FILE]
Saves the Devil-Linux configuration (/etc and /root trees) to a
bzip2 compressed tar file.
By default, the file loaded during boot will updated.
-d <devicename> Device to use for configuration file.
-f <filename> Name of configuration file (default is
"etc.tar.bz2").
-h This help text
-q Quiet operation, no status ouput.
-s Force search of all devices for configuration file.
2. Deterministic save location - By default, the /shm/DL_CONFIG_SOURCE
file exists (created by linuxrc during boot), the device listed inside
is used rather than a search list. Thus the addition of new hot-plug
devices after bootup won't cause your config save to go astray as the
search list changes. The "-d" option can be used to force a device, or
"-s" can be used to force a search.
3. Fix errors caused when the config and bootcd.iso file live on the
same device. This requires always mounting the device in the same mode
as was used to mount the device when looking for the bootcd.iso (ie ro),
then remounting to rw as required, doing the writes, remounting to ro,
then umounting. This also means the device is only opened rw for the
mininial time required, so less chance of corruption if the user swaps
the floppy at the wrong moment. (Note: Small fixes to linuxrc and
mount_cdrom are also needed due to this. Coming up next:)
4. In the event that the chosen device has no config file on it, simply
inform the user and create a new one. This means that a fresh floppy can
be popped in to capture a changed config without having to copy a dummy
config to it first. Makes sense to me anyway.
5. Pass the "post-save-config" script info that it might need about the
file just saved.
Tim
|
|
From: Peter F. <pe...@em...> - 2004-05-21 13:16:35
|
I just wanted to throw in my 2cents and praise you for this patch. I had actually modified the save-config script so that the etc.tar.bz2 remained in the ramdrive. I was uploading it to a remote server. Your script is elegant and functional. Congrats! -- Peter Frischknecht <pe...@em...> Empowering Solutions, Inc. |
|
From: Tim T. <t....@co...> - 2004-05-21 20:35:37
|
Peter Frischknecht wrote: >I just wanted to throw in my 2cents and praise you for this patch. > >I had actually modified the save-config script so that the etc.tar.bz2 >remained in the ramdrive. I was uploading it to a remote server. >Your script is elegant and functional. Congrats! > > Glad you liked it:) Of course it helps to have such good material to start with. One more enhancement I was thinking of is allowing a path to be specified instead of a device, to allow it to be saved to an already mounted device and skip the mount steps. Tim |
|
From: Heiko Z. <he...@zu...> - 2004-05-22 22:31:20
|
Tim Tait wrote: > > This patch includes the following: > > 1. Adds new command switches, and this help output: > > save-config [-hqs] [-d DEVICE] [-f FILE] > Saves the Devil-Linux configuration (/etc and /root trees) to a > bzip2 compressed tar file. > By default, the file loaded during boot will updated. > -d <devicename> Device to use for configuration file. > -f <filename> Name of configuration file (default is > "etc.tar.bz2"). > -h This help text > -q Quiet operation, no status ouput. > -s Force search of all devices for configuration file. > > 2. Deterministic save location - By default, the /shm/DL_CONFIG_SOURCE > file exists (created by linuxrc during boot), the device listed inside > is used rather than a search list. Thus the addition of new hot-plug > devices after bootup won't cause your config save to go astray as the > search list changes. The "-d" option can be used to force a device, or > "-s" can be used to force a search. > > 3. Fix errors caused when the config and bootcd.iso file live on the > same device. This requires always mounting the device in the same mode > as was used to mount the device when looking for the bootcd.iso (ie ro), > then remounting to rw as required, doing the writes, remounting to ro, > then umounting. This also means the device is only opened rw for the > mininial time required, so less chance of corruption if the user swaps > the floppy at the wrong moment. (Note: Small fixes to linuxrc and > mount_cdrom are also needed due to this. Coming up next:) > > 4. In the event that the chosen device has no config file on it, simply > inform the user and create a new one. This means that a fresh floppy can > be popped in to capture a changed config without having to copy a dummy > config to it first. Makes sense to me anyway. > > 5. Pass the "post-save-config" script info that it might need about the > file just saved. DONE Heiko |