-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows the skip of timezone and password dialogs #49
Conversation
e5de2aa
to
c425ee0
Compare
Added a new commit to fix a bug in the btrfs call |
8e06f68
to
3bb0aa2
Compare
Already tested for my use case. |
how do you set those variables? Maybe jeos-firstboot needs a config nowadays and branding packages for different use cases. |
@lnussel creating systemd overlays: #======================================
# Overlay for jeos-firstboot (Yomi)
#--------------------------------------
if [[ "$kiwi_profiles" == *"Live"* ]]; then
LOCALE="en_US"
KEYTABLE="jp"
TIMEZONE="UTC"
mkdir -p /etc/systemd/system/jeos-firstboot.service.d/
cat > /etc/systemd/system/jeos-firstboot.service.d/10-presets.conf <<-EOF
[Service]
Environment=SYSTEMCTL_OPTIONS=--ignore-dependencies TERM=linux LOCALE_PRESET=$LOCALE KEYTABLE_PRESET=$KEYTABLE TIMEZONE_PRESET=$TIMEZONE PASSWORD_ALREADY_SET=1
ExecStartPost=/usr/sbin/langset.sh $LOCALE $KEYTABLE
EOF
fi |
unless you have to meet deadlines so you have to accept hacks I'd recommend to find a better way instead :) |
What I suggested in #44 is to just add
to the .service file and use that for configuration. Alternatively, just sourcing those files inside jeos-firstboot. |
@Vogtinator This makes sense to me. I will change the .service, as is a more clear way. But I wonder if this does not change the current code in this patch. |
@Vogtinator if I do a source inside the code, am I breaking the usage of LOCALE_PRESET and KEYTABLE_PRESET? |
No - if those variables are set in one of the files, it's skipped as it should be. The name of those variables should be changed though to accommodate for the newly gained external visibility. |
9cce9b7
to
30a22c9
Compare
@Vogtinator @lnussel Added the configuration file and renamed the variables. Note that there are two exports for LOCALE_PRESET and KEYTABLE_PRESET that I maintained, as I am not sure if any other process are using them later. |
30a22c9
to
9aee20e
Compare
&& is not -e safe. Use inverse logic or the if variant. |
It actually is:
|
I agree with @Vogtinator. Will exit if cannot read the file at the end of the chain (tested locally) |
9aee20e
to
687333e
Compare
Rename the reexport, as is only used in the second virtual console. Not sure why there is a second virtual console involved, tho. |
22dd4f2
to
03799be
Compare
Partially tested with: #======================================
# Config for jeos-firstboot (Yomi)
#--------------------------------------
if [[ "$kiwi_profiles" == *"Live"* ]]; then
cat > /etc/jeos-firstboot.conf <<-EOF
JEOS_LOCALE="en_US"
JEOS_KEYTABLE="jp"
JEOS_TIMEZONE="UTC"
JEOS_PASSWORD_ALREADY_SET=1
EOF
fi Ready for reviews |
In the same way that LOCALE_PRESET and KEYTABLE_PRESET, this patch introduces a new variable, TIMEZONE_PRESET, that will skip the time-zone dialog box if is set.
As KIWI allows the creation of users and passwords, sometimes we want to skip the root password dialog from jeos-firstboot. This patch introduces a new variable PASSWORD_ALREADY_SET, that if is non zero, will skip the root password dialog.
The currect code assume that if snapper is installed, the file system is btrfs. As both elements are not related, this test can fail for valid deployments. This patch will explicitly check for the file system before calling btrfs cli tools.
Add a configuration file for jeos-firstboot.
Rename the *_PRESET variables and document the re-export in the second virtual console.
03799be
to
801cbef
Compare
Yes, those variables can come from two sources, but that won't actually matter. If it's set in the configuration file, the user isn't even asked, so it can't be overwritten. |
Not very confident of the last PR. I will test it manually, and lets see what openQA says. |
e68fe09
to
75d1fbb
Compare
75d1fbb
to
891eae1
Compare
891eae1
to
8143bd0
Compare
Found some typos, but will fix them after testing |
Add two new variables to jeos-firstboot:
TIMEZONE_PRESET
Based on
LOCALE_PRESET
andKEYTABLE_PRESET
, this new variable will affect thesystemd_firstboot_args
array if is set, and will skip the time-zone dialog.PASSWORD_ALREADY_SET
If set to a non-zero value, will skip the root password dialog. Is expected that the user is setting the root password via other means, like
config.sh
or the Kiwiusers
XML tag.Also fix the call of btrfs on non-btrfs file systems.