Oberon/A2/myaos

&#35;!/bin/bash # # workingVolume=/dev/disk/by-partuuid/0006ebcf-03 echo workingVolume is $workingVolume. mountPoint=/home/root/AY echo mountPoint is $mountPoint. workingDirectory=/home/root/AY echo workingDirectory=$workingDirectory. if &#91;&#91; $(hostname) = xo-53-1d-bb* ]]; then h="xo" elif &#91;&#91; $(hostname) = joule* ]]; then h="joule" else h=$(hostname --short) fi echo h = $h Aos { AosContextDir=$PWD cd $workingDirectory if test -f Configuration.$h.XML then echo Copying Configuration.$h.XML to Configuration.XML. /bin/cp Configuration.$h.XML Configuration.XML if test -f Oberon.$h.Text then echo Copying Oberon.$h.Text to Oberon.Text. /bin/cp Oberon.$h.Text Oberon.Text /bin/rm --force --verbose AOS*.Log /bin/rm --force --verbose Trap*.txt /bin/rm --force --verbose .tmp.* /usr/bin/aos else echo Oberon.$h.Text not present in $workingDirectory. Aborting. fi  else echo Configuration.$h.XML not present in $workingDirectory. Aborting. fi  cd $AosContextDir } if test -b $workingVolume then if findmnt -rn $workingVolume then echo working volume is mounted. Aos else echo working volume is not mounted. if /sbin/fsck -p $workingVolume then echo Filesystem in $workingVolume passed fsck. mount -v $workingVolume Aos else echo fsck found a problem in $workingVolume and attempted repair. Try again. fi  fi else echo $workingVolume containing working files not connected. Aborting. fi
 * 1) A script to start UnixAos with a working directory which can be in a
 * 2) removable flash store.
 * 3) A flash store is accommodated in multiple machines by copying
 * 4) machine specific configurations into Configuration.XML and
 * 5) Oberon.Text.
 * 1) Conditions for this script to work.
 * 2) * The volume containing the working files has a reliable name.
 * 3)   The names in /dev/disk/by-label/ and /dev/disk/by-partuuid/
 * 4)   are convenient.  For example, a volume labeled A will appear
 * 5)   as /dev/disk/by-label/A.  Additional details here.
 * 6)   http://reactivated.net/writing_udev_rules.html#builtin
 * 7)   https://wiki.debian.org/udev
 * 8) * A mount point and working directory exist for the working volume.
 * 9)   mountPoint and workingDirectory can be the same or different.
 * 10)   What if the volume is automounted at a second location?
 * 11)   If edit conflict is avoided, a second mount is probably harmless.
 * 12) * The following assignments to workingVolume, mountPoint
 * 13)   and workingDirectory are consistent with preceding information.
 * 14) * An appropriate entry exists in /etc/fstab.  Example.
 * 15)   /dev/A /home/me/A ext2 defaults,user,users,exec,noauto 0 0
 * 16) * /etc/sudoers.d/sudoers is adjusted to allow the user to fsck the
 * 17)   working filesystem.
 * 18)   me mycomputer = NOPASSWD: /sbin/fsck
 * 19)   Test fsck interactively.
 * 20) * If the working volume is removeable the user can mount it.  Note the
 * 21)   user option in /etc/fstab.
 * 22) * Prior to revision 10272 the start scipt was /usr/bin/aos.
 * 23)   For revision 10272 the start script is /usr/local/bin/a2
 * 24) * aos or a2 attempts to create the link &#60;workingDirectory>/.aoshome
 * 25)   to the installation directory but a FAT file system disallows links.
 * 26)   This can be resolved by reformatting to ext2.
 * 27)   &#104;ttps://en.&#119;ikipedia.org/wiki/Ext2
 * 1) workingVolume=/dev/disk/by-label/A
 * 1) For any hostname violating Oberon file name syntax, make a conformant name.
 * 2) Ref. https:&#47;/www.tldp.org/LDP/abs/html/comparison-ops.html
 * 1) Add more cases here.