LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   In slack 13; what package installs /etc/rc.d/rc.4 script? (http://www.linuxquestions.org/questions/slackware-14/in-slack-13%3B-what-package-installs-etc-rc-d-rc-4-script-787031/)

linus72 02-04-2010 12:14 PM

In slack 13; what package installs /etc/rc.d/rc.4 script?
 
I'm trying to figure out how to configure my customized Slim DM
to overwrite the installed /etc/rc.d/rc.4 script with the one I put in
my slim build from source

However, it just installs it as rc.4.new and not rc.4
why?

would it be easier to instead configure the rc.4 that initially gets installed?

if so, what slack pkg has the /etc/rc.d/* folder??

I'm doing this with Absolute 13.0.8 install cd as its installed size is too big for my lappy hdd and it comes with both gdm and xdm
and I want slim.

So, I removed many many pkgs from install iso, got it down to 370MB and only problem is after install
my rc.4 is in /etc/rc.d but its named rc.4.new and there is also the original rc.4
thats my only issue

How do i do this?

linus72 02-04-2010 12:18 PM

To elaborate more, heres the custom rc.4 I need to have installed when i install from my iso

Code:

#! /bin/sh
#
# rc.4                This file is executed by init(8) when the system is being
#                initialized for run level 4 (XDM)
#
# Version:        @(#)/etc/rc.d/rc.4        2.00        02/17/93
#
# Author:        Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# At least 47% rewritten by:  Patrick J. Volkerding <volkerdi@slackware.com>
#

# Tell the viewers what's going to happen...
echo "Starting up X11 session manager..."

# --- 8< --------------------------------------------------------------------
# Try to use SLiM login manager.  This comes first because if
# SLiM is on the machine then the user probably installed it and wants
# to use it by default:
if [ -x /usr/bin/slim ]; then
  exec /usr/bin/slim
fi

# --- 8< --------------------------------------------------------------------


# Try to use GNOME's gdm session manager.  This comes first because if
# gdm is on the machine then the user probably installed it and wants
# to use it by default:
if [ -x /usr/bin/gdm ]; then
  exec /usr/bin/gdm -nodaemon
fi

# Someone thought that gdm looked prettier in /usr/sbin,
# so look there, too:
if [ -x /usr/sbin/gdm ]; then
  exec /usr/sbin/gdm -nodaemon
fi

# Not there?  OK, try to use KDE's kdm session manager:
if [ -x /opt/kde/bin/kdm ]; then
  exec /opt/kde/bin/kdm -nodaemon
elif [ -x /usr/bin/kdm ]; then
  exec /usr/bin/kdm -nodaemon
fi

# If all you have is XDM, I guess it will have to do:
if [ -x /usr/bin/xdm ]; then
  exec /usr/bin/xdm -nodaemon
elif [ -x /usr/X11R6/bin/xdm ]; then
  exec /usr/X11R6/bin/xdm -nodaemon
fi

# error
echo
echo "Hey, you don't have KDM, GDM, or XDM.  Can't use runlevel 4 without"
echo "one of those installed."
sleep 30

# All done.

I need the highlighted section in the rc.4 script

ponce 02-04-2010 12:19 PM

http://www.slackwiki.org/Doinst.sh

you can see lot of examples how to include customized doinst.sh in slackware sources :)

at, for example, has this line near the end of the slackbuild, just before makepkg
Code:

zcat $CWD/doinst.sh > $PKG/install/doinst.sh
(maybe should be "zcat $CWD/doinst.sh.gz", someone gotta tell Pat :D I was only looking for an example, LOL)

you can find the build files here.

linus72 02-04-2010 12:23 PM

OK

mmm I'm confused as there isnt a Doinst.sh in slim source?
I'm not a script bash expert so please explaing?

linus72 02-04-2010 12:23 PM

I got a SLKBUILD and a build-slim.sh with the source I got from salixos

gapan 02-04-2010 12:25 PM

Code:

mv /etc/rc.d/rc.4.new /etc/rc.d/rc.4
that would certainly work. Or you could just edit the existing rc.4 with the changes.

linus72 02-04-2010 12:26 PM

heres the pkg, please note I have modified it considerably from that one

http://salix.enialis.net/i486/13.0/source/xap/slim/

linus72 02-04-2010 12:26 PM

Ha
hey Gapan, where do i put that command?

linus72 02-04-2010 12:29 PM

Heres the modified makefile in source

I removed all the themes, added my icelite theme
and highlighted the rc.4 command

Code:

# Makefile for slim - generic Linux
#
# Edit the following section to adjust the options
# to fit into your operating system / distribution
#######################################################
CXX=/usr/bin/g++
CC=/usr/bin/gcc
CFLAGS=-Wall -I. -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/libpng12 -I/usr/include
CXXFLAGS=$(CFLAGS)
LDFLAGS=-lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng12 -lz -lm -lcrypt -lXmu -lpng -ljpeg
CUSTOM=-DHAVE_SHADOW
ifdef USE_PAM
LDFLAGS+= -lpam
CUSTOM+= -DUSE_PAM
endif
PREFIX=/usr
CFGDIR=/etc
MANDIR=/usr/man
DESTDIR=
#######################################################

NAME=slim
VERSION=1.3.1

DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
                -DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"

OBJECTS=jpeg.o png.o main.o image.o numlock.o cfg.o switchuser.o app.o panel.o
ifdef USE_PAM
OBJECTS+=PAM.o
endif

all: slim

slim: $(OBJECTS)
        $(CXX) $(LDFLAGS) $(OBJECTS) -o $(NAME)

.cpp.o:
        $(CXX) $(CXXFLAGS) $(DEFINES) $(CUSTOM) -c $< -o $@

.c.o:
        $(CC) $(CFLAGS) $(DEFINES) $(CUSTOM) -c $< -o $@

install: slim install-theme
        install -D -m 755 slim $(DESTDIR)$(PREFIX)/bin/slim
        install -D -m 644 slim.1 $(DESTDIR)$(MANDIR)/man1/slim.1
        test -e $(DESTDIR)$(CFGDIR)/slim.conf || \
                install -D -m 644 slim.conf $(DESTDIR)$(CFGDIR)/slim.conf && install -D -m 644 rc.4 $(DESTDIR)$(CFGDIR)/rc.d/rc.4
clean:
        @rm -f slim *.o

dist:
        @rm -rf $(NAME)-$(VERSION)
        @mkdir $(NAME)-$(VERSION)
        @cp -r *.cpp *.h *.c Makefile Makefile.* COPYING ChangeLog INSTALL README TODO \
                xinitrc.sample slim.1 rc.4 THEMES themes slim.conf $(NAME)-$(VERSION)
        @rm -rf $(NAME)-$(VERSION)/themes/.svn        $(NAME)-$(VERSION)/themes/default/.svn
        @tar cvzf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)
        @rm -rf $(NAME)-$(VERSION)


install-theme:
        install -D -m 644 themes/default/slim.theme \
                $(DESTDIR)$(PREFIX)/share/slim/themes/default/slim.theme
        install -D -m 644 themes/default/panel.png \
                $(DESTDIR)$(PREFIX)/share/slim/themes/default/panel.png
        install -D -m 644 themes/default/background.jpg \
                $(DESTDIR)$(PREFIX)/share/slim/themes/default/background.jpg
        install -D -m 644 themes/icelite/slim.theme \
                $(DESTDIR)$(PREFIX)/share/slim/themes/icelite/slim.theme
        install -D -m 644 themes/icelite/panel.png \
                $(DESTDIR)$(PREFIX)/share/slim/themes/icelite/panel.png
        install -D -m 644 themes/icelite/background.jpg \
                $(DESTDIR)$(PREFIX)/share/slim/themes/icelite/background.jpg


ponce 02-04-2010 12:31 PM

first time I see a salix buildscript, but reading it I suppose after
Code:

for i in ${dotnew[@]}; do
echo "dotnew $i" >> $startdir/pkg/install/doinst.sh
done
fi

add
Code:

echo "mv /etc/rc.d/rc.4.new /etc/rc.d/rc.4" >> $startdir/pkg/install/doinst.sh
just before the closing bracket, on a separate line

linus72 02-04-2010 12:32 PM

The end result of ./build-slim.sh

Code:

Creating Slackware package:  /root/Desktop/SLIM/nubuild/slim-1.3.1-i486-1gv.txz

./
install/
install/slack-desc
install/doinst.sh
usr/
usr/bin/
usr/bin/slim
usr/man/
usr/man/man1/
usr/man/man1/slim.1.gz
usr/share/
usr/share/slim/
usr/share/slim/themes/
usr/share/slim/themes/icelite/
usr/share/slim/themes/icelite/background.jpg
usr/share/slim/themes/icelite/slim.theme
usr/share/slim/themes/icelite/panel.png
usr/share/slim/themes/default/
usr/share/slim/themes/default/background.jpg
usr/share/slim/themes/default/slim.theme
usr/share/slim/themes/default/panel.png
usr/src/
usr/src/slim-1.3.1/
usr/src/slim-1.3.1/slim-1.3.1.tar.gz
usr/src/slim-1.3.1/build-slim.sh
usr/src/slim-1.3.1/SLKBUILD
usr/doc/
usr/doc/slim-1.3.1/
usr/doc/slim-1.3.1/INSTALL
usr/doc/slim-1.3.1/ChangeLog
usr/doc/slim-1.3.1/COPYING
usr/doc/slim-1.3.1/README
usr/doc/slim-1.3.1/THEMES
usr/doc/slim-1.3.1/TODO
etc/
etc/rc.d/
etc/rc.d/rc.4.new
etc/slim.conf.new

Slackware package /root/Desktop/SLIM/nubuild/slim-1.3.1-i486-1gv.txz created.

Package has been built.
Cleaning pkg and src directories


linus72 02-04-2010 12:36 PM

Heres the modified SLKBUILD
what do I change?

Code:

#Maintainer: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=slim
pkgver=1.3.1
pkgrel=1gv
arch=i486
source=slim-1.3.1.tar.gz
sourcetemplate=
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "themes")
url=http://slim.berlios.de/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"slim - Simple Login Manager"
"SLiM is a Desktop-independent graphical login manager for X11, derived"
"from Login.app. It aims to be light and simple, although completely"
"configurable through themes and an option file; is suitable for"
"machines on which remote login functionalities are not needed."
)


build() {
        cd $startdir/src/$pkgname-$pkgver
        sed -i "s/CFLAGS=/CFLAGS+= /" Makefile
        make || return 1
        make install DESTDIR=$startdir/pkg
        THEMES="icelite"
        for i in $THEMES; do
                cp -a $startdir/src/$i $startdir/pkg/usr/share/slim/themes
        done
        chown -R root:root $startdir/pkg/usr/share/slim/themes
        sed -i "s/current_theme\(.*\)/current_theme icelite/" $startdir/pkg/etc/slim.conf
}


ponce 02-04-2010 12:38 PM

EDIT: sorry just read it well

linus72 02-04-2010 12:42 PM

this is my only snag, i got the install down fron 3.6+ gb to 1.9 gb but at runlevel 4 it hits the orig rc.4 and stops cause the slim part aint in rc.4....

ponce 02-04-2010 12:44 PM

you can try putting it just before the end bracket on the last line of your buildscript.


All times are GMT -5. The time now is 09:19 PM.