2 # Copyright(C) 2006 Nokia Corporation.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 as
6 # published by the Free Software Foundation.
8 # This program is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21 PATH=/sbin:/bin:/usr/sbin:/usr/bin
22 MODULES="twl4030-vibra
41 mount -n -o remount,rw /
42 mount -n -t proc proc /proc
43 mount -n -t sysfs sysfs /sys
44 mount -n -t tmpfs -o size=1M,noatime tmpfs /tmp
45 mount -n -t tmpfs -o size=256k,mode=0755,nosuid,noatime tmpfs /var/run
49 # This doesn't really belong here, but we have start this so early
51 if [ -e /bootchart -a -e /etc/init.d/bootchart ]
53 /etc/init.d/bootchart start
59 echo "Starting software updater"
60 /etc/init.d/softupd.rcS
65 grep update /proc/component_version 1>/dev/null 2>/dev/null
83 mount -n -t devpts -ogid=$TTYGRP,mode=$TTYMODE devpts /dev/pts
87 # I hate this hack. -- Md
89 if [ "$(echo /lib/udev/devices/*)" != "/lib/udev/devices/*" ]; then
90 cp -a /lib/udev/devices/* /dev/
92 grep '^[^#]' /etc/udev/links.conf | \
93 while read type name arg1; do
94 [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
97 ln -s $arg1 /dev/$name
103 mknod /dev/$name $arg1 && chmod 600 /dev/$name
106 echo "unparseable line ($type $name $arg1)"
112 load_extra_modules () {
113 echo -n "Loading extra modules..."
114 for i in $MODULES; do
121 # Mount home and paging partitions if they are available
130 echo "Mounting partition $swap for paging"
131 # swap disabled as a workaround for Xorg bug, per NB#111807.
134 echo "Mounting partition $home as home directory"
135 mount -t ext3 -o noatime,commit=1,data=writeback $home /home
137 echo "No paging partition available as $swap"
138 echo "No home partition available as $home"
144 . /etc/udev/udev.conf
146 if [ -z "$tmpfs_size" ]; then
151 echo -n "Mounting a tmpfs over /dev..."
152 mount -n -o size=$tmpfs_size,mode=0755,noatime -t tmpfs none /dev
154 mkdir -p /dev/.udev/db /dev/.udev/queue
155 echo "" > /sys/kernel/uevent_helper
156 echo -n "Creating extra device nodes... "
169 echo -n "Creating device nodes... "
171 if [ -x /sbin/udevtrigger ]; then
174 /sbin/udevadm trigger
181 # When modifying this script, do not forget that between the time that
182 # the new /dev has been mounted and udevtrigger has been run there will be
183 # no /dev/null. This also means that you cannot use the "&" shell command.
187 if in_flash_mode; then
192 # here only in non-flash mode
194 # No need to start udev before softupd anymore
201 mount -n -o size=64M,nosuid,nodev,noatime -t tmpfs tmpfs /dev/shm
203 # mount_mmc "/dev/mmcblk0"
205 /sbin/hwclock -s || true
207 # cannot collect product data if we are under SDK
208 # it should not be run there, but explicit check is better
210 OPI=`which osso-product-info`
212 if [ x$OPI != x ]; then
214 # Make sure /etc/hostname and /etc/hosts exist and are not empty. They do not
215 # exist if this is the very first boot, and they may be empty if power cut
216 # happended before the contents has reached the media.
217 if [ ! -f /etc/hostname -o ! -s /etc/hostname -o ! -f /etc/hosts -o ! -s /etc/hosts ]; then
218 hostname="`$OPI -qOSSO_PRODUCT_SHORT_NAME | sed 's/ /-/g'`-`$OPI -qOSSO_PRODUCT_RELEASE_VERSION | cut -d. -f3`"
219 echo $hostname > /etc/hostname
220 echo "127.0.0.1 $hostname localhost" > /etc/hosts
224 # Similarly, make sure /etc/issue and /etc/issue.net are fine
225 if [ ! -f /etc/issue -o ! -s /etc/issue -o ! -f /etc/issue.net -o ! -s /etc/issue.net -o -f /home/user/first-boot-flag ]; then
226 full_name=`$OPI -qOSSO_PRODUCT_RELEASE_FULL_NAME`
227 echo "$full_name \n \l" > /etc/issue
228 echo "" >> /etc/issue
229 echo "$full_name %h" > /etc/issue.net
233 # Note, normally we would have to sync the FS to make sure the files have
234 # reached the media. But because the files are small, they would be either
235 # empty or non-existing in case of an unclean reboot, and we handle both
238 hostname -F /etc/hostname
240 test $MODE = USER && modprobe g_nokia
242 #echo /sbin/udevsend > /proc/sys/kernel/hotplug
245 #chmod 664 /var/run/utmp
246 #chgrp utmp /var/run/utmp
249 cat /proc/mounts > /etc/mtab
251 echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
252 echo 0 > /proc/sys/net/ipv4/conf/default/accept_redirects
253 echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
254 echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
255 echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
256 echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
257 echo "49152 65535" > /proc/sys/net/ipv4/ip_local_port_range
258 echo 6000 > /sys/class/bluetooth/hci0/idle_timeout
260 # adjust other kernel parameters to minimize memory consumption
261 # and optimize IO pressure
262 echo 4 > /proc/sys/kernel/pty/max
263 echo 1024 > /proc/sys/kernel/threads-max
264 echo 8192 > /proc/sys/fs/file-max
265 echo 100 > /proc/sys/vm/swappiness
266 echo 5 > /proc/sys/vm/page-cluster
267 echo 500 > /proc/sys/vm/dirty_expire_centisecs
268 echo 65536 > /proc/sys/net/core/rmem_default
269 echo 16384 > /proc/sys/net/core/wmem_default
271 # Finalize SSU in case it has been interrupted by power failure
272 if test -x /usr/libexec/ham-rescue.sh; then
273 /usr/libexec/ham-rescue.sh
276 # Disable sysrq to avoid accidental console-carbage resets.
277 echo 0 > /proc/sys/kernel/sysrq
279 echo "/what/me/worry" > /proc/sys/kernel/core_pattern
280 echo 1 > /proc/sys/kernel/panic
281 echo 1 > /proc/sys/kernel/panic_on_oops
284 mount -t ubifs -o ro ubi0:rootfs /nand
286 if test $MODE = USER; then
289 /etc/init.d/ssh start