Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[RFC] luci-app-storage: created #1470
This luci app allows the user to setup storage automatically: it clears, re-partitions and formats drives to be either used as storage drives (single ext4 GPT partition) or as RAID1 depending on what the user has chosen.
It shows an interface with 2 buttons to choose if the user wants independent drives or RAID, and after it's done it shows the output of the commands issued in a new page.
I would like to expand it to be able to deal with filesystem mainteneance, automatic extroot, mdadm operations (remove/add/rebuild and so on), but that's just more of the same thing. User pushes a few buttons and the app does the leg work.
I'm sending this PR to ask information/comments/help about the following issues:
-this app currently works by using luci.sys.call and luci.util.exec to execute embedded large single-line (rather ugly) blobs of shell script, as I didn't find luci functions to do what I needed, likely because I have no experience with lua so I can't read the code very well. Can someone point me to functions I should use or post the lua equivalent of what my shell code is doing (so I can use that to make lua functions)?
-I would have liked to update the "command output" page after every command, but I don't know how to do that. Calling "luci.template.render()" again will append the contents to the already rendered page, and again I can't understand the code enough to see if there are functions to do that already.
It's been developed/tested in a Virtualbox VM LEDE x86_64 image.
(yes I know there is no translation support in this app, I figured out how it works and I'll do that later when the app itself is less ugly)
Signed-off-by: Alberto Bursi firstname.lastname@example.org