aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ps3/petitboot
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2009-08-19 22:36:53 +0000
committerGeoff Levand <geoffrey.levand@am.sony.com>2009-08-19 22:36:53 +0000
commit28fae0bccf80cbe592f254bb63afde9d1935215c (patch)
tree0cfd9b438291c00d25096e1b80db0564b7d9342d /target/linux/ps3/petitboot
parent57dd2622eff925644358c31e9db37d5b70508b68 (diff)
downloadupstream-28fae0bccf80cbe592f254bb63afde9d1935215c.tar.gz
upstream-28fae0bccf80cbe592f254bb63afde9d1935215c.tar.bz2
upstream-28fae0bccf80cbe592f254bb63afde9d1935215c.zip
ps3/petitboot: Run petitboot at first startup
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> SVN-Revision: 17324
Diffstat (limited to 'target/linux/ps3/petitboot')
-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