* [Buildroot] [PATCH 1/1] bash: add default bash settings
@ 2015-10-07 23:17 David Van Arnem
2015-10-08 9:02 ` Maxime Hadjinlian
2015-10-10 9:54 ` Thomas Petazzoni
0 siblings, 2 replies; 5+ messages in thread
From: David Van Arnem @ 2015-10-07 23:17 UTC (permalink / raw)
To: buildroot
Settings that were bash-specific were previously removed from
system/skeleton/etc/profile. This measn that users using bash no longer
get the "normal" bash prompt with [user at host dir]#/$, and only get #/$.
This commit adds back the bash-specific settings, but adds them to the
bash package so they are only used when bash is installed on the target
system.
bash_profile.sh contains the variables, aliases, and color profile that
were previously in system/skeleton/etc/profile. The changes to bash.mk
use a post-install hook to install bash_profile.sh to the target
filesystem, where it will later be sourced by /etc/profile when a bash
shell is started.
Signed-off-by: David Van Arnem <dvanarnem@cmlab.biz>
---
package/bash/bash.mk | 7 +++++++
package/bash/bash_profile.sh | 16 ++++++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 package/bash/bash_profile.sh
diff --git a/package/bash/bash.mk b/package/bash/bash.mk
index 97d7182..dae3bf2 100644
--- a/package/bash/bash.mk
+++ b/package/bash/bash.mk
@@ -49,4 +49,11 @@ define BASH_INSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/bin/bashbug
endef
+# install default bash settings
+define BASH_INSTALL_DEFAULT_PROFILE
+ $(INSTALL) -D -m 644 package/bash/bash_profile.sh \
+ $(TARGET_DIR)/etc/profile.d/bash_profile.sh
+endef
+
+BASH_POST_INSTALL_TARGET_HOOKS += BASH_INSTALL_DEFAULT_PROFILE
$(eval $(autotools-package))
diff --git a/package/bash/bash_profile.sh b/package/bash/bash_profile.sh
new file mode 100644
index 0000000..b41c240
--- /dev/null
+++ b/package/bash/bash_profile.sh
@@ -0,0 +1,16 @@
+# default bash script, should be sourced by /etc/profile
+
+if [ "$PS1" ]; then
+ export PS1="[\u@\h \W]$PS1"
+ alias ll='/bin/ls --color=tty -laFh'
+ alias ls='/bin/ls --color=tty -F'
+ export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
+
+ export USER=`id -un`
+ export LOGNAME=$USER
+ export HOSTNAME=`/bin/hostname`
+ export HISTSIZE=1000
+ export HISTFILESIZE=1000
+ export INPUTRC=/etc/inputrc
+ export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
+fi;
--
2.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/1] bash: add default bash settings
2015-10-07 23:17 [Buildroot] [PATCH 1/1] bash: add default bash settings David Van Arnem
@ 2015-10-08 9:02 ` Maxime Hadjinlian
2015-10-10 9:54 ` Thomas Petazzoni
1 sibling, 0 replies; 5+ messages in thread
From: Maxime Hadjinlian @ 2015-10-08 9:02 UTC (permalink / raw)
To: buildroot
Hi David, all
On Thu, Oct 8, 2015 at 1:17 AM, David Van Arnem <dvanarnem@cmlab.biz> wrote:
> Settings that were bash-specific were previously removed from
> system/skeleton/etc/profile. This measn that users using bash no longer
> get the "normal" bash prompt with [user at host dir]#/$, and only get #/$.
> This commit adds back the bash-specific settings, but adds them to the
> bash package so they are only used when bash is installed on the target
> system.
>
> bash_profile.sh contains the variables, aliases, and color profile that
> were previously in system/skeleton/etc/profile. The changes to bash.mk
> use a post-install hook to install bash_profile.sh to the target
> filesystem, where it will later be sourced by /etc/profile when a bash
> shell is started.
>
> Signed-off-by: David Van Arnem <dvanarnem@cmlab.biz>
> ---
> package/bash/bash.mk | 7 +++++++
> package/bash/bash_profile.sh | 16 ++++++++++++++++
> 2 files changed, 23 insertions(+)
> create mode 100644 package/bash/bash_profile.sh
>
> diff --git a/package/bash/bash.mk b/package/bash/bash.mk
> index 97d7182..dae3bf2 100644
> --- a/package/bash/bash.mk
> +++ b/package/bash/bash.mk
> @@ -49,4 +49,11 @@ define BASH_INSTALL_TARGET_CMDS
> rm -f $(TARGET_DIR)/bin/bashbug
> endef
>
> +# install default bash settings
> +define BASH_INSTALL_DEFAULT_PROFILE
> + $(INSTALL) -D -m 644 package/bash/bash_profile.sh \
> + $(TARGET_DIR)/etc/profile.d/bash_profile.sh
> +endef
> +
> +BASH_POST_INSTALL_TARGET_HOOKS += BASH_INSTALL_DEFAULT_PROFILE
> $(eval $(autotools-package))
> diff --git a/package/bash/bash_profile.sh b/package/bash/bash_profile.sh
> new file mode 100644
> index 0000000..b41c240
> --- /dev/null
> +++ b/package/bash/bash_profile.sh
> @@ -0,0 +1,16 @@
> +# default bash script, should be sourced by /etc/profile
> +
> +if [ "$PS1" ]; then
> + export PS1="[\u@\h \W]$PS1"
> + alias ll='/bin/ls --color=tty -laFh'
> + alias ls='/bin/ls --color=tty -F'
> + export
> LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
> +
> + export USER=`id -un`
> + export LOGNAME=$USER
> + export HOSTNAME=`/bin/hostname`
> + export HISTSIZE=1000
> + export HISTFILESIZE=1000
> + export INPUTRC=/etc/inputrc
> + export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
> +fi;
>
Thanks for your patch !
Here are a few things to rework:
We previously removed all theses because they are not sane as a default, we
try to keep a minimal default configuration that suits everyone.
For specific needs (like exporting ls_colors, aliases, hostname and so on),
we really encourage users to create a post build scripts and do whatever
they need to do in there.
So for your uses and what I got from your previous mail, I would only keep
the export PS1 from the whole thing.
> --
> 2.4.3
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151008/92b52a22/attachment.html>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/1] bash: add default bash settings
2015-10-07 23:17 [Buildroot] [PATCH 1/1] bash: add default bash settings David Van Arnem
2015-10-08 9:02 ` Maxime Hadjinlian
@ 2015-10-10 9:54 ` Thomas Petazzoni
2015-10-12 16:55 ` David Van Arnem
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2015-10-10 9:54 UTC (permalink / raw)
To: buildroot
Dear David Van Arnem,
On Wed, 7 Oct 2015 17:17:04 -0600, David Van Arnem wrote:
> Settings that were bash-specific were previously removed from
> system/skeleton/etc/profile. This measn that users using bash no longer
> get the "normal" bash prompt with [user at host dir]#/$, and only get #/$.
> This commit adds back the bash-specific settings, but adds them to the
> bash package so they are only used when bash is installed on the target
> system.
>
> bash_profile.sh contains the variables, aliases, and color profile that
> were previously in system/skeleton/etc/profile. The changes to bash.mk
> use a post-install hook to install bash_profile.sh to the target
> filesystem, where it will later be sourced by /etc/profile when a bash
> shell is started.
>
> Signed-off-by: David Van Arnem <dvanarnem@cmlab.biz>
Thanks for your patch. Following the comments from Maxime Hadjinlian on
your patch, I've marked it as "Changes Requested" in our patch tracking
system. Please resubmit a new version of your patch that takes into
account the comments made by Maxime. Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/1] bash: add default bash settings
2015-10-10 9:54 ` Thomas Petazzoni
@ 2015-10-12 16:55 ` David Van Arnem
2015-10-12 16:57 ` David Van Arnem
0 siblings, 1 reply; 5+ messages in thread
From: David Van Arnem @ 2015-10-12 16:55 UTC (permalink / raw)
To: buildroot
On 10/10/2015 03:54 AM, Thomas Petazzoni wrote:
> Dear David Van Arnem,
>
> On Wed, 7 Oct 2015 17:17:04 -0600, David Van Arnem wrote:
>> Settings that were bash-specific were previously removed from
>> system/skeleton/etc/profile. This measn that users using bash no longer
>> get the "normal" bash prompt with [user at host dir]#/$, and only get #/$.
>> This commit adds back the bash-specific settings, but adds them to the
>> bash package so they are only used when bash is installed on the target
>> system.
>>
>> bash_profile.sh contains the variables, aliases, and color profile that
>> were previously in system/skeleton/etc/profile. The changes to bash.mk
>> use a post-install hook to install bash_profile.sh to the target
>> filesystem, where it will later be sourced by /etc/profile when a bash
>> shell is started.
>>
>> Signed-off-by: David Van Arnem <dvanarnem@cmlab.biz>
>
> Thanks for your patch. Following the comments from Maxime Hadjinlian on
> your patch, I've marked it as "Changes Requested" in our patch tracking
> system. Please resubmit a new version of your patch that takes into
> account the comments made by Maxime. Thanks a lot!
>
> Thomas
>
Hi Thomas,
Can you instruct me on how to get Maxime's comments? I do not see them
in my emails from this list.
--
Thanks,
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2416 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151012/215feaf3/attachment.p7s>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/1] bash: add default bash settings
2015-10-12 16:55 ` David Van Arnem
@ 2015-10-12 16:57 ` David Van Arnem
0 siblings, 0 replies; 5+ messages in thread
From: David Van Arnem @ 2015-10-12 16:57 UTC (permalink / raw)
To: buildroot
On 10/12/2015 10:55 AM, David Van Arnem wrote:
> On 10/10/2015 03:54 AM, Thomas Petazzoni wrote:
>> Dear David Van Arnem,
>>
>> On Wed, 7 Oct 2015 17:17:04 -0600, David Van Arnem wrote:
>>> Settings that were bash-specific were previously removed from
>>> system/skeleton/etc/profile. This measn that users using bash no longer
>>> get the "normal" bash prompt with [user at host dir]#/$, and only get #/$.
>>> This commit adds back the bash-specific settings, but adds them to the
>>> bash package so they are only used when bash is installed on the target
>>> system.
>>>
>>> bash_profile.sh contains the variables, aliases, and color profile that
>>> were previously in system/skeleton/etc/profile. The changes to bash.mk
>>> use a post-install hook to install bash_profile.sh to the target
>>> filesystem, where it will later be sourced by /etc/profile when a bash
>>> shell is started.
>>>
>>> Signed-off-by: David Van Arnem <dvanarnem@cmlab.biz>
>>
>> Thanks for your patch. Following the comments from Maxime Hadjinlian on
>> your patch, I've marked it as "Changes Requested" in our patch tracking
>> system. Please resubmit a new version of your patch that takes into
>> account the comments made by Maxime. Thanks a lot!
>>
>> Thomas
>>
> Hi Thomas,
>
> Can you instruct me on how to get Maxime's comments? I do not see them
> in my emails from this list.
Scratch that, I found them. I will resubmit. Thanks!
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
--
Thanks,
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2416 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151012/4f3fd186/attachment.p7s>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-12 16:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 23:17 [Buildroot] [PATCH 1/1] bash: add default bash settings David Van Arnem
2015-10-08 9:02 ` Maxime Hadjinlian
2015-10-10 9:54 ` Thomas Petazzoni
2015-10-12 16:55 ` David Van Arnem
2015-10-12 16:57 ` David Van Arnem
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox