On Mon, Jul 13, 2015 at 05:03:02PM -0600, Eric Blake wrote:
> On 07/13/2015 02:09 PM, Gabriel L. Somlo wrote:
> > 2. File names are listed in /sys/fs/fw_cfg/... with slashes replaced
> >    exclamation marks, e.g.:
> 
> Instead of inventing yet another escaping mechanism, can you mimic an
> already existing convention such as systemd's escaping?

Not my invention -- as of commit 9f255651f kobject_set_name_vargs()
does some variation of strreplace(s, '/', '!') as a fallback...

> 
> http://www.freedesktop.org/software/systemd/man/systemd-escape.html
> 
> > 
> > # ls /sys/firmware/fw_cfg/
> > bootorder           etc!e820                  etc!table-loader
> > etc!acpi!rsdp       etc!smbios!smbios-anchor  genroms!kvmvapic.bin
> > etc!acpi!tables     etc!smbios!smbios-tables
> > etc!boot-fail-wait  etc!system-states
> 
> would name these files along the lines of 'etc-e820' and
> 'etc-boot\x2dfail\x2dwait', and the end user can then use systemd to
> unescape the names.

That being said, I did reimplement systemd's escape method in cca. 30
lines of C, so that shouldn't be too onerous.

Besides, Laszlo said he liked a real folder hierarchy, and I do too,
so I'm still pondering how much doing that would complicate the module
init function. I'm somewhat worried about what the added complexity
will mean in terms of upstream acceptance in the linux kernel :)

Thanks,
--Gabriel

Reply via email to