CVS: src/si/rpm Configure.sh,NONE,1.1 Makefile,NONE,1.1 umlsi.sh,NONE,1.1 umlsi.spec,NONE,1.1
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-serv6542
Added Files:
Configure.sh Makefile umlsi.sh umlsi.spec
Log Message:
Checkpointing develelopmental umlsi-rpm files so they're not lost
They might not end up looking like this, or being in this location
--- NEW FILE ---
#!/bin/sh
#
# configure the lsbsi-uml
#
LIB=/opt/lsb-umlsi/lib
BIN=/opt/lsb-umlsi/bin
DATA=/var/opt/lsb-umlsi
CONFIG=${DATA}/config.status
MNT=/mnt/umlsi
LOOPDEV=/dev/loop0
LOOPDEV2=/dev/loop1
LOOPDEV3=/dev/loop2
FSTAB=$MNT/etc/fstab
#XXX need a trap-and-cleanup!!!
# if we have a saved config file, use settings from it as defaults.
# else, fill in the default defaults (this is the place to change those...)
#
if [ -f ${CONFIG} ] ; then
. ${CONFIG}
else
use_swap='y'
swap_size=64
swapdev=${DATA}/swap_fs
use_home='y'
home_size=40
homedev=${DATA}/home_fs
use_opt='y'
opt_size=128
optdev=${DATA}/opt_fs
use_hostfs='y'
fi
# 0. setup root_fs so it can be modified
#
losetup ${LOOPDEV} ${LIB}/root_fs
if [ $? -ne 0 ] ; then
losetup ${LOOPDEV2} ${LIB}/root_fs
if [ $? -ne 0 ] ; then
echo "Fatal error: loopback devices ${LOOPDEV} and ${LOOPDEV2} not available" >&2
exit 1
else
LOOPDEV=${LOOPDEV2}
LOOPDEV2=${LOOPDEV3}
fi
fi
if [ ! -d $MNT ] ; then mkdir $MNT ; fi
mount ${LOOPDEV} ${MNT}
if [ $? -ne 0 ] ; then
echo "Fatal error: mounting of ${LOOPDEV} on ${MNT} failed" >&2
exit 1
fi
# 1. (optional) swap - 64 meg suggested
#
echo -n "Use a swap device [ ${use_swap} ] "
read input
if [ -z ${input} ]; then
input=${use_swap}
fi
use_swap=${input}
if [ ${use_swap} = 'y' ] ; then
make='n'
if [ -f ${swapdev} ] ; then
echo -n "swap device ${swapdev} exists, reuse (y for yes)? "
read input
if [ ${input} != 'y' ] ; then
make='y'
fi
else
make='y'
fi
if [ ${make} = 'y' ] ; then
echo -n "swap device [ $swapdev ] "
read input
if [ -z $input ]; then
input=$swapdev
fi
swapdev=${input}
echo -n "swap size in MB [ $swap_size ] "
read input
if [ -z ${input} ]; then
input=${swap_size}
fi
swap_size=${input}
rm ${swapdev} 2> /dev/null
dd if=/dev/zero of=${swapdev} bs=1M count=${swap_size}
mkswap ${swapdev}
fi
echo "/dev/ubd/1 none swap sw" >> $FSTAB
fi
# 2. (optional) /home, suggest 128 meg to run lsb-runtime-test, else 50
#
echo -n "Use a separate /home [ ${use_home} ] "
read input
if [ -z ${input} ]; then
input=${use_home}
fi
use_home=${input}
if [ ${use_home} = 'y' ] ; then
make='n'
if [ -f ${homedev} ] ; then
echo -n "home device ${homedev} exists, reuse (y for yes)? "
read input
if [ ${input} != 'y' ] ; then
make='y'
fi
else
make='y'
fi
if [ ${make} = 'y' ] ; then
echo -n "home device [ $homedev ] "
read input
if [ -z ${input} ]; then
input=$homedev
fi
homedev=${input}
echo -n "home size in MB (suggest 128 if installing lsb-runtime-test) [ ${home_size} ] "
read input
if [ -z ${input} ]; then
input=${home_size}
fi
home_size=${input}
rm ${homedev} 2> /dev/null
dd if=/dev/zero of=${homedev} bs=1M count=${home_size}
losetup ${LOOPDEV2} $DATA/home_fs
mke2fs ${LOOPDEV2}
tune2fs -j ${LOOPDEV2}
losetup -d ${LOOPDEV2}
fi
echo "/dev/ubd/2 /home ext3 defaults 1 2" >> $FSTAB
fi
# 3. /opt, suggest 128 meg
#
echo -n "Use a separate /opt [ ${use_opt} ] "
read input
if [ -z ${input} ]; then
input=${use_opt}
fi
use_opt=${input}
if [ ${use_opt} = 'y' ] ; then
make='n'
if [ -f ${optdev} ] ; then
echo -n "opt device ${optdev} exists, reuse (y for yes)?"
read input
if [ ${input} != 'y' ] ; then
make='y'
fi
else
make='y'
fi
if [ ${make} = 'y' ] ; then
echo -n "opt device [ $optdev ] "
read input
if [ -z ${input} ]; then
input=$optdev
fi
optdev=${input}
echo -n "opt size in MB [ $opt_size ] "
read input
if [ -z ${input} ]; then
input=${opt_size}
fi
opt_size=${input}
rm ${optdev} 2> /dev/null
dd if=/dev/zero of=${optdev} bs=1M count=${opt_size}
losetup ${LOOPDEV2} $DATA/opt_fs
mke2fs ${LOOPDEV2}
tune2fs -j ${LOOPDEV2}
losetup -d ${LOOPDEV2}
fi
echo "/dev/ubd/3 /opt ext3 defaults 1 2" >> $FSTAB
fi
# 4. (optional) add hostfs mount
#
echo -n "Mount the host's filesystem as /mnt/host [ ${use_hostfs} ] "
read input
if [ -z ${input} ]; then
input=${use_hostfs}
fi
use_hostfs=${input}
if [ ${use_hostfs} = 'y' ] ; then
echo "none /mnt/disk hostfs defaults" >> $FSTAB
fi
# 5. (optional) add networking
# XXX
# 6. clean up the mount
#
umount ${MNT}
losetup -d ${LOOPDEV}
# 7. save the settings to the config.status file
#
echo "# uml-si configuration file" > ${CONFIG}
echo "#" `date` >> ${CONFIG}
echo "use_swap=${use_swap}" >> ${CONFIG}
echo "swap_size=${swap_size}" >> ${CONFIG}
echo "swapdev=${swapdev}" >> ${CONFIG}
echo "use_home=${use_home}" >> ${CONFIG}
echo "home_size=${home_size}" >> ${CONFIG}
echo "homedev=${homedev}" >> ${CONFIG}
echo "use_opt=${use_opt}" >> ${CONFIG}
echo "opt_size=${opt_size}" >> ${CONFIG}
echo "optdev=${optdev}" >> ${CONFIG}
echo "use_hostfs=${use_hostfs}" >> ${CONFIG}
--- NEW FILE ---
PACKAGE=lsb-umlsi
BUILDROOT=/var/tmp/lsb-umlsi-root
specf=umlsi.spec
dest=${BUILDROOT}/tmpmnt
all:
@echo "Building ${PACKAGE}"
@if [ -e ${BUILDROOT} ] ; then rm -rf ${BUILDROOT} ; fi
@mkdir -p ${BUILDROOT}/opt/lsb-umlsi/lib
@mkdir -p ${BUILDROOT}/opt/lsb-umlsi/bin
@mkdir -p ${BUILDROOT}/var/opt/lsb-umlsi/lib
@cp Configure.sh ${BUILDROOT}/opt/lsb-umlsi/bin/Configure
@cp umlsi.sh ${BUILDROOT}/opt/lsb-umlsi/bin/umlsi
@-mkdir -p ${dest}
@dd if=/dev/zero of=${BUILDROOT}/opt/lsb-umlsi/lib/root_fs bs=1M count=200
@losetup /dev/loop2 ${BUILDROOT}/opt/lsb-umlsi/lib/root_fs
@mke2fs /dev/loop2
@tune2fs -j /dev/loop2
@mount /dev/loop2 ${dest}
@echo -n "Copying files ... "
@(cd /usr/src/si/lsbsi ; find . -print | cpio -pdmu ${dest})
@(cd /usr/src/si/lsbsi-uml ; find . -print | cpio -pdmu ${dest})
@echo "Done."
@umount /dev/loop2
@losetup -d /dev/loop2
@echo -n "Making rpm... "
@if test -f /usr/bin/rpmbuild; then \
rpmbuild --rcfile rpmrc -bb ${specf}; \
else \
rpm --rcfile rpmrc -bb ${specf}; \
fi
@echo "Done."
@-rm -rf ${BUILDROOT}
install:
clean:
rm -rf *spec rpmrc rpmmacros i486
distclean: clean
--- NEW FILE ---
#!/bin/sh
# start up the lsb-si UML
#
BIN=/opt/lsb-umlsi/bin
LIB=/opt/lsb-umlsi/lib
DATA=/var/opt/lsb-umlsi
if [ -f ${DATA}/config.status ] ; then
. ${DATA}/config.status
else
echo "The LSB-si UML environment is not configured. Running $BIN/Configure"
echo "when complete, please rerun this program"
exec ${BIN}/Configure
fi
CMD="linux ubd0=${LIB}/root_fs root=/dev/ubd/0"
if [ ${use_swap} = 'y' ] ; then
CMD="${CMD} ubd1=${swapdev} swap=/dev/ubd/1"
fi
if [ ${use_home} = 'y' ] ; then
CMD="${CMD} ubd2=${homedev}"
fi
if [ ${use_opt} = 'y' ] ; then
CMD="${CMD} ubd3=${optdev}"
fi
# add networking here
# this seems to be needed for LSB compat
CMD="${CMD} devfs=nomount"
exec ${CMD}
--- NEW FILE ---
Summary: UML-based sample implementation
Name: lsb-umlsi
Version: 1.3
Release: 1
Copyright: FSG
Group: DevelopmentTools
Requires: user_mode_linux
Buildroot: /var/tmp/lsb-umlsi-root
AutoReqProv: no
PreReq: lsb >= 1.3
%description
LSB sample implementation user-mode Linux environment
%pre
%install
%post
%preun
%postun
%clean
%files
/opt/lsb-umlsi
/var/opt/lsb-umlsi