Compare commits

...

7 Commits

Author SHA1 Message Date
Andrea Bolognani 6c0c1cdde5 Clean dnf history
Otherwise, operations that we perform in %post will show up
in the history of the installed system.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit a6e0b13c5d9da63f7c7d1c15a1a6af103df6c87c)
2024-04-26 10:36:22 +03:00
Andrea Bolognani 40b7729123 Improve creation of regular user
Do it as part of %post instead of waiting until boot.

There are several advantages to this approach: it makes boot
a little bit faster, and prevents a warning about sysvinit
compatibility being deprecated from being printed.

Most importantly, if the user decides to change the password
after installation, that change will now stick instead of
being reverted every time the machine is booted.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 2e51a65e040ac1caf556d0f87e3facea407ca301)
2024-04-26 10:36:09 +03:00
Andrea Bolognani 4a455dc878 Only install English locale
Despite specifically asking for just the English locale, the
all-encompassing langpack is automatically dragged in. Avoid
that by explicitly blocking its installation.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 6dd697fd38a3125fc790b11321172bc2aa3cb2fc)
2024-04-26 10:35:13 +03:00
Andrea Bolognani f878489f61 Normalize bootloader situation
Each image should have exactly one bootloader installed: either
GRUB2 for most images, or sd-boot for the experimental one.

efibootmgr is useful regardless of the bootloader, so it should
always be installed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 5a833e9841344e69f05e3438685f115ac14d841d)
2024-04-26 10:34:54 +03:00
Andrea Bolognani a59e412a4d Avoid @anaconda-tools in minimal images
As the name suggests, these images should contain @core and
little else. For reference, a regular Fedora Workstation
doesn't include all packages in that group.

Since we're no longer installing @anaconda-tools, stop
mentioning it in comments.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 53025f548c6cab2b83dcfdb44e6d798de1163dc2)
2024-04-26 10:34:19 +03:00
Andrea Bolognani db25fe7de6 OpenSSH is part of @core
Both the client and server parts. No need to install them
explicitly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 9eba032a371408489e9869ee5292b5318a7caef4)
2024-04-26 10:33:41 +03:00
Andrea Bolognani eedd994158 Handle services consistently
Services are enabled by default, so there's no need to
explicitly disable them, and disabling a service that's not
installed is a no-op, so we can just use the same exact call
everywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit c3abb28ef8528f6f80cd27eb00c737db7ddd1524)
2024-04-26 10:33:21 +03:00
4 changed files with 68 additions and 150 deletions

View File

@ -13,7 +13,7 @@ rootpw --plaintext fedora_rocks!
firewall --enabled --ssh firewall --enabled --ssh
timezone --utc US/Eastern timezone --utc US/Eastern
selinux --enforcing selinux --enforcing
services --enabled=sshd,NetworkManager,chronyd,haveged --disabled=lm_sensors,libvirtd services --disabled=lm_sensors,libvirtd
zerombr zerombr
clearpart --all --initlabel --disklabel=gpt clearpart --all --initlabel --disklabel=gpt
@ -38,15 +38,14 @@ poweroff
@development-tools @development-tools
@anaconda-tools @anaconda-tools
# This is needed for appliance-tools, as it cannot see what packages are incl. # GRUB2
# in the @anaconda-tools.
grub2-efi-riscv64 grub2-efi-riscv64
grub2-efi-riscv64-modules grub2-efi-riscv64-modules
efibootmgr efibootmgr
# Add for sd-boot # Add for sd-boot
# systemd-boot-unsigned #systemd-boot-unsigned
# edk2-ext4 #edk2-ext4
kernel kernel
kernel-core kernel-core
@ -61,14 +60,17 @@ uboot-images-riscv64
dracut-config-generic dracut-config-generic
-dracut-config-rescue -dracut-config-rescue
# For user creation and manipulation
shadow-utils
passwd passwd
# Adding kiwi for disk image generation # Adding kiwi for disk image generation
kiwi-cli kiwi-cli
openssh # Install the English locale, but not all the other ones
openssh-server
glibc-langpack-en glibc-langpack-en
-glibc-all-langpacks
glibc-static glibc-static
lsof lsof
nano nano
@ -252,10 +254,6 @@ haveged
# end of gcc packages # end of gcc packages
watchdog watchdog
# No longer in @core since 2018-10, but needed for livesys script
initscripts
chkconfig
# Lets resize / on first boot # Lets resize / on first boot
#dracut-modules-growroot #dracut-modules-growroot
@ -423,32 +421,11 @@ dnf -y remove dracut-config-generic
# and mounting processes. This should help on systems where boot takes longer. # and mounting processes. This should help on systems where boot takes longer.
sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab
# Fedora 31 # Create regular user
# https://fedoraproject.org/wiki/Changes/DisableRootPasswordLoginInSshd /usr/sbin/useradd -c "Fedora RISCV User" riscv
cat > /etc/rc.d/init.d/livesys << EOF echo fedora_rocks! | passwd --stdin riscv
#!/bin/bash /usr/sbin/usermod -aG wheel riscv
# /usr/sbin/usermod -aG mock riscv
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager chronyd
### END INIT INFO
. /etc/rc.d/init.d/functions
useradd -c "Fedora RISCV User" riscv
echo fedora_rocks! | passwd --stdin riscv > /dev/null
usermod -aG wheel riscv > /dev/null
usermod -aG mock riscv > /dev/null
exit 0
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
# Create Fedora RISC-V repo # Create Fedora RISC-V repo
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
@ -535,6 +512,9 @@ rm -f /var/lib/systemd/random-seed
# Note that running rpm recreates the rpm db files which aren't needed or wanted # Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db* rm -f /var/lib/rpm/__db*
# Start with a clean dnf history
rm -rf /var/lib/dnf/history.*
# go ahead and pre-make the man -k cache (#455968) # go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb /usr/bin/mandb

View File

@ -13,7 +13,7 @@ rootpw --plaintext fedora_rocks!
firewall --enabled --ssh firewall --enabled --ssh
timezone --utc US/Eastern timezone --utc US/Eastern
selinux --enforcing selinux --enforcing
services --enabled=sshd,NetworkManager,chronyd,haveged services --disabled=lm_sensors,libvirtd
zerombr zerombr
ignoredisk --only-use=vda ignoredisk --only-use=vda
@ -33,10 +33,8 @@ poweroff
%packages %packages
@core @core
@hardware-support @hardware-support
#@anaconda-tools
# This is needed for appliance-tools, as it cannot see what packages are incl. # GRUB2
# in the @anaconda-tools.
-grub2-efi-riscv64 -grub2-efi-riscv64
-grub2-efi-riscv64-modules -grub2-efi-riscv64-modules
-grub2-tools-minimal -grub2-tools-minimal
@ -44,7 +42,6 @@ poweroff
-grub2-tools -grub2-tools
-grub2-efi-riscv64-cdboot -grub2-efi-riscv64-cdboot
-grub2-common -grub2-common
efibootmgr efibootmgr
# Add for sd-boot # Add for sd-boot
@ -63,20 +60,19 @@ uboot-images-riscv64
dracut-config-generic dracut-config-generic
-dracut-config-rescue -dracut-config-rescue
# For user creation and manipulation
shadow-utils
passwd passwd
openssh # Install the English locale, but not all the other ones
openssh-server
glibc-langpack-en glibc-langpack-en
-glibc-all-langpacks
nano nano
chrony chrony
haveged haveged
watchdog watchdog
# No longer in @core since 2018-10, but needed for livesys script
initscripts
chkconfig
# Lets resize / on first boot # Lets resize / on first boot
#dracut-modules-growroot #dracut-modules-growroot
@ -103,32 +99,11 @@ dnf -y remove dracut-config-generic
# and mounting processes. This should help on systems where boot takes longer. # and mounting processes. This should help on systems where boot takes longer.
sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab
# Fedora 31 # Create regular user
# https://fedoraproject.org/wiki/Changes/DisableRootPasswordLoginInSshd /usr/sbin/useradd -c "Fedora RISCV User" riscv
cat > /etc/rc.d/init.d/livesys << EOF echo fedora_rocks! | passwd --stdin riscv
#!/bin/bash /usr/sbin/usermod -aG wheel riscv
# /usr/sbin/usermod -aG mock riscv
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager chronyd
### END INIT INFO
. /etc/rc.d/init.d/functions
useradd -c "Fedora RISCV User" riscv
echo fedora_rocks! | passwd --stdin riscv > /dev/null
usermod -aG wheel riscv > /dev/null
usermod -aG mock riscv > /dev/null
exit 0
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
# Create Fedora RISC-V repo # Create Fedora RISC-V repo
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
@ -215,6 +190,9 @@ rm -f /var/lib/systemd/random-seed
# Note that running rpm recreates the rpm db files which aren't needed or wanted # Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db* rm -f /var/lib/rpm/__db*
# Start with a clean dnf history
rm -rf /var/lib/dnf/history.*
# go ahead and pre-make the man -k cache (#455968) # go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb /usr/bin/mandb

View File

@ -13,7 +13,7 @@ rootpw --plaintext fedora_rocks!
firewall --enabled --ssh firewall --enabled --ssh
timezone --utc US/Eastern timezone --utc US/Eastern
selinux --enforcing selinux --enforcing
services --enabled=sshd,NetworkManager,chronyd,haveged services --disabled=lm_sensors,libvirtd
zerombr zerombr
clearpart --all --initlabel --disklabel=gpt clearpart --all --initlabel --disklabel=gpt
@ -32,17 +32,15 @@ poweroff
%packages %packages
@core @core
@hardware-support @hardware-support
@anaconda-tools
# This is needed for appliance-tools, as it cannot see what packages are incl. # GRUB2
# in the @anaconda-tools.
grub2-efi-riscv64 grub2-efi-riscv64
grub2-efi-riscv64-modules grub2-efi-riscv64-modules
# efibootmgr efibootmgr
# Add for sd-boot # Add for sd-boot
systemd-boot-unsigned #systemd-boot-unsigned
# edk2-ext4 #edk2-ext4
# python3-virt-firmware # python3-virt-firmware
@ -59,20 +57,19 @@ uboot-images-riscv64
dracut-config-generic dracut-config-generic
-dracut-config-rescue -dracut-config-rescue
# For user creation and manipulation
shadow-utils
passwd passwd
openssh # Install the English locale, but not all the other ones
openssh-server
glibc-langpack-en glibc-langpack-en
-glibc-all-langpacks
nano nano
chrony chrony
haveged haveged
watchdog watchdog
# No longer in @core since 2018-10, but needed for livesys script
initscripts
chkconfig
# Lets resize / on first boot # Lets resize / on first boot
#dracut-modules-growroot #dracut-modules-growroot
@ -99,32 +96,11 @@ dnf -y remove dracut-config-generic
# and mounting processes. This should help on systems where boot takes longer. # and mounting processes. This should help on systems where boot takes longer.
sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab
# Fedora 31 # Create regular user
# https://fedoraproject.org/wiki/Changes/DisableRootPasswordLoginInSshd /usr/sbin/useradd -c "Fedora RISCV User" riscv
cat > /etc/rc.d/init.d/livesys << EOF echo fedora_rocks! | passwd --stdin riscv
#!/bin/bash /usr/sbin/usermod -aG wheel riscv
# /usr/sbin/usermod -aG mock riscv
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager chronyd
### END INIT INFO
. /etc/rc.d/init.d/functions
useradd -c "Fedora RISCV User" riscv
echo fedora_rocks! | passwd --stdin riscv > /dev/null
usermod -aG wheel riscv > /dev/null
usermod -aG mock riscv > /dev/null
exit 0
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
# Create Fedora RISC-V repo # Create Fedora RISC-V repo
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
@ -211,6 +187,9 @@ rm -f /var/lib/systemd/random-seed
# Note that running rpm recreates the rpm db files which aren't needed or wanted # Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db* rm -f /var/lib/rpm/__db*
# Start with a clean dnf history
rm -rf /var/lib/dnf/history.*
# go ahead and pre-make the man -k cache (#455968) # go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb /usr/bin/mandb

View File

@ -13,7 +13,7 @@ rootpw --plaintext fedora_rocks!
firewall --enabled --ssh firewall --enabled --ssh
timezone --utc US/Eastern timezone --utc US/Eastern
selinux --enforcing selinux --enforcing
services --enabled=sshd,NetworkManager,chronyd,haveged services --disabled=lm_sensors,libvirtd
zerombr zerombr
clearpart --all --initlabel --disklabel=gpt clearpart --all --initlabel --disklabel=gpt
@ -32,15 +32,15 @@ poweroff
%packages %packages
@core @core
@hardware-support @hardware-support
@anaconda-tools
# This is needed for appliance-tools, as it cannot see what packages are incl. # GRUB2
# in the @anaconda-tools.
grub2-efi-riscv64 grub2-efi-riscv64
grub2-efi-riscv64-modules grub2-efi-riscv64-modules
efibootmgr
# Add for sd-boot # Add for sd-boot
systemd-boot-unsigned #systemd-boot-unsigned
#edk2-ext4
kernel kernel
kernel-core kernel-core
@ -53,20 +53,19 @@ uboot-images-riscv64
dracut-config-generic dracut-config-generic
-dracut-config-rescue -dracut-config-rescue
# For user creation and manipulation
shadow-utils
passwd passwd
openssh # Install the English locale, but not all the other ones
openssh-server
glibc-langpack-en glibc-langpack-en
-glibc-all-langpacks
nano nano
chrony chrony
haveged haveged
watchdog watchdog
# No longer in @core since 2018-10, but needed for livesys script
initscripts
chkconfig
# Lets resize / on first boot # Lets resize / on first boot
#dracut-modules-growroot #dracut-modules-growroot
@ -93,32 +92,11 @@ dnf -y remove dracut-config-generic
# and mounting processes. This should help on systems where boot takes longer. # and mounting processes. This should help on systems where boot takes longer.
sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab sed -i 's|noatime|noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s|g' /etc/fstab
# Fedora 31 # Create regular user
# https://fedoraproject.org/wiki/Changes/DisableRootPasswordLoginInSshd /usr/sbin/useradd -c "Fedora RISCV User" riscv
cat > /etc/rc.d/init.d/livesys << EOF echo fedora_rocks! | passwd --stdin riscv
#!/bin/bash /usr/sbin/usermod -aG wheel riscv
# /usr/sbin/usermod -aG mock riscv
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager chronyd
### END INIT INFO
. /etc/rc.d/init.d/functions
useradd -c "Fedora RISCV User" riscv
echo fedora_rocks! | passwd --stdin riscv > /dev/null
usermod -aG wheel riscv > /dev/null
usermod -aG mock riscv > /dev/null
exit 0
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
# Create Fedora RISC-V repo # Create Fedora RISC-V repo
cat << EOF > /etc/yum.repos.d/fedora-riscv.repo cat << EOF > /etc/yum.repos.d/fedora-riscv.repo
@ -205,6 +183,9 @@ rm -f /var/lib/systemd/random-seed
# Note that running rpm recreates the rpm db files which aren't needed or wanted # Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db* rm -f /var/lib/rpm/__db*
# Start with a clean dnf history
rm -rf /var/lib/dnf/history.*
# go ahead and pre-make the man -k cache (#455968) # go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb /usr/bin/mandb