Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #197303
| From | Mike McClain <mike.junk.46@att.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: A "Where am I" routine |
| Date | 2018-07-07 04:40 +0200 |
| Message-ID | <w8LiG-2SL-7@gated-at.bofh.it> (permalink) |
| References | <w8x61-2M5-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jul 06, 2018 at 06:25:43AM -0500, Richard Owlett wrote:
> I multi-boot several configurations &/or releases of Debian.
> I will run identical test scripts on each.
> I want to store the results in a common logging file.
>
> I can set up an appropriate environment with a custom fstab containing:
> >
> > # create a common area
> > LABEL=owlcommon /home/richard/Documents/tst_common vfat user,rw,umask=000 0 0
> > # a dummy mount labeled to show which instance
> > LABEL=dummy /home/richard/Documents/where/sda14 ext4 user,ro 0 0
> >
> >
> The first statement gives me a directory usable by all.
> The second tells me where I am by using:
> ls /home/richard/Documents/where
> in any test script.
Facing a similar problem of several distributions on one machine I
took a different approach.
I use a separate partition for data '/mc' accessable from all
distributions.
This little script tells me where I'm running from:
#!/bin/bash
# /mc/bin/set_dist set the variable DIST 071512 Mc
# source this file and DIST will transfer to the calling file
# which distribution (based on partition label)
if [ $(grep -c UUID /proc/cmdline) -gt 0 ]; then
bid=$(cut -d'=' -f4 /proc/cmdline | cut -d' ' -f1);
rline=$(blkid | grep $bid) ;
rstr=${rline#*\"};
DIST=${rstr%%\"*};
unset bid rline rstr;
else
DIST=$( e2label $(mount | grep " / " | cut -d" " -f1 ) );
fi
The various partitions are labeled for the Debian version.
This may or may not help you but works for me.
Have fun,
Mike
--
"Beauty without grace is a hook without a bait."
- Ninon de Lenclos
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A "Where am I" routine Richard Owlett <rowlett@cloud85.net> - 2018-07-06 13:30 +0200
Re: A "Where am I" routine Zenaan Harkness <zenaan@freedbms.net> - 2018-07-06 14:20 +0200
Re: A "Where am I" routine Richard Owlett <rowlett@cloud85.net> - 2018-07-06 16:10 +0200
Re: A "Where am I" routine David Christensen <dpchrist@holgerdanske.com> - 2018-07-07 04:40 +0200
Re: A "Where am I" routine Zenaan Harkness <zenaan@freedbms.net> - 2018-07-07 05:40 +0200
Re: A "Where am I" routine Mike McClain <mike.junk.46@att.net> - 2018-07-07 04:40 +0200
Re: A "Where am I" routine David Wright <deblis@lionunicorn.co.uk> - 2018-07-10 20:50 +0200
Re: A "Where am I" routine john doe <johndoe65534@mail.com> - 2018-07-10 21:10 +0200
Re: A "Where am I" routine Richard Owlett <rowlett@cloud85.net> - 2018-07-10 22:30 +0200
csiph-web