# limit tmpfs mounts to 5% cat >> /etc/fstab <> /etc/sudoers # Only allow su access to those in the wheel group (#5537) sed -i -e '1,6s/^#auth/auth/' /etc/pam.d/su # Here we deal with a conflict between kickstart and olpc-configure # olpc-configure creates /etc/sysconfig/keyboard based on mfg data on first # boot, but kickstart also creates this file for the initial image. # therefore a live system will always be different from any OS image built # here :( # solution: don't ship this file in the image, then it won't get checked rm -f /etc/sysconfig/keyboard # Considerably speeds up boot (measured 5sec) -- bernie echo "LANG=C" > /etc/locale.conf # OLPC custom VT layout and serial console setup (#9517, #10354) sed -i -e 's:/sbin/agetty.*:/sbin/agetty --login-pause --autologin root --noclear %I:' \ /lib/systemd/system/getty\@.service sed -i -e 's:/sbin/agetty.*:/sbin/agetty -L -l /bin/bash -w -n %I 115200 vt100:' \ /lib/systemd/system/serial-getty\@.service # Enable tmpfs mounts dictated by rwtab (#9637) mkdir -p /security/state sed -i -e 's/TEMPORARY_STATE=no/TEMPORARY_STATE=yes/' \ -e 's:STATE_MOUNT=.*:STATE_MOUNT=/security/state:' \ /etc/sysconfig/readonly-root # Remove resolv.conf from rwtab so that it can be updated atomically (#2748) sed -i -e "/resolv.conf/d" /etc/rwtab # also remove /tmp, /var/log and /var/tmp from rwtab, since we put them in fstab sed -i -e '/\t\/tmp/d' /etc/rwtab sed -i -e '/\t\/var\/tmp/d' /etc/rwtab sed -i -e '/\t\/var\/log/d' /etc/rwtab # remove entries from rwtab that we put it in statetab below sed -i -e '/\t\/var\/lib\/random-seed/d' /etc/rwtab sed -i -e '/\t\/var\/lib\/dbus/d' /etc/rwtab # ensure temporary state directory doesn't get too fat (#9636) sed -i -e 's/RW_OPTIONS=/RW_OPTIONS="-o size=1M -o nr_inodes=1024"/' /etc/sysconfig/readonly-root # Things to store separately in persistent storage # This means these files can be writable at runtime without breaking the # pristine-ness of /versions/pristine. It also means they are retained # over upgrades. cat >/etc/statetab.d/olpc <>/etc/init/prefdm.conf < /sys/devices/platform/dcon/freeze #end script #EOF # OLPC CA certificate (#9624) # this is used by wget, but the Web activity uses cert8.db in its own # installation (which is then copied into user's profile dir) # FIXME: move this into olpc-utils - it can be installed into # /etc/pki/tls/certs and then it can regenerate cert.pem during %post cat >> /etc/pki/tls/cert.pem <> /etc/adjtime # not used, takes up a little space rm -rf /boot/grub # files with 000 permissions can't be served by updates.laptop.org (#10843) find / -xdev -type f -perm 000 -exec chmod 400 {} + # yumdb's from_repo_timestamp and from_repo_revision files change on almost # every build, even if the packages installed aren't changed. this creates # needless olpc-update delta. remove these files, which (according to the yum # source code as of time of writing) are not utilised. find /var/lib/yum/yumdb -type f -name 'from_repo_revision' -delete -o -name 'from_repo_timestamp' -delete # enable sysrq by default, possibly useful for debugging phantom hangs echo "kernel.sysrq = 1" > /usr/lib/sysctl.d/10-olpc.conf # disable NetworkManager's rh-ifcfg plugin (#9789) # this ensures that network configs are stored in # /etc/NetworkManager/system-connections, which is a path that we can safely # put in statetab. (the rh-ifcfg path in /etc/sysconfig mixes code with data # and is hence not appropriate to retain over upgrades) sed -i -e 's/^plugins=ifcfg-rh$/plugins=keyfile/g' /etc/NetworkManager/NetworkManager.conf # set default plymouth theme # we do this with plymouthd.defaults so that plymouth-set-default-theme # could be run by the user at another point in the build process, ensuring # that the user preference (if specified) sticks. sed -i -e 's/Theme=.*/Theme=olpc/g' /usr/share/plymouth/plymouthd.defaults # disable plymouth-start service: we start plymouthd from the initramfs # with some special settings ln -s /dev/null /etc/systemd/system/plymouth-start.service # apply some special settings in the other plymouth service files until # we have a better solution. # https://bugs.freedesktop.org/show_bug.cgi?id=22239 sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown "--kernel-command-line=rhgb plymouth.ignore-serial-consoles"/g' /lib/systemd/system/plymouth-poweroff.service sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown "--kernel-command-line=rhgb plymouth.ignore-serial-consoles"/g' /lib/systemd/system/plymouth-halt.service sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown "--kernel-command-line=rhgb plymouth.ignore-serial-consoles"/g' /lib/systemd/system/plymouth-reboot.service # remove the boot-duration file since it gets changed during boot (#11862) rm -f /var/lib/plymouth/boot-duration # call olpc-logrotate when log file hits 1mb (#10075) sed -i -e 's,/var/log/messages,:omfile:$messages,' \ -e '/$messages/ i$outchannel messages,/var/log/messages,1048576,/usr/sbin/olpc-logrotate' \ /etc/rsyslog.conf # limit journal memory usage (#12286) sed -i -e 's/#RuntimeMaxUse=$/RuntimeMaxUse=2M/' \ -e 's/#RuntimeMaxFileSize=$/RuntimeMaxFileSize=1M/' \ /etc/systemd/journald.conf # tweak upower behaviour, mostly to ignore lid events (#11815) sed -i -e 's/EnableWattsUpPro=true/EnableWattsUpPro=false/' \ -e 's/IgnoreLid=false/IgnoreLid=true/' \ /etc/UPower/UPower.conf # Tracker has snuck in and is autostarted by default. # I don't think we want this. # https://bugzilla.redhat.com/show_bug.cgi?id=821952 rm -f /etc/xdg/autostart/tracker*.desktop 2>/dev/null # wtmp updating is racy on shutdown (#11952) # Disable it, it's not interesting for us rm -f /var/log/wtmp ln -s /dev/null /etc/systemd/system/systemd-update-utmp-shutdown.service