CVS: src/si/rpm Configure.sh,1.5,1.6 umlsi.sh,1.5,1.6

Mats Wichmann <[email protected]>
Newsgroups gmane.linux.lsb.implementation
Message-ID <[email protected]>
Update of /cvsroot/lsb/src/si/rpm
In directory sc8-pr-cvs1:/tmp/cvs-serv12031

Modified Files:
	Configure.sh umlsi.sh 
Log Message:
Run Configure in place; look for a .newinstall file which will be
added by the rpm and removed when Configure has completed cleanly.
Add some more comments, and fix a Configure cleanup bug.


Index: Configure.sh
===================================================================
RCS file: /cvsroot/lsb/src/si/rpm/Configure.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Configure.sh	6 Feb 2003 14:27:03 -0000	1.5
--- Configure.sh	11 Feb 2003 22:46:00 -0000	1.6
***************
*** 9,12 ****
--- 9,14 ----
  DATA=/var/opt/lsb-umlsi
  CONFIG=/etc/opt/lsb-umlsi/config.status
+ NEW=/etc/opt/lsb-umlsi/.newinstall
+ 
  MNT=/mnt/umlsi
  LOOPDEV=/dev/loop0
***************
*** 18,26 ****
  cleanup() {
  	trap - 0 1 2 3 13 15
- 	if [ $1 != 0 ] ; then echo -e "\nAborting, no changes saved" >&2 ; fi
  	umount ${MNT} > /dev/null 2>&1
  	losetup -d ${LOOPDEV} > /dev/null 2>&1
! 	losetup -d {LOOPDEV2} > /dev/null 2>&1
! 	exit $1
  }
  
--- 20,31 ----
  cleanup() {
  	trap - 0 1 2 3 13 15
  	umount ${MNT} > /dev/null 2>&1
  	losetup -d ${LOOPDEV} > /dev/null 2>&1
! 	losetup -d ${LOOPDEV2} > /dev/null 2>&1
! 	if [ $1 != 0 ] ; then
! 		echo -e "\nAborting, no changes saved" >&2
! 		exit $1
! 	fi
! 	if [ -f ${NEW} ] ; then rm ${NEW} ; fi
  }
  
***************
*** 49,54 ****
  fi
  
- trap 'cleanup 1' 0 1 2 3 13 15
- 
  # 0. setup root_fs so it can be modified
  #
--- 54,57 ----
***************
*** 59,62 ****
--- 62,66 ----
  losetup ${LOOPDEV} ${LIB}/root_fs > /dev/null 2>&1
  if [ $? -ne 0 ] ; then
+     # try alternate
      losetup ${LOOPDEV2} ${LIB}/root_fs > /dev/null 2>&1
      if [ $? -ne 0 ] ; then
***************
*** 64,71 ****
--- 68,78 ----
  	exit 1
      else
+ 	# alternate worked, shift so names remain consistent throughout
          LOOPDEV=${LOOPDEV2}
  	LOOPDEV2=${LOOPDEV3}
      fi
  fi
+ # at this point, we have loop devices setup, make sure they're closed down
+ trap 'cleanup 1' 0 1 2 3 13 15
  
  if [ ! -d $MNT ] ; then mkdir $MNT ; fi

Index: umlsi.sh
===================================================================
RCS file: /cvsroot/lsb/src/si/rpm/umlsi.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** umlsi.sh	6 Feb 2003 14:27:05 -0000	1.5
--- umlsi.sh	11 Feb 2003 22:46:00 -0000	1.6
***************
*** 9,20 ****
  DATA=/var/opt/lsb-umlsi
  CONFIG=/etc/opt/lsb-umlsi/config.status
  
! if [ -f ${CONFIG} ] ; then
  	. ${CONFIG}
  else
! 	echo "The LSB-si UML environment is not configured."
  	echo "Running $BIN/Configure"
! 	echo "When complete, please rerun this program"
! 	exec ${BIN}/Configure
  fi
  
--- 9,20 ----
  DATA=/var/opt/lsb-umlsi
  CONFIG=/etc/opt/lsb-umlsi/config.status
+ NEW=/etc/opt/lsb-umlsi/.newinstall
  
! if [ -f ${CONFIG} -a ! -f ${NEW} ] ; then
  	. ${CONFIG}
  else
! 	echo "The LSB-si UML environment needs to be configured."
  	echo "Running $BIN/Configure"
! 	. ${BIN}/Configure
  fi
  
***************
*** 32,41 ****
  CMD="${CMD} mem=${mem_size}M"
  
! #XXX add networking setup here
  
  # devfs=nomount seems to be needed for LSB compat
! #   Do not remove lightly: implies a change to the tty devices
! #   in /etc/inittab (to /dev/vc/#, I think), and to the naming
! #   of the ubd devices which will be /dev/ubd/# instead of /dev/ubd#
  CMD="${CMD} devfs=nomount"
  
--- 32,47 ----
  CMD="${CMD} mem=${mem_size}M"
  
! # Add networking setup here
! # Example: eth0=tuntap,,,192.168.1.6
! 
! # Add terminal setup here. If xterm is not okay, add:
! # xterm=<terminal emulator>,<title switch>,<exec switch>
! # Example: xterm=gnome-terminal,-t,-x
! # Example: xterm=konsole,-T,-x
  
  # devfs=nomount seems to be needed for LSB compat
! # Do not remove lightly: implies a change to the tty devices
! # in /etc/inittab (to /dev/vc/#, I think), and to the naming
! # of the ubd devices which will be /dev/ubd/# instead of /dev/ubd#
  CMD="${CMD} devfs=nomount"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.