DevHeads.net

How to avoid "firstboot" in CentOS 7 kickstart

Dear Experts,

Sorry about taking shortcut and asking everybody...

My question is: how do you avoid "firstboot" screen in latest CentOS 7.3
kickstart.

I have installed about a dozen of CentOS 7 (none of which was 7.3) with
that kickstart file. None of them ever went to firstboot screen on first
boot. Now after kickstart installation of CentOS 7.3 it goes into
firstboot screen showing two configuration options:

1. [x] License information
(license accepted)

2. [ ] User creation
(no user will be created

Please, make your choice from the above { quit, continue or refresh }

Here are relevant lines from my kickstart that I assume should have taken
care of everything (in the order of their appearance, I dropped irrelevant
lines):

firstboot --disable
eula --agreed

(I always were creating one regular user in a post install section, which
I do have in this KS file, and that user is successfully created)

Thanks for all your help!

Valeri

++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++

Comments

Re: How to avoid "firstboot" in CentOS 7 kickstart

By Ian Mortimer at 01/11/2017 - 00:47

You could try adding in your %packages stanza:

-firstboot

Re: How to avoid "firstboot" in CentOS 7 kickstart

By Tru Huynh at 01/11/2017 - 09:22

On Wed, Jan 11, 2017 at 04:47:49AM +0000, Ian Mortimer wrote:
Cheers

Tru

Re: [SOLVED] How to avoid "firstboot" in CentOS 7 kicks

By Valeri Galtsev at 01/12/2017 - 11:23

On Wed, January 11, 2017 7:22 am, Tru Huynh wrote:
Thanks Tru!

The above placed in postinstall does disable "firstboot" - and it works
both for system configured to be booted into runlevel 5 and runlevel 3, no
matter that "...setup-graphical" intuitively suggests only runlevel 5. So
much for straight thinking when naming things these days (sorry about
runt). Incidentally, this setting does not disable introduction to the
system on first login for local logins on runlevel 5 (I probably msiread
someone's post and was under impression it will or may, so I specifically
tested whether it does or does not - it does not).

Here is my relevant part of kickstart file postinstall (with runlevel 3):

%post
##########
# blasted new way of setting default runlevel 3
systemctl set-default multi-user.target

# turning off firstboot
# works both for runlevel 5 and runlevel 3
# does not disable introduction for local
# user when one first logs into system on runlevel 5
systemctl disable initial-setup-graphical.service
##########
%end

Thanks again, everybody, for your help!

Valeri

++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++

Re: How to avoid "firstboot" in CentOS 7 kickstart

By Gordon Messmer at 01/11/2017 - 11:36

On 01/11/2017 05:22 AM, Tru Huynh wrote:

Has this been tested? My understanding is that systemctl doesn't work
in chroots, and can't be used in %post.

Regardless of that, the graphical initial setup on 7.3 is probably
provided by gnome-initial-setup under GDM, not by
initial-setup-graphical at all. The only way I've been able to disable
it is to remove that rpm entirely, which means that new users also don't
get the initial-setup prompts when they log in for the first time.

Re: How to avoid "firstboot" in CentOS 7 kickstart

By Valeri Galtsev at 01/11/2017 - 12:00

On Wed, January 11, 2017 9:36 am, Gordon Messmer wrote:
First of all, thanks everybody who answered, I'm going through all your
suggestions - nothing to report yet (just started this morning, each
kickstart install takes time...)

Not as an argument, but just to mention (as I don't know how relevant it
is). I switched to runlevel 3 (sorry for using old terminology...) in the
postinstall kickstart section as follows:

# blasted new way of setting default runlevel
systemctl set-default multi-user.target

So, after kickstart it indeed boots into runlevel 3 (i.e. systemctl
command worked for me in postinstall section). Yet, first time booting
(even into runlevel 3) gives me the same firstboot choices (TUI though
instead of GUI that was in runlevel 5). Note, that this all was before I
tried any of your suggestions (Thanks again, Tru, Gordon, and everybody
else who replied!!)

Valeri

++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++

Re: How to avoid "firstboot" in CentOS 7 kickstart

By isdtor at 01/11/2017 - 11:49

I've certainly used it that way in Fedora. chroot /mnt/systemimage
systemctl --no-reload disable ...