Artem Bityutskiy
2017-07-03 06:57:36 UTC
Hi,
I am using the stock Fedora 25 OS installer as a "service OS", just
because it is convenient and I do not have to build my own. Should
something bad happen to a host in my automation system, I just boot the
host into the Fedora installer's kernel/initramfs over network and have
a decent rescue environment.
The Fedora OS installer is based on Anaconda. It can find and mount the
"sysroot" to "/mnt/sysimage", which is also very convenient.
Now, I wanted my "service OS" to automatically do this - find the
sysroot and properly mount it without any questions asked. I could not
find the "right" way of doing this, and ended up with a hacky trick.
I am sharing the trick in case someone else will be googling for it in
the future. And of course I'd appreciate better ideas.
First of all, boot anaconda into the rescue mode, by adding
'inst.rescue' to kernel boot parameters.
I also have a bunch of 'inst.ks' and 'inst.stage2' and dracut
networking parameters.
And yes, I have a very small minimal KS file too, which only configures
repositories and some network-related stuff. Does not do anything about
partitions or packages.
Then I put this to my %pre in order to make anaconda proceed with
mounting the sysroot:
tmux send-keys -t anaconda -- 1 C-m
It is hackish, but works. It basically sends key "1" to anaconda, so
anaconda selects the "Continue" choice, and proceeds with mounting
sysroot.
This is not the first time I use anaconda's tmux terminal to achieve my
goals with anaconda. E.g., I use it for capturing anaconda's VGA output
remotely.
So thanks for using tmux in anaconda - very handy!
I am using the stock Fedora 25 OS installer as a "service OS", just
because it is convenient and I do not have to build my own. Should
something bad happen to a host in my automation system, I just boot the
host into the Fedora installer's kernel/initramfs over network and have
a decent rescue environment.
The Fedora OS installer is based on Anaconda. It can find and mount the
"sysroot" to "/mnt/sysimage", which is also very convenient.
Now, I wanted my "service OS" to automatically do this - find the
sysroot and properly mount it without any questions asked. I could not
find the "right" way of doing this, and ended up with a hacky trick.
I am sharing the trick in case someone else will be googling for it in
the future. And of course I'd appreciate better ideas.
First of all, boot anaconda into the rescue mode, by adding
'inst.rescue' to kernel boot parameters.
I also have a bunch of 'inst.ks' and 'inst.stage2' and dracut
networking parameters.
And yes, I have a very small minimal KS file too, which only configures
repositories and some network-related stuff. Does not do anything about
partitions or packages.
Then I put this to my %pre in order to make anaconda proceed with
mounting the sysroot:
tmux send-keys -t anaconda -- 1 C-m
It is hackish, but works. It basically sends key "1" to anaconda, so
anaconda selects the "Continue" choice, and proceeds with mounting
sysroot.
This is not the first time I use anaconda's tmux terminal to achieve my
goals with anaconda. E.g., I use it for capturing anaconda's VGA output
remotely.
So thanks for using tmux in anaconda - very handy!