#!/bin/sh # $OpenBSD: postinst,v 1.5 2005/07/18 00:15:59 uwe Exp $ # # Copyright (c) 2005 Uwe Stuehler # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # cd /root/etc/rc.d || exit $? rmmod zbsdmod 2>/dev/null mount -o remount,rw / # The C3100 has a 32M root filesystem, but it's full. rootsz=`df -k / | awk 'NR==2{print $2}'` || exit $? if [ ${rootsz:-0} -ge 32768 ]; then # Make some room by moving this large dictionary. if [ -f /usr/QtPalmtop.rom/etc/kanwadict ]; then rm -f /home/QtPalmtop/etc/kanwadict mv /usr/QtPalmtop.rom/etc/kanwadict /home/QtPalmtop/etc/kanwadict fi fi if [ ! -f rc.rofilesys.openbsd ]; then cp -p rc.rofilesys rc.rofilesys.openbsd fi cat rc.rofilesys | sed -e '/vfat/s/^/#/' > tmp || exit $? mv tmp rc.rofilesys cat rc.rofilesys | sed -e '/^LINUXFMT=ext3$/s/^/#/' \ -e '/^#LINUXFMT=ext2$/s/^#//' > tmp || exit $? mv tmp rc.rofilesys cat rc.rofilesys | sed \ -e '/\/pcmcia start$/s,$,; sh /root/etc/rc.d/rc.zboot,' > tmp || exit $? mv tmp rc.rofilesys chown root:root rc.rofilesys chmod 775 rc.rofilesys # Convert all mounted ext3 filesystems back into ext2 on reboot. for dev in `mount | awk '/on \/hdd[123] type ext3/ {print $1}'`; do cat <<- EOF | debugfs open -f -w ${dev} features -has_journal -needs_recovery quit EOF done rm -f rc.zboot rm -f zboot rm -f zbsdmod.o cp /usr/local/OpenBSD/rc.zboot . cp /usr/local/OpenBSD/zboot . cp /usr/local/OpenBSD/zbsdmod.o . sync; sleep 3 mount -o remount,ro / insmod /usr/local/OpenBSD/zbsdmod.o