From f05c8215678f51eab4417a1a6361f21514e8c261 Mon Sep 17 00:00:00 2001 From: milisarge Date: Sun, 23 Apr 2017 03:37:40 +0300 Subject: [PATCH] ayarlar --- lfs-mekanizma | 5 ++-- rootfs/etc/bashrc | 43 ++++++++++++++++++++++++++ rootfs/etc/profile | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 rootfs/etc/bashrc create mode 100644 rootfs/etc/profile diff --git a/lfs-mekanizma b/lfs-mekanizma index a7dd4f2d1..e312620f5 100755 --- a/lfs-mekanizma +++ b/lfs-mekanizma @@ -1125,9 +1125,10 @@ squashfs_olustur(){ unmount_islemi lfs_kontrol #son ayar yuklemeleri - cp /etc/bashrc $LFS/etc/bashrc + cp rootfs/etc/bashrc $LFS/etc/bashrc + cp rootfs/etc/profile $LFS/etc/profile cp ./ayarlar/mps.conf $LFS/etc/mps.conf - cp ./rootfs/etc/rc.d/init.d/sysklogd $LFS/etc/rc.d/init.d/sysklogd + cp -f ./rootfs/etc/rc.d/init.d/* $LFS/etc/rc.d/init.d/ iso_etiket="MILIS_LIVE" rm iso_icerik/boot/kernel rm iso_icerik/boot/initramfs diff --git a/rootfs/etc/bashrc b/rootfs/etc/bashrc new file mode 100644 index 000000000..01e958308 --- /dev/null +++ b/rootfs/etc/bashrc @@ -0,0 +1,43 @@ +# Begin /etc/bashrc +# Written for Beyond Linux From Scratch +# by James Robertson +# updated by Bruce Dubbs + +# System wide aliases and functions. + +# System wide environment variables and startup programs should go into +# /etc/profile. Personal environment variables and startup programs +# should go into ~/.bash_profile. Personal aliases and functions should +# go into ~/.bashrc + +# Provides a colored /bin/ls command. Used in conjunction with code in +# /etc/profile. + +alias ls='ls --color=auto' + +# Provides prompt for non-login shells, specifically shells started +# in the X environment. [Review the LFS archive thread titled +# PS1 Environment Variable for a great case study behind this script +# addendum.] +export LC_ALL="tr_TR.UTF-8" + +NORMAL="\[\e[0m\]" +RED="\[\e[1;31m\]" +GREEN="\[\e[1;32m\]" +WHITE="\[\e[1;37m\]" + +case $TERM in + xterm|rxvt*) + TITLEBAR='\[\033]0;\u@\h \007\]' + ;; + *) + TITLEBAR='' + ;; +esac + +if [[ $EUID == 0 ]] ; then + PS1="$TITLEBAR$RED\u [ $NORMAL\w$RED ]# $NORMAL" +else + PS1="$TITLEBAR$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL" +fi +# End /etc/bashrc diff --git a/rootfs/etc/profile b/rootfs/etc/profile new file mode 100644 index 000000000..8dfb5c672 --- /dev/null +++ b/rootfs/etc/profile @@ -0,0 +1,75 @@ +# Begin /etc/profile +# Written for Beyond Linux From Scratch +# by James Robertson +# modifications by Dagmar d'Surreal + +# System wide environment variables and startup programs. + +# System wide aliases and functions should go in /etc/bashrc. Personal +# environment variables and startup programs should go into + +# ~/.bashrc. + +# Functions to help us manage paths. Second argument is the name of the +# path variable to be modified (default: PATH) +pathremove () { + local IFS=':' + local NEWPATH + local DIR + local PATHVARIABLE=${2:-PATH} + for DIR in ${!PATHVARIABLE} ; do + if [ "$DIR" != "$1" ] ; then + NEWPATH=${NEWPATH:+$NEWPATH:}$DIR + fi + done + export $PATHVARIABLE="$NEWPATH" +} + +pathprepend () { + pathremove $1 $2 + local PATHVARIABLE=${2:-PATH} + export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}" +} + +pathappend () { + pathremove $1 $2 + local PATHVARIABLE=${2:-PATH} + export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1" +} + +export -f pathremove pathprepend pathappend + +# Set the initial path +export PATH=/usr/bin:/bin:/usr/sbin:/sbin + +if [ $EUID -eq 0 ] ; then + unset HISTFILE +fi + +# Setup some environment variables. +export HISTSIZE=1000 +export HISTIGNORE="&:[bf]g:exit" + +# Set some defaults for graphical systems +export XDG_DATA_DIRS=/usr/share/ +export XDG_CONFIG_DIRS=/etc/xdg/ + +# Setup a red prompt for root and a green one for users. +NORMAL="\[\e[0m\]" +RED="\[\e[1;31m\]" +GREEN="\[\e[1;32m\]" +if [[ $EUID == 0 ]] ; then + PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL" +else + PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL" +fi + +for script in /etc/profile.d/*.sh ; do + if [ -r $script ] ; then + . $script + fi +done + +unset script RED GREEN NORMAL + +# End /etc/profile