multibootusb icon indicating copy to clipboard operation
multibootusb copied to clipboard

Welcome?: Re-writing makeUSB.sh in Python 3 or 2+3?

Open hartwork opened this issue 5 years ago • 7 comments

Hi!

I was wondering if you're open to re-writing makeUSB.sh in Python 3 or 2+3 or to review pull requests in that direction. It would include a test suite with close to 100% line coverage to protect against regressions and also PyPI integration to ease installation and free extra visibility. I'm aware there is Bats for Bash testing but Bash is not the best long term choice for non-trivial software aiming at waterproof error handling in my eyes(, and I do like Bash).

What do you think?

Best, Sebastian

hartwork avatar Feb 18 '19 16:02 hartwork

Hi, @hartwork!

I'm glad you enjoy the project enough to be willing to put some effort into porting to Python my hack of a script. :smile:

I'll admit it was never meant to be more than an automated tool for several commands that should be run by hand. However, it seems that it has received more attention that it ever deserved and its shortcomings have come to light.

As an alternative, I would suggest creating its own project and using this one as a submodule or a subtree to pull the scripts. This way we can keep the focus on the scripts here, which is what the project is really about, and leave the configuration tool (be it a shell script or a Python one) as a separate repository.

I'll be glad to collaborate in any way I can (although Python is not my forte) and be sure to add a link in this project's README and documentation.

Keep me posted and thanks for your interest.

aguslr avatar Mar 02 '19 11:03 aguslr

Maybe it could even be rewritten purely in grub.cfg itself. The advantage would be that you could copy in a new ISO and without running any scripts it would be bootable immediately.

Check out https://kanotix.com/files/fix/tmp/search-iso/custom.cfg

Seemingly GRUB can search for ISOs itself: http://git.acritox.com/kanotix/commit/config/binary_grub/grub.cfg?id=6cf6a6fa203d2bbb9bb51fbe58ab7d4914dd2c45

So it looks like we can do without a static GRUB config: https://kanotix.com/files/fix/kanotix-usb/

Reference: https://github.com/probonopd/SystemImageKit/issues/43

probonopd avatar Mar 02 '19 11:03 probonopd

@probonopd, what do you mean a solution written purely in grub.cfg? That'd only work after the pendrive is set up and GRUB is installed, while @hartwork is talking about the script for doing the set-up.

aguslr avatar Mar 02 '19 12:03 aguslr

Yes, one would of course still need a script that sets up GRUB initially. But that script would have to run just one time, and thereafter one could add ISO file after ISO file without having to re-run anything.

probonopd avatar Mar 02 '19 12:03 probonopd

That is already the case for ISOs that are supported. We are doing more or less what Kanotix is doing, only that their custom.cfg searches in all devices for different directories.

aguslr avatar Mar 02 '19 13:03 aguslr

Ah, didn't realize this :+1:

probonopd avatar Mar 02 '19 13:03 probonopd

Hi @aguslr ,

thinking more about a potential future, I consider these aspects key right now:

  • a single tool rather than two, i.e. keeping the Bash one or replacing it
  • getting good code coverage on that single tool
  • with increased bus factor, ideally

With that said, I'm not sure if there is a good way to get Bash covered in the sense of software testing line coverage, yet. If Python is not your thing, maybe there's another language that we could pick for a re-write that's not just "a sibling to Python", e.g. not Perl or Ruby. Compared to Bash and Python, there might be need for providing binaries with some other languages. How would you feel about Rust or Go? Other ideas?

hartwork avatar Mar 04 '19 18:03 hartwork