aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ps3
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2009-08-19 22:36:53 +0000
committerGeoff Levand <geoff@infradead.org>2009-08-19 22:36:53 +0000
commit841f4a14447b04cb0cd607e003de3fc022f81ade (patch)
tree81fc1ed42a599c57319b5b3d38f9aba6bcc46714 /target/linux/ps3
parent029c28b5d654f6a8c22cf8e9bf3790693874c0dc (diff)
downloadmaster-187ad058-841f4a14447b04cb0cd607e003de3fc022f81ade.tar.gz
master-187ad058-841f4a14447b04cb0cd607e003de3fc022f81ade.tar.bz2
master-187ad058-841f4a14447b04cb0cd607e003de3fc022f81ade.zip
ps3/petitboot: Run petitboot at first startup
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17324 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ps3')
-rwxr-xr-xtarget/linux/ps3/petitboot/base-files/sbin/initrun17
1 files changed, 16 insertions, 1 deletions
diff --git a/target/linux/ps3/petitboot/base-files/sbin/initrun b/target/linux/ps3/petitboot/base-files/sbin/initrun
index e253c24b3a..1c3363fcc8 100755
--- a/target/linux/ps3/petitboot/base-files/sbin/initrun
+++ b/target/linux/ps3/petitboot/base-files/sbin/initrun
@@ -1,3 +1,18 @@
#!/bin/sh
+# Run petitboot at first startup, otherwise run a login.
-/bin/ash --login
+sbindir=/usr/sbin
+localstatedir=/var/petitboot
+
+petitboot=$sbindir/petitboot
+run_once=$localstatedir/.run-once
+
+if [ ! -f $run_once -a -x $petitboot ]; then
+ # quiet console
+ echo 3 > /proc/sys/kernel/printk
+ mkdir -p $localstatedir
+ touch $run_once
+ exec $petitboot --timeout
+fi
+
+exec /bin/ash --login