Close

/etc/init.d/rcS script

A project log for Hacking the Vodafone Huawei R201

Tearing apart this portable wireless mobile device!

thetechtokerthetechtoker 06/19/2020 at 20:031 Comment

#!/bin/sh
################################################################################
# ------------------------------------------------------------------------------
# Copyright (C) 2008 QUALCOMM Incorporated. # All Rights Reserved. QUALCOMM Proprietary and Confidential.
# ------------------------------------------------------------------------------
################################################################################

echo "rcS:::executing /etc/init.d/rcS script"

# re-establish ramfs file system:etc|var|mnt|
echo "establish ramfs file system:|tmp|etc|var|mnt|"
/bin/mount -f -t ramfs ramfs /tmp

/bin/cp -rf /etc  /tmp/
/bin/mount -n -t ramfs ramfs /etc
/bin/mv  /tmp/etc/* /etc/

/bin/cp -rf /var  /tmp/
/bin/mount -f -t ramfs ramfs /var
/bin/mv  /tmp/var/* /var/

/bin/mount -f -t ramfs ramfs /mnt

echo "rcS:::mounting filesystems"
mount -a 2>/dev/null

#echo "rcS:::mounting /prj/happyfeet"
#mkdir -p /prj/happyfeet
#mount -t nfs -n -o nolock,rsize=1024,wsize=1024 baskin:/vol/eng_asw_0032/happyfeet /prj/happyfeet

echo "rcS:::executing /etc/rc.d scripts"
run-parts -a start /etc/rc.d

echo "rcS:::mounting flashfs"
mkdir -p /mnt/flash
mount -t yaffs2 /dev/mtdblock0 /mnt/flash

# BB5D05399 s00163283, begin 2010/4/28
mkdir -p /mnt/dlna
# BB5D05399 s00163283, end 2010/4/28

#echo "rcS:::rdate"
#/usr/sbin/rdate -s 129.6.15.29

# Check CD-ROM Image
echo " Check CD-ROM"
mkdir /mnt/cdrom
mount -t iso9660 -o loop /dev/mtdblock1 /mnt/cdrom
#check webres img
mkdir /mnt/www
mount -f -t cramfs /dev/mtdblock3 /mnt/www
####BB5D05622 z00125912 begin
echo "rcS:::mounting pa_res"
mkdir -p /mnt/pa_res
mount -t cramfs /dev/mtdblock4 /mnt/pa_res
####BB5D05622 z00125912 end
# move the following into management.c for the feature:
#    when 583x is being charged in power off state, the user shouldnot
#    see the CDROM and port change
#if [ -f /mnt/cdrom/AutoRun.exe ]
#then
#    echo " USB Default Dynamic Composition (0x1003)"
#    /opt/qcom/bin/tests/usb_composition.sh 0x1003
#    echo /dev/mtdblock1 > /sys/devices/platform/mass_storage/lun0/file
#else
#    echo " USB Default Dynamic Composition (0x1E03)"
#    /opt/qcom/bin/tests/usb_composition.sh 0x1E03
#fi

# Run customer.rcS from /mnt/flash if [ -x /mnt/flash/customer.rcS ]; then
    echo "rcS:::Executing /mnt/flash/customer.rcS"
    /mnt/flash/customer.rcS
fi

# Starting Qcom DUN over HSUSB

echo"Starting DUN Bridge over HSUSB..."
#/opt/qcom/bin/./qcom_dun_hsusb.sh export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/qcom/lib

echo "rcS:::DONE Executing /etc/init.d/rcS Script"
# Nothing should live below this line!
cd /dev
mknod ttyHSUSB0 c 127 0
#/opt/qcom/bin/./port_bridge /dev/smd0 /dev/ttyHSUSB0 &

cd /bin
#./ar6k_load_ap.sh
mic &

Discussions

thetechtoker wrote 06/19/2020 at 20:06 point

note: /mnt/flash/customer.rcS will load a persistent script at boot every time though this is loaded pre boot, PERHAPS this can be used to boot into a new firmware?

  Are you sure? yes | no