System information

Sharing and maintaining SLES 10 SP2 Linux under z/VM 45
TGT="/mnt/target"
echo "" 1
echo "Backing up and modifying /etc/init.d/boot script ..."
cp $TGT/etc/init.d/boot $TGT/etc/init.d/boot.orig
if [ "$?" != 0 ]; then exit 47; fi
cat $TGT/etc/init.d/boot.orig | \
sed -e 's:bootrc=/etc/init.d/boot.d:bootrc=/sbin/etc/init.d/boot.d:g' > \
$TGT/etc/init.d/boot
if [ "$?" != 0 ]; then exit 48; fi
echo "" 2
echo "Backing up and patching /etc/init.d/boot.rootfsck script ..."
cp $TGT/etc/init.d/boot.rootfsck $TGT/etc/init.d/boot.rootfsck.orig
if [ "$?" != 0 ]; then exit 49; fi
patch $TGT/etc/init.d/boot.rootfsck < $rorDiffs
if [ "$?" != 0 ]; then exit 50; fi
echo "" 3
echo "Backing up and copying modified /etc/fstab file ..."
cp $TGT/etc/fstab $TGT/etc/fstab.orig
if [ "$?" != 0 ]; then exit 51; fi
cp $fstabFile $TGT/etc/fstab
if [ "$?" != 0 ]; then exit 52; fi
echo "" 4
echo "Backing up and modifying /etc/zipl.conf file ..."
cp $TGT/etc/zipl.conf $TGT/etc/zipl.conf.orig
if [ "$?" != 0 ]; then exit 53; fi
cat $TGT/etc/zipl.conf.orig | \
sed -e 's/1b0-1bf/1b0(ro),1b1(ro),1b2-1b7,1b8(ro),1b9-1bf/g' > \
$TGT/etc/zipl.conf
cp $fstabFile $TGT/etc/fstab
if [ "$?" != 0 ]; then exit 54; fi
The above lines create backup files of the three files that are modified: /etc/init.d/boot,
/etc/init.d/boot.rootfsck and /etc/fstab. In 1 the first script requires only a single
change - to point to /sbin/etc/init.d/boot rather than /etc/init.d/boot: therefore a
simple sed command is used. This change is needed because the /etc/ directory is not
yet available read-write.
In 2 the /etc/init.d/boot.rootfsck, is backed up then it is modified via the patch
command and the supplied diff file. The resulting modified code is in 1.10.5, “Modified
boot.rootfsck file” on page 81.
In 3 the file /etc/fstab is backed up and a modified copy is put in its place. See 1.10.6,
“Configuration file /etc/fstab” on page 86 for the contents of that file.
Finally in 4 the parameter line in the file /etc/zipl.conf is modified so that the 1B0
(/boot/), 1B1 (root) and 1B8 (/usr/) disks get the ro parameter so the Linux kernel knows
they are read-only.
The code continues.
echo ""
echo "Copying source /etc/, /root/ and /srv/ to target /local/ ..."
cp -a $TGT/etc $TGT/local
if [ "$?" != 0 ]; then exit 54; fi
cp -a $TGT/root $TGT/local
if [ "$?" != 0 ]; then exit 55; fi
cp -a $TGT/srv $TGT/local
if [ "$?" != 0 ]; then exit 56; fi