source: MondoRescue/trunk/mindi/rootfs/sbin/wait-for-petris @ 588

Last change on this file since 588 was 378, checked in by andree, 14 years ago

Made it so that wait-for-petris picks the correct linker for the
architecture at hand rather than just looking for /lib/ld-linux.so.2
which only exists on i386. This fixes calling petris on amd64 (and
hopefully on ia64, too).

  • Property svn:keywords set to Id
File size: 786 bytes
Line 
1#!/bin/sh
2#
3# Startup Petris
4#
5
6# Say what we are doing
7echo -n "Waiting for petris"
8# Get the right linker for architecture
9arch=`uname -m`
10case $arch in
11  'ia64')
12    linker="/lib/ld-linux-ia64.so.2" ;;
13  'x86_64')
14    linker="/lib/ld-linux-x86-64.so.2" ;;
15  *)
16    # we only run on the above two and IA32, so this must be it
17    linker="/lib/ld-linux.so.2" ;;
18esac
19# First wait for the libraries to become available...
20while   [ ! -f /lib/libncurses.so.5 -o ! -f /lib/libc.so.6 -o ! -f "$linker" ] ; do
21  echo -n "."
22  sleep 1
23done
24# ...then wait for petris
25which petris > /dev/null
26while [ $? -ne 0 ] ; do
27  echo -n "."
28  sleep 1
29  which petris > /dev/null
30done
31# Keep running petris until it's killed or crashes
32while [ $? -eq 0 ] ; do
33    clear
34    sleep 1
35    petris
36done
37exit 0
Note: See TracBrowser for help on using the repository browser.