App-USBKeyCopyCon

 view release on metacpan or  search on metacpan

bin/usb-key-copy-con  view on Meta::CPAN


The default profile will format the blanks keys with a VFAT filesystem and the
volume label from the master key.  A file-by-file copy will be used to populate
the key and then MD5 checksums will be used to verify the copied files.

It is possible to create your own profiles that do anything you want with the
blank keys.  See L<App::USBKeyCopyCon> for more details.

=head2 Desktop Media Automount

While this program is running, it attempts to disable the GNOME desktop
environment's media automount behaviour - which would intefere with the copying
process.  If you're not running GNOME you may need to manually disable the
equivalent function in your desktop of choice.

On exit, the original state of the media automount function should be restored.
In the event of a crash, you can turn it back on with this command:

  gconftool-2 --type bool --set \
    /apps/nautilus/preferences/media_automount true


=head1 OPTIONS

lib/App/USBKeyCopyCon.pm  view on Meta::CPAN


    $window->show_all;
}


sub init_dbus_watcher {
    my $self = shift;

    my $bus = Net::DBus::GLib->system;

    my $hal = $bus->get_service("org.freedesktop.Hal");

    my $manager = $hal->get_object(
        "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal.Manager"
    );
    $self->hal($manager);

    $manager->connect_to_signal('DeviceAdded', sub {
        $self->hal_device_added(@_);
    });

    $manager->connect_to_signal('DeviceRemoved', sub {
        $self->hal_device_removed(@_);
    });

lib/App/USBKeyCopyCon.pm  view on Meta::CPAN


sub on_menu_file_new {
    my $self = shift;
    $self->require_master_key;
}


sub on_menu_file_quit {
    my $self = shift;
    # TODO: check for work in progress
    # TODO: check if desktop automount should be re-enabled
    Gtk2->main_quit;
}


sub on_menu_edit_preferences {
    my $self = shift;
    $self->say("Edit>Preferences - not implemented\n");
}


lib/App/USBKeyCopyCon.pm  view on Meta::CPAN

  MASTER-COPIED  waiting for the user to remove the master key
  COPYING        waiting for the user to insert blank keys

=item exit_status

Used by a SIGCHLD handler to track the exit status of the copy scripts.  The
key is a process ID and the value is the exist status returned by C<wait>.

=item hal

The DBus object ('org.freedesktop.Hal.Manager') from which device add/remove
events are received.

=item key_rack

The Gtk2::HBox object containing the widgets representing currently inserted
keys.

=item master_info

A hash of device details for the 'master' USB key.

lib/App/USBKeyCopyCon/TroubleShooting.pod  view on Meta::CPAN

=head1 NAME

App::USBKeyCopyCon::Troubleshooting - Hints for making usb-key-copy-con work on your system

=head1 HINTS

This package relies on some fairly low-level system services.  It was developed
on an Ubuntu 9.04 ('Jaunty') system running the GNOME desktop.  If you're
running a different OS or indeed the same OS with different preference settings
then your mileage may vary.

=head2 Desktop Media Automount

The default behaviour of GNOME/Nautlus is to automatically mount any USB
storage device when it is plugged in and then pop up a file browser window.
This behaviour conflicts with C<usb-key-copy-con> because it causes the scripted
formatting and mounting operations to fail with 'Device Busy' errors.

lib/App/USBKeyCopyCon/TroubleShooting.pod  view on Meta::CPAN


  gconftool-2 --type bool --set \
      /apps/nautilus/preferences/media_automount false

and this command turns it back on:

  gconftool-2 --type bool --set \
      /apps/nautilus/preferences/media_automount true

Different versions of GNOME may use different configuration keys.  Other
desktop environments (e.g.: KDE) will use different config mechanisms
altogether.  Feedback on how to manage this better is welcome.

=head2 Multiple User Logins

It is safest to run C<usb-key-copy-con> when only one user is logged on to your
workstation.  If you log in one user and then 'switch users' to log in a second
user, the desktop of the first user may continue to respond to USB device
add/remove events and cause conflicts with the copying process.

=head2 Root Privileges / Sudo

The C<usb-key-copy-con> program needs root privileges to format and
mount/unmount devices.  If the program is run by a non-root user then it will
use either gksudo or sudo to run the sub-commands that need privilege.  If
gksudo is installed then password prompts should appear in a graphical window,
if not, they may appear in the console window where the command was originally
run.  You may wish to configure sudo so that no password prompt is needed.



( run in 0.726 second using v1.01-cache-2.11-cpan-299005ec8e3 )