summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-03-18 21:46:14 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-03-18 21:46:14 +0000
commit296ddb5f6b8b6d131705919cf68af805e2950c70 (patch)
tree24fa8f7d697bc867c573f11a429834fcc3d962f8 /distrib
parent6a9e90c7f314165727dcb1992fb47a220652b2d5 (diff)
Patch Linux startup script to run zboot automatically, but do not
restore the original file when uninstalling the package. To boot OpenBSD, hit enter at the zboot> prompt after reboot. To boot Linux, type 'r' at the prompt.
Diffstat (limited to 'distrib')
-rw-r--r--distrib/zaurus/ipk/postinst34
-rw-r--r--distrib/zaurus/ipk/postrm11
2 files changed, 39 insertions, 6 deletions
diff --git a/distrib/zaurus/ipk/postinst b/distrib/zaurus/ipk/postinst
index 22e508779b5..d1125213288 100644
--- a/distrib/zaurus/ipk/postinst
+++ b/distrib/zaurus/ipk/postinst
@@ -1,12 +1,34 @@
#!/bin/sh
+
+cd /root/etc/rc.d || exit $?
+
rmmod zbsdmod 2>/dev/null
+
mount -o remount,rw /
-rm -f /root/etc/rc.d/rc.zboot
-rm -f /root/etc/rc.d/zboot
-rm -f /root/etc/rc.d/zbsdmod.o
-cp /hdd2/OpenBSD/rc.zboot /root/etc/rc.d
-cp /hdd2/OpenBSD/zboot /root/etc/rc.d
-cp /hdd2/OpenBSD/zbsdmod.o /root/etc/rc.d
+
+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
+
+rm -f rc.zboot
+rm -f zboot
+rm -f zbsdmod.o
+cp /hdd2/OpenBSD/rc.zboot .
+cp /hdd2/OpenBSD/zboot .
+cp /hdd2/OpenBSD/zbsdmod.o .
+
sync; sleep 3
mount -o remount,ro /
+
insmod /hdd2/OpenBSD/zbsdmod.o
diff --git a/distrib/zaurus/ipk/postrm b/distrib/zaurus/ipk/postrm
index 6091fb70511..9374cb70e52 100644
--- a/distrib/zaurus/ipk/postrm
+++ b/distrib/zaurus/ipk/postrm
@@ -1,7 +1,18 @@
#!/bin/sh
+
rmmod zbsdmod
+
+cd /root/etc/rc.d || exit $?
+
mount -o remount,rw /
+
rm -f /root/etc/rc.d/rc.zboot
rm -f /root/etc/rc.d/zboot
rm -f /root/etc/rc.d/zbsdmod.o
+
+# XXX removing ext2/ext3 and vfat hacks can cause HDD1 Error and such.
+#if [ -f /root/etc/rc.d/rc.rofilesys.openbsd ]; then
+# mv -f /root/etc/rc.d/rc.rofilesys.openbsd /root/etc/rc.d/rc.rofilesys
+#fi
+
mount -o remount,ro /