Skip to content

Commit 99447fb

Browse files
committed
dev_tree: Do not update Android fstab by default
For Linux OS, this has no use. For custom Android OS, the developers are used to make changes on the source files directly, rather than relying on this logic. Additionally, the changes that it make are most likely deprecated on newer Android versions or newer kernel versions. Stock Android OS may rely on it though, but the purpose of lk2nd is likely never used to be booting stock Android OS... Change-Id: Ia0f331dc60c7d2c023c0d79e531e801bc6193d55
1 parent a2ee5d6 commit 99447fb

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

lk2nd/project/base.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ DEFINES += GENERATE_CMDLINE_ONLY_FOR_ANDROID=1
6666
# Disable reading splash partition to avoid crashes on some devices
6767
DEFINES += DISABLE_SPLASH_PARTITION=1
6868

69+
# Disable updating Android fstab devicetree node
70+
DEFINES += SKIP_UPDATE_ANDROID_FSTAB=1
71+
6972
# Enable "fastboot oem help" for a list of supported fastboot commands
7073
DEFINES += FASTBOOT_HELP=1
7174

makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ ifeq ($(DYNAMIC_PARTITION_SUPPORT),1)
134134
DEFINES += DYNAMIC_PARTITION_SUPPORT=1
135135
endif
136136

137+
ifeq ($(SKIP_UPDATE_ANDROID_FSTAB),1)
138+
DEFINES += SKIP_UPDATE_ANDROID_FSTAB=1
139+
endif
140+
137141
ifeq ($(TARGET_DTBO_NOT_SUPPORTED),1)
138142
DEFINES += TARGET_DTBO_NOT_SUPPORTED=1
139143
endif

platform/msm_shared/dev_tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct dt_entry_v1
7575
uint32_t size;
7676
};
7777

78-
#if ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT
78+
#if !SKIP_UPDATE_ANDROID_FSTAB && (ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT)
7979
/* Look up table for fstab node */
8080
struct fstab_node
8181
{
@@ -2334,7 +2334,7 @@ int update_device_tree(void *fdt, const char *cmdline, enum boot_type boot_type,
23342334
}
23352335
}
23362336

2337-
#if ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT
2337+
#if !SKIP_UPDATE_ANDROID_FSTAB && (ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT)
23382338
/* Update fstab node */
23392339
dprintf(SPEW, "Start of fstab node update:%zu ms\n", platform_get_sclk_count());
23402340
if (update_fstab_node(fdt) != 0) {
@@ -2357,7 +2357,7 @@ int update_device_tree(void *fdt, const char *cmdline, enum boot_type boot_type,
23572357
return ret;
23582358
}
23592359

2360-
#if ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT
2360+
#if !SKIP_UPDATE_ANDROID_FSTAB && (ENABLE_BOOTDEVICE_MOUNT || DYNAMIC_PARTITION_SUPPORT)
23612361
/*Update device tree for fstab node */
23622362
static int update_fstab_node(void *fdt)
23632363
{

0 commit comments

Comments
 (0)