freifunk-berlin / falter-packages

Sources for the falter-packagefeed
GNU General Public License v3.0
12 stars 17 forks source link

include falter banner motd #59

Closed kls0e closed 3 years ago

kls0e commented 3 years ago

___________             .__  _____             __       
\_   _____/______  ____ |__|/ ____\_ __  ____ |  | __   
 |    __) \_  __ \/ __ \|  \   __\  |  \/    \|  |/ /   
 |     \   |  | \|  ___/|  ||  | |  |  /   |  \    <    
 \___  /   |__|   \___  >__||__| |____/|___|  /__|_ \   
__________            \.__  .__             \/     \/   
\______   \ ___________|  | |__| ____                   
 |    |  _// __ \_  __ \  | |  |/    \                  
 |    |   \  ___/|  | \/  |_|  |   |  \                 
 |______  /\___  >__|  |____/__|___|  /                 
________________/ .____  ______________________________ 
\_   _____/  _  \ |    | \__    ___|_   _____|______   \
 |    __)/  /_\  \|    |   |    |   |    __)_ |       _/
 |     \/    |    \    |___|    |   |        \|    |   \
 \___  /\____|__  /_______ \____|  /_______  /|____|_  /
     \/         \/        \/               \/        \/ 

Welcome to Freifunk Berlin Falter <Version>!
Thank you for being a part of the Freifunk network.
say hello at https://berlin.freifunk.net/contact

<.olsr name>: <IP>
<uptime> - <free flash space>
<monitor-link if enabled>
PolynomialDivision commented 3 years ago

We can put that under /etc/config/banner and then exchange /etc/profile

[ -f /etc/banner ] && cat /etc/banner

with our own banner.

@Akira25 ? xD

Akira25 commented 3 years ago

I like the idea of including uptime and free flash space. But for the Freifunk-stamp I'd prefer a more readable font. Maybe we leave it like the old one? I actually like that really much. What about something like that?:

  _____        _  __             _
 |  ___|      (_)/ _|           | |
 | |_ _ __ ___ _| |_ _   _ _ __ | | __
 |  _| '__/ _ \ |  _| | | | '_ \| |/ /
 | | | | |  __/ | | | |_| | | | |   <
 \_| |_|  \___|_|_|  \__,_|_| |_|_|\_\

 Freifunk Berlin Firmware (falter beta3, r21500)
 Generic - ar71xx/generic
 https://wiki.freifunk.net/Berlin:Firmware
 https://github.com/Freifunk-Spalter/
 -----------------------------------------------------

 If you find bugs please report them at:

   https://github.com/Freifunk-Spalter/packages/issues/

 For questions write a mail to <berlin@berlin.freifunk.net>
 or check https://berlin.freifunk.net/contact for our weekly meetings.

AFAICT, the banner was generated in the buildprocess. Thus all values (revision, version, etc) were up-to-date. If I can integrate that into our current build-system, I would prefer that, than patching the banner at runtime.

In concerns of uptime and free flash... Is it possible to embed subshells into the banner? something like:

 Freifunk Berlin Firmware (falter beta3, r21500)
 Generic - ar71xx/generic
 https://wiki.freifunk.net/Berlin:Firmware
 https://github.com/Freifunk-Spalter/
 I'm up for $(cat /xxx/xxx/uptime) days.
 $(df -h | grep flash | cut ......) kiB of free flash.
PolynomialDivision commented 3 years ago

In concerns of uptime and free flash... Is it possible to embed subshells into the banner? something like:

Of course. ;) We can just modify profile :D We can do what we want. :P

Akira25 commented 3 years ago

In concerns of uptime and free flash... Is it possible to embed subshells into the banner? something like:

Of course. ;) We can just modify profile :D We can do what we want. :P

How do you want to modify /etc/profile? I'd really prefer to use the buildsystem for that. There we can use placeholders (like in printf) to give a individual banner for every architecture. Shortcuts | Example

@pmelange What would be the most elegant way to apply a new banner? With falter-build-script, I could overwrite the file just before starting the build. But that feels rather like a dirty hack.

PolynomialDivision commented 3 years ago

How do you want to modify /etc/profile? I'd really prefer to use the buildsystem for that. There we can use placeholders (like in printf) to give a individual banner for every architecture. Shortcuts | Example

I think we can obtain everything with a simple bash script. ;) But I don't care and the different solutions are not excluding each other. :D

Akira25 commented 3 years ago

@kls0e #61 enables us to have a dynamic section in the banner, which gets updated once per minute. The result looks like that:

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
 Host.............................: testnode.olsr
 IP-Address.......................: 172.16.6.2
 Uptime...........................: 4 min
 Free flash.......................: 9.1M
 Average load (1m, 5m, 15m).......: 0.26, 0.44, 0.21
 DHCP-Clients.....................: 1

Everything above the Host-line will be generated by the buildsystem. The packages from #61 is fairly flexible. Additionaly, you could install it on hedy-devices, to have dynamic banners there. I verified that with my hedy-based bbb-access-router.

To issue of the ASCII-Art, I'd like to hack that into the buildsystem.

pmelange commented 3 years ago

I have left some review requests for #61. I think this would be a good way for us to "customize" the banner.

kls0e commented 3 years ago

thanks everyone, beautiful.