[Gambas-user] Disk devices info and management

Bruce Steers bsteers4 at gmail.com
Tue Dec 29 15:46:21 CET 2020


lsblk is available on BSD, "pkg install lsblk" but it's output is very
different to linux lsblk.
My next step after seeing that was to add to the shell-tools component an
InstallPkg(sName) function that would handle the various installers.

Most ways i'm seeing on BSD to get disk info need sudo unlike lsblk which
is a shame.

I've not had much fun installing BSD, i tried to install freeBSD and
OpenBSD with no success (could not select a partition to install it too)
Then i managed to install GhostBSD on free space on an extended partition
that had 6 other linux partitions on it and all it's done is wiped the
whole extended partition for me :(
why oh why can't it just use grub and ext4 ? :'(

So now i've downloaded a VM image and doing it that way, just installing at
mo.

Have not thought in any way (yet) about disk events. My initial goal was to
simply get the disk drive list  as one of my apps wants the info.
that's when i though maybe a component that is unashamedly based on using
various shell commands might be useful and frankly simpler for a few things.

I have never looked into dbus, ,,,, (looking now) , ooh, that's a nice
useful looking component,  udev looks interesting does it work on BSD too?
It also looks far more in depth than what I have in mind for this
shell.tools component.
But to be fair the component has been born only from needing disk info so
maybe your way is better, would be happy to help get it finished and ready.

I think the shell.tools component could still go somewhere though.
I'm thinking of commands like ExecToPairs() that would automatically turn
shell command results that can return keypairs into a collection array.
that would work with what i've done with lsblk ..
cCollection = ExecToPairs("lsblk", "-P")

also an installer. Say , InstallPkg(sPkgName) that would detect installer
per os.

Stuff like that.
Disk detecting features within gambas would be great though.
I think with what i have so far i can make it BSD compatible i just might
have to drop a couple of fields but your way sounds less "hack" like ;) lol.

Wishing well.
BruceS


On Tue, 29 Dec 2020 at 07:13, Fabien Bodard <gambas.fr at gmail.com> wrote:

> I've found this script to imitate lsblk on bsd.
>
> https://forums.freebsd.org/threads/lsblk-8-command-for-freebsd.56008/
> <https://forums.freebsd.org/threads/lsblk-8-command-for-freebsd.56008/>
>
> I've already done a similar work on a udev dbus way. But not finished.
>
> Maybe the both can be fusionnate ?
>
> The goal will be to have a more advanced internal open dialog.
>
> Your component have to manage device info but also devices events are
> reallly important.
> The structure of returned infos must be in the most Gambas way. (Mine  is
> not good too)
>
> Regards,
> Fabien
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201229/851d475f/attachment.htm>


More information about the User mailing list