Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:cschneemann:rpi
JeOS
config.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File config.sh of Package JeOS
#!/bin/bash # vim: sw=4 et #================ # FILE : config.sh #---------------- # PROJECT : OpenSuSE KIWI Image System # COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved # : # AUTHOR : Marcus Schaefer <ms@suse.de> # : # BELONGS TO : Operating System images # : # DESCRIPTION : configuration script for SUSE based # : operating systems # : # : # STATUS : BETA #---------------- #====================================== # Functions... #-------------------------------------- test -f /.kconfig && . /.kconfig test -f /.profile && . /.profile #====================================== # Greeting... #-------------------------------------- echo "Configure image: [$kiwi_iname]..." #====================================== # add missing fonts #-------------------------------------- # Systemd controls the console font now echo FONT="eurlatgr.psfu" >> /etc/vconsole.conf #====================================== # Setup baseproduct link #-------------------------------------- suseSetupProduct #====================================== # Activate services #-------------------------------------- suseInsertService sshd suseInsertService boot.device-mapper suseInsertService chronyd suseRemoveService avahi-dnsconfd suseRemoveService avahi-daemon suseRemoveService bluetooth systemctl mask bluetooth if [ -x /usr/bin/cloud-init ]; then # Found cloud-init (probably for dracut firstboot), enable it suseInsertService cloud-init-local suseInsertService cloud-init suseInsertService cloud-config suseInsertService cloud-final fi #====================================== # Add missing gpg keys to rpm #-------------------------------------- suseImportBuildKey #====================================== # Set sensible defaults #-------------------------------------- baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK "-u" baseUpdateSysConfig /etc/sysconfig/clock TIMEZONE UTC echo 'DEFAULT_TIMEZONE="UTC"' >> /etc/sysconfig/clock baseUpdateSysConfig /etc/sysconfig/network/dhcp DHCLIENT_SET_HOSTNAME no baseUpdateSysConfig /etc/sysconfig/network/dhcp WRITE_HOSTNAME_TO_HOSTS no #========================================== # dirs needed by kiwi for subvolumes #------------------------------------------ mkdir -p /var/lib/mailman /var/lib/mariadb /var/lib/mysql /var/lib/named /var/lib/pgsql /var/lib/libvirt/images #========================================== # remove package docs #------------------------------------------ rm -rf /usr/share/doc/packages/* rm -rf /usr/share/doc/manual/* rm -rf /opt/kde* #====================================== # Import GPG Key # t=$(mktemp) cat - <<EOF > $t -----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 rpm --import $t rm -f $t #====================================== # prepare for setting root pw, timezone #-------------------------------------- echo ** "reset machine settings" rm /etc/localtime rm /var/lib/zypp/AnonymousUniqueId rm /var/lib/systemd/random-seed || true # Invoke grub2-install #-------------------------------------- case $kiwi_iname in *efi|*.aarch64-rootfs) [ -x /usr/sbin/grub2-install ] && { /usr/sbin/grub2-install || : } ;; esac ##====================================== ## Add Contrib repo when needed ##-------------------------------------- #if [ -f /kiwi-hooks/contrib_repo ]; then # REPO=$(cat /kiwi-hooks/contrib_repo | sed 's/devel:.*:Factory:Contrib://') # URLREPO=$(sed 's/:/:\//g' /kiwi-hooks/contrib_repo) # zypper ar -f "http://download.opensuse.org/repositories/$URLREPO/standard/" "Factory-Contrib-$REPO" # rm -f /kiwi-hooks/contrib_repo # # if [ -z "$(ls -A /kiwi-hooks)" ]; then # rm -rf /kiwi-hooks # fi #fi baseSetRunlevel 3 #====================================== # Add tty devices to securetty #-------------------------------------- # XXX should be target specific cat >> /etc/securetty <<EOF ttyO0 ttyO2 ttyAMA0 ttyAMA2 ttymxc0 ttymxc1 EOF #====================================== # Bring up eth device automatically #-------------------------------------- mkdir -p /etc/sysconfig/network/ case "$kiwi_iname" in *-m400) cat > /etc/sysconfig/network/ifcfg-enp1s0 <<-EOF BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' EOF ;; *efi*) # Jetson Nano uses enp1s0 in qemu cat > /etc/sysconfig/network/ifcfg-enp1s0 <<-EOF BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' EOF # Tumbleweed uses enp0s3 in qemu (eth0 in Leap) cat > /etc/sysconfig/network/ifcfg-enp0s3 <<-EOF BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' EOF # But some boards still have eth0 instead of enpXsY cat > /etc/sysconfig/network/ifcfg-eth0 <<-EOF BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' EOF ;; *) # XXX extend to more boards cat > /etc/sysconfig/network/ifcfg-eth0 <<-EOF BOOTPROTO='dhcp' MTU='' REMOTE_IPADDR='' STARTMODE='onboot' EOF ;; esac #====================================== # Configure chronyd #-------------------------------------- # tell e2fsck to ignore the time differences cat > /etc/e2fsck.conf <<EOF [options] broken_system_clock=true EOF # /etc/chronyd.conf has already one openSUSE ntp pool # for i in 0 1 2 3; do # echo "server $i.opensuse.pool.ntp.org iburst" >> /etc/chronyd.conf # done #====================================== # Disable systemd-firstboot #-------------------------------------- # While it's a good idea to adapt the image according to user's preferences, # people seem to want to run headless systems, so stalling the boot is a # really bad idea. Disable firstboot for now ... (boo#1020019) # rm -f /usr/lib/systemd/system/systemd-firstboot.service rm -f /usr/lib/systemd/system/sysinit.target.wants/systemd-firstboot.service #====================================== # Latest openssh disables root login by default # Re-enable it as we do not use 1st boot for now, # so root is the only account by default #-------------------------------------- cat > /etc/ssh/sshd_config.d/PermitRootLogin.conf <<EOF # Allow root login on ssh PermitRootLogin yes EOF #====================================== # Import trusted keys #-------------------------------------- for i in /usr/lib/rpm/gnupg/keys/gpg-pubkey*asc; do # importing can fail if it already exists rpm --import $i || true done #====================================== # Initrd fixes #-------------------------------------- if [[ "$kiwi_iname" == *"-efi"* ]]; then echo 'add_drivers+=" gpio-regulator virtio_gpu isp1760 "' > /etc/dracut.conf.d/efi_modules.conf fi # if NetworkManager is installed, then we want to use it... unfortunately, wicked gets pulled in always: # added wicked-service@openSUSE:Factory:ARM/standard because of sysconfig:/sbin/ifup :-( if rpm -q NetworkManager; then systemctl disable network || true systemctl enable NetworkManager || true fi
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