Updated September 05, 2003
Created September 05, 2003


Autogenerated Site Map
Search this Site!:
Search this site powered by FreeFind

Here is my ntpdate.tgz

tar -tzvf ../rh72-ssh/ntpdate.tgz
drwxr-sr-x riblack/ftpadmin  0 2003-06-06 22:36:25 ./
drwxr-sr-x riblack/ftpadmin  0 2003-06-06 22:05:21 ./lib/
lrwxrwxrwx riblack/ftpadmin  0 2003-06-06 22:35:46 ./lib/libcap.so.1 -> libcap.so.1.10
-rw-r--r-- riblack/ftpadmin 44851 2001-07-16 14:54:28 ./lib/libcap.so.1.10
drwxr-sr-x riblack/ftpadmin     0 2003-06-06 22:05:35 ./usr/
drwxr-sr-x riblack/ftpadmin     0 2003-06-06 22:05:21 ./usr/sbin/
-rwxr-xr-x riblack/ftpadmin 40460 2001-09-05 05:54:43 ./usr/sbin/ntpdate
drwxr-sr-x riblack/ftpadmin     0 2003-06-06 22:36:25 ./sbin/
-rwxr-xr-x riblack/ftpadmin 30444 2001-08-26 17:51:38 ./sbin/hwclock

Here is my %pre section:

#Set up a ramdisk for our anaconda add-ons
##
# Need a device node for the ramdisk to store our stuff
if [ ! -e /dev/ram2 ]; then mknod /dev/ram2 b 1 2; fi
# Format and mount the ramdisk
mke2fs /dev/ram2
mkdir /mnt/new
mount /dev/ram2 /mnt/new



##
## Let's add-on ntpdate to set the time
##
# FTP Automation script to retrieve files
cat <<EOF>~/.netrc
machine 172.48.0.10 login anonymous password ftp
macdef init
bin
cd pub/rh72-ssh
lcd /mnt/new
get ntpdate.tgz
quit

default login anonymous password ftp
EOF
# Download the files mentioned in the above ~/.netrc file
if [ ! -e /etc/services ]; then cp /mnt/runtime/etc/services /etc; fi
cd /mnt/new
ftp 172.48.0.10
tar -xzf ntpdate.tgz

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/new/lib
for X in `find . -type d | grep -v ^\./usr/ | grep -v ^\./lib/ | grep -v '^.$' | grep -v 'lost+found' | sed -e 's,^\./,,'`; do mkdir -p /$X; done
for X in `find . -type f | grep -v ^\./usr/ | grep -v ^\./lib/ | grep -v passwd | sed -e 's,^\./,,'`; do ln -s /mnt/new/$X /$X; done
for X in `find usr/ -type d | sed -e 's,usr/,,'`; do mkdir -p /$X; done
for X in `find usr/ -type f | sed -e 's,usr/,,'`; do ln -s /mnt/new/usr/$X /$X; done


##Activating add-on ntpdate (Setting the time)
# Set date/time now
echo -ne "Old time... "
date
/mnt/new/usr/sbin/ntpdate -s -b -p 8 ntp1.domain.net ntp2.domain.net
echo -ne "New time... "
date
# Make the time stick in the hardware here:
/mnt/new/sbin/hwclock --utc --systohc



Alt method from another user:
One could use rdate in %pre, it is a very simple binary - just  c.6220 bytes and
links against only /lib/ld-linux.so.2

Search this Site!:
Search this site powered by FreeFind

Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/sitemap.html