Commit graph

35 commits

Author SHA1 Message Date
Dima Zavin
8f91282ebe init/cutils: move kernel logging interface to libcutils from init
Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:17 -07:00
Chia-chi Yeh
27164dce5f init: make "mkdir" work even when the directory already exists.
This allows us to change permissions and ownerships of directories
in init scripts without adding additional commands.

Change-Id: I1815d6015953035251b98f28c0f3efd3c7f25f80
2011-07-08 16:06:56 -07:00
Mike Lockwood
1f0bd32f90 init: Add support for assigning system properties to system properties in init.rc
For example:
    setprop sys.usb.config $persist.sys.usb.config

Change-Id: I7b4e1ed1335906b32621bd96a341b0f94bbee7f5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-09 15:42:54 -07:00
Mike Lockwood
f5cb5b2435 init: Fix the init.rc import command
Change-Id: I8a91c3f7d1ca31e137d9043bb7f56e4a44fb63df
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-09 15:42:47 -07:00
Mike Lockwood
2c4d5dc415 init: Add support for writing system property value to a file in init.rc
The write command will write a property value if the value starts with a "$'

For example:
    write /sys/class/android_usb/iSerial $ro.serialno

Use double leading '$' if you need to write a string that starts with '$':

    write /data/foo $$hello

to write "$hello" to /data/foo

Change-Id: I55431ac7715a5347bb95c3a15aee97c575444dde
2011-06-09 15:42:31 -07:00
Ken Sumrall
7bc6e9ebe4 Teach the mount command in init to not consider a wiped partition to be encrypted.
Change-Id: I3e989f0b81ec35084baddc04e014406f4d90ce04
2011-05-26 20:01:39 -07:00
Ken Sumrall
c5c51033c8 Load the persistent properties after decrypting the /data partition
Fix for bug 3415286.  The persistent properties are normally read early
in the boot process after /data is mounted.  However, for an encrypted
system, at that point /data is a tmpfs ramdisk.  This change adds a new
command to init (load_persist_props) to read the persistent properties,
and adds an action to init.rc to load the persistent properties.  This
action is triggered by setting a property in vold, but that's in a
different CL.

Change-Id: I74b3057974ee6029c29d956b76fef5566700d471
2011-03-10 18:12:19 -08:00
Ken Sumrall
dd4d786cbf Fix for bug 3379244, non-eMMC devices don't start all services.
Fix for non-eMMC based devices to properly start the "on nonencrypted"
action.

Change-Id: I5d2966db352b02f1a1724fb105e1cefc46037e42
2011-02-17 18:09:47 -08:00
Ken Sumrall
203bad597f Add the commands rm and rmdir to init.
rm only removes a single non-directory directory entry (no -r support)
rmdir removes a single empty directory

Change-Id: I49702b02ba98a177027b126268c2c2846f968195
2011-01-18 17:39:24 -08:00
Ken Sumrall
4e84d3bcf9 Set a read-only property to indicate if the device is running encrypted.
The UI needs to know if the device is running with an encrypted
filesystem or now.  So set a read-only property at boot to let it know.

Change-Id: I753de2d606c975bcbe9946d10fd47558cf357dac
2011-01-14 12:44:09 -08:00
Ken Sumrall
752923c168 Changes to init to support encrypted filesystems.
These are the changes to init and init.rc necessary to
support booting with and encrypted /data filesystem.
A corresponding change to init.<device>.rc goes along
with this change.

Change-Id: I0c7e2cc39568358014a82e317735c0eae14dd683
2010-12-18 19:03:54 -08:00
Colin Cross
f83d0b9af5 init: Move uevent handling to an external ueventd process
Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
2010-04-21 20:59:38 -07:00
Colin Cross
6310a8261c init: Split parser into generic parser and init parser
Change-Id: I451ebc4ff12f2ac660eb533fa10ad561fa25c9dd
2010-04-21 19:43:40 -07:00
Colin Cross
cd0f173e27 init: Add wait command and mount wait flag
Change-Id: I6b4c10f8f246095a7fb7342388ec4f6ff97d5733
2010-04-21 19:43:35 -07:00
Colin Cross
ed8a7d8442 init: Move list and log handling to list.h and log.h
Change-Id: I298f575c590d0f28b7ad78747f3ebdbba56b7a27
2010-04-21 19:43:35 -07:00
Colin Cross
ebc6ff105a init: Handle commands in event queue loop
Change-Id: I679059dae43143f3c8f16b68de5694539b699e50
2010-04-16 19:02:32 -07:00
Colin Cross
3899e9fc01 init: Move prototypes for util.c into util.h
Change-Id: I46a91849ce5297eb2597dd6134412f817564ec24
2010-04-13 22:52:10 -07:00
Colin Cross
ca7648ddfb init: Move parser prototypes to parser.h
Change-Id: I31db51eb8e8a33a0bd06b41206bc9f9147d16d41
2010-04-13 22:51:12 -07:00
Tom Zhu
4d0b21f4ac am 4833d9f4: init: builtins: trancate target file in do_copy
Merge commit '4833d9f4986d6dafacff841beb3bf93172c84bdc' into eclair-plus-aosp

* commit '4833d9f4986d6dafacff841beb3bf93172c84bdc':
  init: builtins: trancate target file in do_copy
2009-09-30 14:25:47 -07:00
Tom Zhu
4833d9f498 init: builtins: trancate target file in do_copy
add O_TRUNC flag in open(), which will truncate the target file,
otherwise, copy will keep the old content of the target file.

Signed-off-by: Tom Zhu <ling.zhu@motorola.com>
Signed-off-by: San Mehat <san@google.com>
2009-09-30 14:15:49 -07:00
Jean-Baptiste Queru
8c92ba1921 merge from open-source master 2009-09-01 08:28:21 -07:00
Jay Freeman (saurik)
e7cb137f32 added chdir/chroot commands to init for mount switching/pivoting 2009-08-27 07:43:28 -07:00
Jay Freeman (saurik)
9f28bde9eb Trivial implementation of init's import command. 2009-08-27 07:40:19 -07:00
San Mehat
7c44fe5925 init: builtins: Add 'copy' command to init.rc parser
Signed-off-by: San Mehat <san@google.com>
2009-08-26 16:39:59 -07:00
Jay Freeman (saurik)
11e1c42df6 completed implementation of "trigger" for init 2009-08-25 13:00:11 -07:00
Jean-Baptiste Queru
96d58f4f52 Merge korg/donut into korg/master 2009-07-25 18:07:41 -07:00
Mike Chan
008abac082 init now returns proper error codes in dmesg for write command (init.rc)
Signed-off-by: Mike Chan <mike@android.com>
2009-06-29 20:30:55 -07:00
San Mehat
8ad15685e6 resolved conflicts w/ f24e252903 merge... 2009-05-20 08:50:40 -07:00
San Mehat
f24e252903 init: Add the ability to start services with dynamic arguments.
To add arguments dynamically to a service, start the service like so:

    setprop ctl.start service_to_run:arg1 arg2 arg3...

    To start a service with *no* dynamic arguments, start the service normally:

    setprop ctl.start service_to_run

    Dynamic arguments are only supported on 'oneshot' services

Signed-off-by: San Mehat <san@google.com>
2009-05-19 13:33:07 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
Jean-Baptiste Queru
77d0c65b95 Merge commit 'remotes/korg/cupcake'
Conflicts:
	init/devices.c
	logwrapper/logwrapper.c
	mountd/AutoMount.c
2008-12-19 08:15:15 -08:00
The Android Open Source Project
35237d1358 Code drop from //branches/cupcake/...@124589 2008-12-17 18:08:08 -08:00
Jay Freeman (saurik)
e520d03616 Added support for loop@/path/to/filename to init's mount.
In keeping with the pattern of mtd@partition, I have added loop@path as a way to specify a loopback device. This way you can do things like mount directories in /system using cramfs from a file otherwise on /system (just one example oof how I'm using it). I specifically went with loop@ rather than adding this feature as a flag as the flags system is designed to set bits in the flags argument to mount: using loop@ fit the model in a much simpler manner and actually feels "correct".

This is a better version of the previously submitted 4045 that also refactors the mtd@ case. The reason for this is that I received comments that I should check for errors and return errors rather that do work in the case of success and fall through, but the mtd@ case wasn't doing that either and it became awkward to design the function so that it was half in one style of error handling and half in another. I also made certain to use inequality comparisons for Unix's -1 error returns rather than checking for -1, refactored my large if statement so as not to have danling parentheses, and disassocited the loop device on mount failure.
2008-11-20 18:38:36 +00:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00