Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:infrastructure:Images:Micro:5.5
micro
config.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File config.sh of Package micro
#!/bin/bash # Copyright (c) 2023 openSUSE Contributors # Copyright (c) 2022 SUSE LLC # # Georg Pfuetzenreuter <mail+opensuse@georg-pfuetzenreuter.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # #====================================== # Functions... #-------------------------------------- test -f /.kconfig && . /.kconfig test -f /.profile && . /.profile set -euxo pipefail mkdir /var/lib/misc/reconfig_system #====================================== # Greeting... #-------------------------------------- echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..." #====================================== # Add missing fonts #-------------------------------------- CONSOLE_FONT="eurlatgr.psfu" #====================================== # Remove identifiers #-------------------------------------- rm /etc/machine-id /var/lib/zypp/AnonymousUniqueId /var/lib/systemd/random-seed #====================================== # Setup baseproduct link #-------------------------------------- suseSetupProduct #====================================== # Specify default runlevel #-------------------------------------- baseSetRunlevel 3 #====================================== # Configure SELinux #-------------------------------------- # Adjust selinux config sed -Ei -e 's|^(SELINUX=).*|\1enforcing|' \ -e 's|^(SELINUXTYPE=).*|\1targeted|' \ /etc/selinux/config # Move an /.autorelabel file from initial installation to writeable location mv /.autorelabel /etc/selinux/.autorelabel #====================================== # Enable DHCP on eth0 #-------------------------------------- tee >/etc/sysconfig/network/ifcfg-eth0 <<EOF BOOTPROTO='dhcp' STARTMODE='auto' EOF #====================================== # Manage Services #-------------------------------------- systemctl enable chronyd restorecond systemctl disable transactional-update.timer #====================================== # Sysconfig Update #-------------------------------------- echo FONT="$CONSOLE_FONT" >> /etc/vconsole.conf # fix security level (boo#1171174) baseUpdateSysConfig /etc/sysconfig/security PERMISSION_SECURITY paranoid chkstat --set --system #====================================== # Zypp Configuration #-------------------------------------- sed -i \ -e 's/.*solver.onlyRequires.*/solver.onlyRequires = true/' \ -e 's/.*rpm.install.excludedocs.*/rpm.install.excludedocs = yes/' \ -e 's/^multiversion =.*/multiversion =/' \ /etc/zypp/zypp.conf #===================================== # Configure snapper #------------------------------------- if [ "${kiwi_btrfs_root_is_snapshot:-false}" = 'true' ]; then echo "creating initial snapper config ..." cp /etc/snapper/config-templates/default /etc/snapper/configs/root baseUpdateSysConfig /etc/sysconfig/snapper SNAPPER_CONFIGS root sed -i -e '/^TIMELINE_CREATE=/s/yes/no/' \ -e '/^NUMBER_LIMIT=/s/50/10/' \ /etc/snapper/configs/root fi # The %post script can't edit /etc/fstab sys due to https://github.com/OSInside/kiwi/issues/945 # so use the kiwi custom hack tee >/etc/fstab.script <<"EOF" #!/bin/sh set -eux /usr/sbin/setup-fstab-for-overlayfs # If /var is on a different partition than /... if [ "$(findmnt -snT / -o SOURCE)" != "$(findmnt -snT /var -o SOURCE)" ]; then # ... set options for autoexpanding /var gawk -i inplace '$2 == "/var" { $4 = $4",x-growpart.grow,x-systemd.growfs" } { print $0 }' /etc/fstab fi EOF chmod a+x /etc/fstab.script # To make x-systemd.growfs work from inside the initrd tee >/etc/dracut.conf.d/50-microos-growfs.conf <<"EOF" install_items+=" /usr/lib/systemd/systemd-growfs " EOF #===================================== # Prepare tukit for Salt #------------------------------------- tee >/etc/tukit.conf <<EOF BINDDIRS[0]="/opt" BINDDIRS[1]="/usr/local/bin" BINDDIRS[2]="/usr/local/sbin" BINDDIRS[3]="/var/lib/empty" EOF #===================================== # Add repositories #------------------------------------- zypper ar -f -n 'Leap Micro Main Repository' https://download.opensuse.org/distribution/leap-micro/5.5/product/repo/Leap-Micro-5.5-x86_64-Media1/ repo-main zypper ar -f -n 'SLE Micro Update Repository' https://download.opensuse.org/update/leap-micro/5.5/sle/ repo-sle-update #===================================== # Import repository signing keys #------------------------------------- keydir='/usr/lib/rpm/gnupg/keys' # "old" project signing key for repo-main, unsure why there's no openSUSE-build-key package key_osp="$keydir/gpg-pubkey-3dbdc284-53674dd4.asc" tee > "$key_osp" <<EOF -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.15 (GNU/Linux) mQENBEkUTD8BCADWLy5d5IpJedHQQSXkC1VK/oAZlJEeBVpSZjMCn8LiHaI9Wq3G 3Vp6wvsP1b3kssJGzVFNctdXt5tjvOLxvrEfRJuGfqHTKILByqLzkeyWawbFNfSQ 93/8OunfSTXC1Sx3hgsNXQuOrNVKrDAQUqT620/jj94xNIg09bLSxsjN6EeTvyiO mtE9H1J03o9tY6meNL/gcQhxBvwuo205np0JojYBP0pOfN8l9hnIOLkA0yu4ZXig oKOVmf4iTjX4NImIWldT+UaWTO18NWcCrujtgHueytwYLBNV5N0oJIP2VYuLZfSD VYuPllv7c6O2UEOXJsdbQaVuzU1HLocDyipnABEBAAG0NG9wZW5TVVNFIFByb2pl Y3QgU2lnbmluZyBLZXkgPG9wZW5zdXNlQG9wZW5zdXNlLm9yZz6JATwEEwECACYC GwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAUCU2dN1AUJHR8ElQAKCRC4iy/UPb3C hGQrB/9teCZ3Nt8vHE0SC5NmYMAE1Spcjkzx6M4r4C70AVTMEQh/8BvgmwkKP/qI CWo2vC1hMXRgLg/TnTtFDq7kW+mHsCXmf5OLh2qOWCKi55Vitlf6bmH7n+h34Sha Ei8gAObSpZSF8BzPGl6v0QmEaGKM3O1oUbbB3Z8i6w21CTg7dbU5vGR8Yhi9rNtr hqrPS+q2yftjNbsODagaOUb85ESfQGx/LqoMePD+7MqGpAXjKMZqsEDP0TbxTwSk 4UKnF4zFCYHPLK3y/hSH5SEJwwPY11l6JGdC1Ue8Zzaj7f//axUs/hTC0UZaEE+a 5v4gbqOcigKaFs9Lc3Bj8b/lE10Y =i2TA -----END PGP PUBLIC KEY BLOCK----- EOF # openSUSE:infrastructure key eae4fd92 key_osi="$keydir/gpg-pubkey-eae4fd92.asc" tee > "$key_osi" <<EOF -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.5 (GNU/Linux) mQGiBFCt5AsRBAC5Fypr7hYfEn0p1Bydroe6KTbU9Y54eV+ExJx6kr0C8C5o8rqx FN9Xzuax0RhmoqLEhbZfl4A7prOMGDb+BeFA0HxmRAclIBHpXUbPXjad+ldQzi5Z p3f1CUzdl3S7A5ARAaOAlV4E1EXwg0HledV3ugxN/oZ1aPISTc8BriO9ewCgtqhS L8tEz1QpUKcF4OrPlVF7KxUD/2iP4a5o65pSgUhFyta8KKedChFZl8/vrbtsDxSj I4Y2BQn3XmvVV6zJadnA2Y+2VwBlreNRekmEOwdK7OsZM6gsfDFqkewHn4lIExgu ZKdQXLKXXXv8oFTvZYZPt0tldbjTJXnARt/kepRlCzxl/kQf3OWMdYFPLRDEg1xI Nnt4A/9Lb2VNj+iigeQVrU2dWJilXpdYSiPdGKwkqa7RqkgTymd6s84IJq8LxAL+ gg1GtXYxqLxQoCnM3YZ87F2B9lgSZ5kuZxa903Ra4CSXp1PDVmBsIUsz6q7vkIzq bBiDCgNe2c5LlRxIk6UeRMfc7PLuNR4WbtvF3qOCQRNYFSL137Qyb3BlblNVU0Ug T0JTIFByb2plY3QgPG9wZW5TVVNFQGJ1aWxkLm9wZW5zdXNlLm9yZz6IZgQTEQIA JgUCYP7MKgIbAwUJFG+YHwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEPmot5vq 5P2SpKIAoIcLmIQpefDH05wvk1MXMbH01O3vAJ9TTT1HsC+nxdy+syWmiewo5b/W gIhGBBMRAgAGBQJQreQLAAoJEDswEbdrnWUjeewAoKb0I64bp1a8Xchv1PNTAmBi zEk4AJ9gnxXQLg3B5W4FwWYIRumX/qfDaA== =Louu -----END PGP PUBLIC KEY BLOCK----- EOF suseImportBuildKey rm $key_osp $key_osi exit 0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor