Altering the shell login screen motd [SOLVED]

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1856
Location: Hung Hom, Hong Kong

PostPosted: Thu Dec 09, 2021 9:16    Post subject: Altering the shell login screen motd [SOLVED] Reply with quote
I don't remember whether the logo is new... Wink

Could I customize the login screen like those Linux distributions? Which file? In /jffs/etc/?

BTW, never used Almquist shell...
mrjcd wrote:
Code:

==========================================================
 
     ___  ___     _      _____  ______       ____  ___
    / _ \/ _ \___| | /| / / _ \/_  __/ _  __|_  / / _ \
   / // / // /___/ |/ |/ / , _/ / /   | |/ //_ <_/ // /
  /____/____/    |__/|__/_/|_| /_/    |___/____(_)___/
                                                     
                       DD-WRT v3.0
                   https://www.dd-wrt.com


==========================================================


BusyBox v1.34.1 (2021-12-09 05:30:53 +07) built-in shell (ash)

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw


Last edited by mwchang on Fri Dec 10, 2021 15:22; edited 1 time in total
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Thu Dec 09, 2021 13:12    Post subject: Reply with quote
Hey there...

No its not NEW, See a history here https://github.com/mirror/dd-wrt/commits/master/src/router/others/motd

You can probably do some symlinking, DD-WRT supports ln

Code:
:~# ln
BusyBox v1.34.1 (2021-12-08 23:38:08 +07) multi-call binary.

Usage: ln [-sfnbtv] [-S SUF] TARGET... LINK|DIR

Create a link LINK or DIR/TARGET to the specified TARGET(s)

        -s      Make symlinks instead of hardlinks
        -f      Remove existing destinations
        -n      Don't dereference symlinks - treat like normal file
        -b      Make a backup of the target (if exists) before link operation
        -S SUF  Use suffix instead of ~ when making backup files
        -T      Treat LINK as a file, not DIR
        -v      Verbose


Essentially something like ln -s /path/to/original /path/to/link

EDIT FYI motd lives in /etc on all sane Linux based anything.

You can use pretty much anything in here. But if you break it you buy it. Wink

Take care.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1856
Location: Hung Hom, Hong Kong

PostPosted: Thu Dec 09, 2021 16:08    Post subject: Reply with quote
the-joker wrote:
Hey there...

No its not NEW, See a history here https://github.com/mirror/dd-wrt/commits/master/src/router/others/motd

You can probably do ....

You can use pretty much anything in here. But if you break it you buy it. Wink

Take care.

Thanks. Homework time... Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2968
Location: Germany

PostPosted: Thu Dec 09, 2021 16:40    Post subject: Reply with quote
DD-WRT uses squashfs as file system and this is a "read only" file system.

Therefore it is impossible to modify anything in /etc/.

You can't modify, delete or link anything because it's a ro filesystem.

The only thing you can do is to mount another directory or device over /etc/.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2968
Location: Germany

PostPosted: Thu Dec 09, 2021 17:06    Post subject: Reply with quote
...


Code:
cp -fR /etc/* /opt
mount /dev/sda1 /etc


Wink



7945645861.jpg
 Description:
 Filesize:  47.56 KB
 Viewed:  5564 Time(s)

7945645861.jpg


kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Thu Dec 09, 2021 17:19    Post subject: Reply with quote
Someone has never heard of echo, cat, and a few other Linux commands. I couldn't find the specific way to completely replace the file outside of using ln, but I don't think that will work in this case. It is possible to modify the motd without recompiling the firmware image, though.

https://www.marksanborn.net/linux/changing-the-motd-in-linux/
http://www.mewbies.com/how_to_customize_your_console_login_message_tutorial.htm
https://unix.stackexchange.com/questions/126423/change-motd-value-in-unix-operating-system

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2968
Location: Germany

PostPosted: Thu Dec 09, 2021 17:45    Post subject: Reply with quote
kernel-panic69 wrote:
It is possible to modify the motd without recompiling the firmware image, though.


Your linux skills are always welcome here.
Can't wait to see how this works.
(apart from the way I have posted)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1856
Location: Hung Hom, Hong Kong

PostPosted: Fri Dec 10, 2021 8:52    Post subject: Reply with quote
ho1Aetoo wrote:

Code:
cp -fR /etc/* /opt
mount /dev/sda1 /etc

That's rude and brutal, and it has to be done every boot... Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5695

PostPosted: Fri Dec 10, 2021 9:09    Post subject: Reply with quote
<shrug> Welcome to the embedded world.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Dec 10, 2021 9:29    Post subject: Reply with quote
edited out previous content.

This file should not be modified by users, it is static for a reason.

Take care now.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2968
Location: Germany

PostPosted: Fri Dec 10, 2021 11:38    Post subject: Reply with quote
mwchang wrote:
ho1Aetoo wrote:

Code:
cp -fR /etc/* /opt
mount /dev/sda1 /etc

That's rude and brutal, and it has to be done every boot... Smile



Yes you have to remount after each reboot but
"rude" or "brutal" is nothing about it, I just made the complete directory /etc/ writable, there are other interesting things like unbound.

I don't know any other way (than mounting over it), unless you unpack the firmware image, modify it, repack it and flash it afterwards.

It's just a bit cumbersome that dd-wrt uses squashfs.
This contributes on the one hand to the security but also takes away the possibility of customization and makes everything a bit complicated.
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6287
Location: Texas

PostPosted: Fri Dec 10, 2021 12:40    Post subject: Reply with quote
the-joker wrote:
edited out previous content.

This file should not be modified by users, it is static for a reason.

Take care now.


thought so Wink
peoples should build their own FW iffin they want it to be custom of that sort

---
edit:
kinda sorta like the Debian logo when using 'neofetch'
it is easily changed and its developer don't mind but I never have cause it is just the whole idea of doing such a thing Twisted Evil
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Dec 10, 2021 12:57    Post subject: Reply with quote
mrjcd wrote:
thought so Wink
peoples should build their own FW iffin they want it to be custom of that sort

---
edit:
kinda sorta like the Debian logo when using 'neofetch'
it is easily changed and its developer don't mind but I never have cause it is just the whole idea of doing such a thing Twisted Evil


The point is not to do this, no matter if you build it or not. Im pretty sure BS wont like reading this thread fyi.

Take care.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Fri Dec 10, 2021 13:06    Post subject: Reply with quote
ho1Aetoo wrote:
kernel-panic69 wrote:
It is possible to modify the motd without recompiling the firmware image, though.


Your linux skills are always welcome here.
Can't wait to see how this works.
(apart from the way I have posted)

I didn't see your post before I commented. That is another way I wasn't even thinking of, but not one I use. Pretty easy to figure out how to brand the MOTD or change it completely, as you have shown or using the FMK as you have noted below.

ho1Aetoo wrote:
I don't know any other way (than mounting over it), unless you unpack the firmware image, modify it, repack it and flash it afterwards.

It's just a bit cumbersome that dd-wrt uses squashfs.
This contributes on the one hand to the security but also takes away the possibility of customization and makes everything a bit complicated.

I was hoping that you would've at least gone to the length of showing proof that echo and cat and other command line methods don't work (obviously).

the-joker wrote:
mrjcd wrote:
thought so Wink
peoples should build their own FW iffin they want it to be custom of that sort


The point is not to do this, no matter if you build it or not. Im pretty sure BS wont like reading this thread fyi.

I could go into all of the in's, out's, and ethical uses of the GPL for profit, what to do and what not to do here. If people use and modify DD-WRT code, distribute their own custom firmware images, the proper thing to do is publish their work (and share a percentage of their income). That never happens, because the GPL doesn't specify to share the wealth, just the modified code that should include all original copyright and licensing information. The thing is, there are many devices that you can't support since the driver_repository requires an NDA to access; so you will likely only be supporting Broadcom devices, if anything at all.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1856
Location: Hung Hom, Hong Kong

PostPosted: Fri Dec 10, 2021 15:20    Post subject: Reply with quote
ho1Aetoo wrote:
I don't know any other way (than mounting over it), unless you unpack the firmware image, modify it, repack it and flash it afterwards.

It's just a bit cumbersome that dd-wrt uses squashfs.

This contributes on the one hand to the security but also takes away the possibility of customization and makes everything a bit complicated.

For true security, the remount trick should not have worked. /etc should be well-guarded.

The squashfs is to secure the DD-WRT firmware core and its fundamental settings, I believe.

But then, when you install a true Linux distribution, you can alter everything! Is DD-WRT just a Linux distribution? Um... worth another discussion. The custom binary provided by router manufacturers might be the problem to call it just a distribution.

BTW, I haven't tried your trick though. Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw


Last edited by mwchang on Fri Dec 10, 2021 15:28; edited 3 times in total
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum