diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index c86630f..9ab21db 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -96,6 +96,7 @@ BOARD_USES_BOOTMENU := true BOARD_WITH_CPCAP := true BOARD_MMC_DEVICE := /dev/block/mmcblk1 BOARD_BOOTMODE_CONFIG_FILE := /cache/recovery/bootmode.conf +BOARD_BOOTMENU_REBOOT_HOOK := ../../../device/motorola/jordan-common/reboot_hook.c # Recovery TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888" diff --git a/bootmenu/recovery/sbin/recovery b/bootmenu/recovery/sbin/recovery index 4100a39..e32a5b8 100755 Binary files a/bootmenu/recovery/sbin/recovery and b/bootmenu/recovery/sbin/recovery differ diff --git a/bootmenu/script/pre_bootmenu.sh b/bootmenu/script/pre_bootmenu.sh index bd5d814..f426a89 100644 --- a/bootmenu/script/pre_bootmenu.sh +++ b/bootmenu/script/pre_bootmenu.sh @@ -60,12 +60,18 @@ chmod 4755 /sbin/adbd.root rm -f /default.prop cp -f $BM_ROOTDIR/config/default.prop /default.prop -## mount cache +## mount cache & data mkdir -p /cache +mkdir -p /data # stock mount, with fsck if [ -x /system/bin/mount_ext3.sh ]; then /system/bin/mount_ext3.sh cache /cache + /system/bin/mount_ext3.sh data /data +fi + +if [ ! -d /data/data ]; then + mount -t $FS_DATA -o noatime,nodiratime,errors=continue $PART_DATA /data fi # mount cache for boot mode and recovery logs diff --git a/bootmenu/script/reboot_command.sh b/bootmenu/script/reboot_command.sh index 069ae98..2f2ae17 100755 --- a/bootmenu/script/reboot_command.sh +++ b/bootmenu/script/reboot_command.sh @@ -31,4 +31,7 @@ if [ -z "$R" ]; then rm -f $BM_CONFIG fi +# force SIM PIN check after reboot +echo lock > /data/simpin + sync diff --git a/profiles/2nd-init/init.mapphone_umts.rc b/profiles/2nd-init/init.mapphone_umts.rc index def5a9c..1266cc4 100644 --- a/profiles/2nd-init/init.mapphone_umts.rc +++ b/profiles/2nd-init/init.mapphone_umts.rc @@ -153,6 +153,8 @@ on property:sys.chargeonly.mode=0 on property:sys.chargeonly.mode=1 start console write /data/simpin lock + chmod 0660 /data/simpin + chown system system /data/simpin exec /system/bin/charge_only_mode exec /system/bin/stop zygote diff --git a/reboot_hook.c b/reboot_hook.c new file mode 100644 index 0000000..50e8244 --- /dev/null +++ b/reboot_hook.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +void board_reboot_hook(const char *reason, int *need_clear_reason) +{ + int fd; + + if (reason != NULL && strncmp(reason, "bppanic", 7) == 0) { + *need_clear_reason = 1; + return; + } + + /* force SIM PIN check after reboot */ + fd = open("/data/simpin", O_WRONLY | O_CREAT, 0660); + if (fd >= 0) { + int ret; + do { + ret = write(fd, "lock", 4); + } while (ret < 0 && errno == EINTR); + fchown(fd, -1, AID_SYSTEM); + fchmod(fd, 0660); + close(fd); + } +}