sudo 1.7.4 build script

Miscellaneous tools
Post Reply
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

sudo 1.7.4 build script

#1 Post by jpeps »

Build script for sudo-1.7.4. Makes sudo-1.7.4.pet > mnt/home

note: script tested with Lucid and 4.3.1

To add user: run "visudo" (looks for /usr/bin/vi, so link favorite editor)

example:
spot ALL=(ALL) NOPASSWD: ALL

hint: to have terminal always open to user, add to /etc/profile.local
ex: "su spot"

Code: Select all

#!/bin/sh

cd /tmp
mkdir sudo-1.7.4
wget http://www.sudo.ws/sudo/dist/sudo-1.7.4p4.tar.gz
tar -xvzf sudo-1.7.4p4.tar.gz  
cd sudo-1.7.4p4
./configure --with-pam=no --with-pam-login=no --disable-pam-session CFLAGS="-mtune=i486 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"  --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make DESTDIR=/tmp/sudo-1.7.4 install
cd /tmp/sudo-1.7.4

rm -r usr/share 
rm -r var
find . | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

cd ..
tar -cvzf sudo-1.7.4.tar.gz sudo-1.7.4/*
tgz2pet sudo-1.7.4.tar.gz 
cp  sudo-1.7.4.pet /mnt/home

rm -r sudo*   
clear
echo "sudo-1.7.4.pet is now in /mnt/home"

exit

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2 Post by jpeps »

I took out any /var files, which can break cups and don't otherwise appear necessary.

notes: If you add user to /etc/profile.local (eg, "su spot" ), puppy should boot to prompt in user shell. Type "exit" to load X (drops to root shell).

Script to quickly close most recent terminal window in user shell..name something like "q"

Code: Select all

 #!/bin/sh
###  exits most recent terminal window

VAR="$(ps | grep rxvt | grep -v "grep" | tail -n 1 | awk '{print $1}')"
sudo kill -9 "$VAR"

Post Reply