Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] luci-app-storage: created #1470

wants to merge 0 commits into from


None yet
1 participant
Copy link

bobafetthotmail commented Dec 10, 2017

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.
In case it is not obvious, this allows the average user of a mid-end router (or NAS) to setup a drive connected over usb or Sata without having to use SSH to copy-paste a commandline from the wiki tutorials.

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.
In this state it is good enough for a RFC.

I'm sending this PR to ask information/comments/help about the following issues:

-this app currently works by using 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)?
For example, even relatively simple things like splitting each line and adding <p> and </p> so they are rendered properly in the "command output page" was done by sed in the shell command line blob.

-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

@bobafetthotmail bobafetthotmail force-pushed the bobafetthotmail:master branch from e618c3c to 8e6b1a6 Apr 15, 2018


This comment has been minimized.

Copy link

bobafetthotmail commented Apr 15, 2018

superseeded by #1749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.