Feature #841
closedAdd PiBox FileManager app
100%
Description
This needs to handle the configuration options found in RM #768.
This also needs to have the default fileserver UI verified working on the TFT display, which may require touchscreen calibration.
Resources:Updated by Hammel over 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
pisentry has been switched to use a TFT display for its system build. This addresses getting the TFT display working so it can be used for pifile and a template metabuild has been pushed for pifile. However, pifile still needs all the internals added, not to mention UI apps, appropriate for managing a file server.
Updated by Hammel about 3 years ago
How the app should work:
- Thread to retrieve fs data into db.
- Initial fs scanner: get filesystem size and usage per mount point
- inotify for new mounts, changes under mounts - rescan
- mounts under: /media/smb, /media/usb (configurable in pistore.cfg as stores:<dir>, multiple times allowed)
- Avail, used totals per mount in db
- Summary avail, used totals per /media/<dir>
- No NFS support initially
- mutex protected read/write db functions
- UI
- Main: summary page
- Status bar
- ssh status
- smb status
- separate graphs for SMB and USB avail vs used totals
- Status bar
- SMB page
- List (pageable) remote servers, show mounts per server
- Leave page - clear offset
- USB page
- Paged list of mounts: used, avail, total
- leave page - clear offset
- Main: summary page
Updated by Hammel almost 3 years ago
- % Done changed from 10 to 50
The UI is now working quite well. It shows all mount points with the total and available space graphed in percentages. This is different than the previous description and doesn't show the status bar as described. Instead,
Now it's time to show I/O activity.
Trying to read disk activity - it's not easy to figure out how to do this. One way is to see what iostat does. In summary:
First time setup¶
- Open /sys/block/<device>/stat and read (it's one line)
- device is sda1, sdb2, etc, which is what they'll look like under /media/usb and /media/smb
- Parse file
- see read_sysfs_file_stat_work()
- see https://www.kernel.org/doc/Documentation/block/stat.txt
- saveread and write IOs as lastRead
- read again after 20ms, save as currentRead
- compute change from lastRead to currentRead, store as lastChange
- move currentRead to lastRead, clear currentRead
Iteration¶
- Open /sys/block/<device>/stat and read (it's one line)
- device is sda1, sdb2, etc, which is what they'll look like under /media/usb and /media/smb
- Parse file
- saveread and write IOs as currentRead
- compute change from lastRead to currentRead, store as currentChange
- compute percentage change from lastChange to currentChange - display it.
- move currentChange to lastChange
- move currentRead to lastRead
Updated by Hammel almost 3 years ago
- % Done changed from 50 to 70
I dropped all of the I/O stuff. It's only purpose was to show disk I/O activity and it's hardly worth the effort since file system activity is not really based on mount points - you have to map between the two. It's just extra work for little benefit here.
So now the statuswidget is just a fullscreen popup window that shows the exports file. This allows the user to see which devices are being exported from the PiStore system. The window gets hidden and revealed by touching the left of middle columns of the display (or hitting the TAB key) and the app can be quit by touch the right column of the display (or typing Ctrl-Q or the home key, which is the ESC key on PiBox).
System is now in test. It boots and starts okay but has some problems with moving between windows and the fonts are too big.
Updated by Hammel almost 3 years ago
- % Done changed from 70 to 90
The UI is cleaned up for the small touchscreen, with touchscreen regions used now (instead of ABS position). I also fixed fonts to be more readable on small screens.
The only thing left to is make the app only look at mounts under /media/usb or /media/smb. Right now it shows all mount points including the the mmc boot device.
Updated by Hammel almost 3 years ago
Additional testing:
- Two usb sticks
- One is showing 0MB/0MB and fully used; actually has 8MB and fully used.
- One is showing 4098MB/8192MB and about 14% used; actually has 1086MB/7856MB used and 14% used.
Calculation of available and total are wrong.Handling of very small partition sizes is wrong.NFS is not installed in dev platform (missing /etc/exports), possibly not in kernel either.Display does not clear last entry when last mount is removed.Exports file is not fully cleared of mounts.Exports file shoud be sync'd with mounts at program startup.
Updated by Hammel almost 3 years ago
There were some problems with plug/unplug (re: inotify handling) that are now fixed, but the bugs in the above entry still need addressing.
Updated by Hammel almost 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
All known bugs fixed.
Changes committed and pushed.
Closing issue.