Skip to content

Commit bb8d487

Browse files
committed
untested simulator
1 parent 98dd68f commit bb8d487

File tree

6 files changed

+35
-12
lines changed

6 files changed

+35
-12
lines changed

CMakeLists.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@ set(LV_CONF_INCLUDE_SIMPLE OFF)
22
add_subdirectory(lib/lvgl)
33

44
add_library(droidboot_gui STATIC
5+
lib/ext4/ext4.c
6+
lib/ext4/ext4_balloc.c
7+
lib/ext4/ext4_bcache.c
8+
lib/ext4/ext4_bitmap.c
9+
lib/ext4/ext4_block_group.c
10+
lib/ext4/ext4_blockdev.c
11+
lib/ext4/ext4_crc32.c
12+
lib/ext4/ext4_debug.c
13+
lib/ext4/ext4_dir.c
14+
lib/ext4/ext4_dir_idx.c
15+
lib/ext4/ext4_extent.c
16+
lib/ext4/ext4_fs.c
17+
lib/ext4/ext4_hash.c
18+
lib/ext4/ext4_ialloc.c
19+
lib/ext4/ext4_inode.c
20+
lib/ext4/ext4_journal.c
21+
lib/ext4/ext4_mbr.c
22+
lib/ext4/ext4_mkfs.c
23+
lib/ext4/ext4_super.c
24+
lib/ext4/ext4_trans.c
25+
lib/ext4/ext4_xattr.c
26+
lib/minigz/mini_gzip.c
27+
lib/minigz/miniz.c
528
# List C/C++ source files with relative paths to this CMakeLists.txt.
629
common/droidboot_helpers.c
730
common/droidboot_init.c
@@ -22,7 +45,7 @@ add_library(droidboot_gui STATIC
2245
droidboot_platforms/simulator/simulator.c
2346
backend/droidboot_drivers.c
2447
backend/droidboot_dualboot_backend.c)
25-
target_link_libraries(droidboot_gui PUBLIC lvgl)
48+
target_link_libraries(droidboot_gui PUBLIC lvgl android log nativehelper)
2649
add_compile_definitions(PLATFORM_SIMULATOR)
2750
target_include_directories(droidboot_gui PUBLIC
2851
lib/libufdt/sysdeps/include

backend/droidboot_drivers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ file_metadata abm_settings_metadata;
1616
// Next functions are only for lwext4, usually just wrappers
1717
static int droidboot_lwext_sd_dev_bread(struct ext4_blockdev *bdev, void *buf, uint32_t blk_id, uint32_t blk_cnt)
1818
{
19-
dridboot_sd_read_block(buf, blk_id, blk_cnt);
19+
droidboot_sd_read_block(buf, blk_id, blk_cnt);
2020
return DROIDBOOT_EOK;
2121
}
2222

2323
static int droidboot_lwext_sd_dev_bwrite(struct ext4_blockdev *bdev, const void *buf,
2424
uint32_t blk_id, uint32_t blk_cnt){
25-
dridboot_sd_write_block(buf, blk_id, blk_cnt);
25+
droidboot_sd_write_block(buf, blk_id, blk_cnt);
2626
return DROIDBOOT_EOK;
2727
}
2828

lib/lvgl

storage/droidboot_gpt.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static droidboot_error validate_mbr_partition(const struct mbr_part *part)
8181
* Return 0 on valid signature
8282
*/
8383
static unsigned int
84-
partition_parse_gpt_header(unsigned char *buffer, struct gpt_header* header)
84+
partition_parse_gpt_header(const char *buffer, struct gpt_header* header)
8585
{
8686
/* Check GPT Signature */
8787
if (((uint32_t *) buffer)[0] != GPT_SIGNATURE_2 ||
@@ -135,7 +135,7 @@ droidboot_error droidboot_parse_gpt_on_sd()
135135
unsigned int i, j, n;
136136
int gpt_partitions_exist = 0;
137137

138-
dridboot_sd_read_block(buf, 0, 1);
138+
droidboot_sd_read_block(buf, 0, 1);
139139

140140
/* look for the aa55 tag */
141141
//if (buf[510] != 0x55 || buf[511] != 0xaa)
@@ -164,16 +164,16 @@ droidboot_error droidboot_parse_gpt_on_sd()
164164
if(!gpt_partitions_exist) return DROIDBOOT_ENOENT;
165165
droidboot_log(DROIDBOOT_LOG_INFO, "found GPT\n");
166166

167-
dridboot_sd_read_block(buf, 1, 1);
167+
droidboot_sd_read_block(buf, 1, 1);
168168

169169
struct gpt_header gpthdr;
170-
int err = partition_parse_gpt_header(buf, &gpthdr);
170+
uint err = partition_parse_gpt_header(buf, &gpthdr);
171171
droidboot_dump_hex(DROIDBOOT_LOG_TRACE, buf, 16);
172172
if (err) {
173173
/* Check the backup gpt */
174174

175175
uint64_t backup_header_lba = droidboot_sd_blkcnt() - 1;
176-
dridboot_sd_read_block(buf, backup_header_lba , 1);
176+
droidboot_sd_read_block(buf, backup_header_lba , 1);
177177

178178
err = partition_parse_gpt_header(buf, &gpthdr);
179179
if (err) {
@@ -187,7 +187,7 @@ droidboot_error droidboot_parse_gpt_on_sd()
187187
/* Read GPT Entries */
188188
droidboot_log(DROIDBOOT_LOG_INFO, "Partition entries offset: %d\n", partition_0);
189189
for (i = 0; i < (DROIDBOOT_ROUNDUP(gpthdr.max_partition_count, part_entry_cnt)) / part_entry_cnt; i++) {
190-
dridboot_sd_read_block(buf, 2 + i, 1);
190+
droidboot_sd_read_block(buf, 2 + i, 1);
191191
droidboot_dump_hex(DROIDBOOT_LOG_TRACE, buf, 16);
192192

193193
for (j = 0; j < part_entry_cnt; j++) {

storage/droidboot_mapped.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void droidboot_read_mapped_file_blocks(const file_metadata *metadata, unsigned l
9393
// The block is within this range, calculate the actual block to read
9494
while (remaining_blocks > 0 && logical_block < range_blocks) {
9595
unsigned long actual_block_number = range_start + logical_block;
96-
dridboot_sd_read_block((void *)buffer + buffer_offset, actual_block_number + metadata->physical_partition_offset, 1);
96+
droidboot_sd_read_block((void *)buffer + buffer_offset, actual_block_number + metadata->physical_partition_offset, 1);
9797

9898
remaining_blocks--;
9999
buffer_offset += block_size;

0 commit comments

Comments
 (0)