usb-creator-hackers team mailing list archive
-
usb-creator-hackers team
-
Mailing list archive
-
Message #00096
Re: hacking a CLI frontend, running into issues
Alex:
Were you intending this to eventually be a curses frontend on CLI, or only a
frontend that can be launched with the proper arguments? If you were
shooting for the latter, I would recommend calling it a "text" frontend
instead.
It seems to me you are trying to achieve threading by using the GTK GDK
threading functionality. If you are shooting for a text frontend, why do
you need to be threaded in the first place? I'm guessing because you want
to still be able to output the progress to the prompt? If so, you might be
able to do this using python-progressbar and a dbus synchronous call wrapper
like dbus_sync_call_signal_wrapper found in jockey without needing to add
real threading in the first place.
If you're actually shooing for a curses type frontend that you can select
options that the backend is intelligently providing to you, you will need to
properly thread it.
Another way you can look at solving your problem is adding an automatic type
argument to the GTK and KDE frontends that if all the arguments are provided
and valid, install directly to the device in question using that frontend
without interactions. It all depends on what you're trying to achieve from
this frontend.
Thanks,
On Mon, Nov 15, 2010 at 23:11, Alex Chiang <achiang@xxxxxxxxxxxxx> wrote:
> Hello,
>
> I've been hacking on usb-creator with the goal of adding a CLI
> frontend to it. I'd be happy to explain why I think I need this
> in a separate thread, but right now, I'd just like to get some
> technical advice. :)
>
> I have something roughly working, but fails in the "installing
> bootloader" phase.
>
> I think I have two issues going on:
>
> 1) install.py thinks it should be using grub, but when I
> use the gtk UI, we seem to go down the syslinux path. In
> other words, using the cli UI, a debug print in
> install_bootloader() says:
>
> grub is /media/2B9E-1D52/boot/grub/i386-pc
>
> I find that odd since looking at my ISO, I don't see a
> /boot/grub anywhere. You can see for yourself later on in
> the log file.
>
> 2) I don't think I'm tall enough to use threads. I
> cargo-culted as much as I could from the existing gtk
> stuff, but I must have missed something crucial. I
> sometimes see that we're trying to install the bootloader
> before all the files are finished copying.
>
> I've been running it like this:
>
> achiang@aspen:~/Projects/natty/usb-creator/trunk$ sudo
> ./bin/usb-creator-cli -i ~/Downloads/binary.iso -t /dev/sdb1
> Destructively wiping out /dev/sdb1 in 5 seconds...
> Press control-c to abort!
> Removing files...
> Copying files...
> 0% complete
> 68% complete (0m0s remaining)
> 90% complete (0m0s remaining)
> Installing the bootloader...
> Segmentation fault
>
> And then you can see that I experience a segfault. Occasionally,
> I actually get something useful on the command line:
>
> *** glibc detected *** /usr/bin/python: malloc(): memory corruption:
> 0x000000000236edb0 ***
> Segmentation fault
>
> Here is a representative log:
>
> http://pastebin.ubuntu.com/532787/
>
> My branch can be found below. It's clearly a work-in-progress...
>
> lp:~achiang/usb-creator/usb-creator-cli
>
> Any help would be greatly appreciated.
>
> Thanks!
> /ac
>
> _______________________________________________
> Mailing list: https://launchpad.net/~usb-creator-hackers
> Post to : usb-creator-hackers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~usb-creator-hackers
> More help : https://help.launchpad.net/ListHelp
>
--
Mario Limonciello
superm1@xxxxxxxxx
Follow ups
References