Skip to content

Commit 30e6838

Browse files
committed
cdba-server: Implement fastboot continue
Add cdba-server side support for "fastboot continue" which allows fastboot to continue its default boot process. I find it useful to setup my boards with an additional SD card which I frequently use the default image on eMMC to chroot to and populate modules, rebooting into fastboot and subsequently booting via fastboot a rootfs on the SD card. Signed-off-by: Bryan O'Donoghue <[email protected]>
1 parent 266d885 commit 30e6838

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

cdba-server.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ static void msg_fastboot_download(const void *data, size_t len)
145145
}
146146
}
147147

148+
static void msg_fastboot_continue(void)
149+
{
150+
device_fastboot_continue(selected_device);
151+
cdba_send(MSG_FASTBOOT_CONTINUE);
152+
}
153+
148154
void cdba_send_buf(int type, size_t len, const void *buf)
149155
{
150156
struct msg msg = {
@@ -228,6 +234,9 @@ static int handle_stdin(int fd, void *buf)
228234
case MSG_BOARD_INFO:
229235
device_info(username, msg->data, msg->len);
230236
break;
237+
case MSG_FASTBOOT_CONTINUE:
238+
msg_fastboot_continue();
239+
break;
231240
default:
232241
fprintf(stderr, "unk %d len %d\n", msg->type, msg->len);
233242
exit(1);

cdba.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum {
3030
MSG_SEND_BREAK,
3131
MSG_LIST_DEVICES,
3232
MSG_BOARD_INFO,
33+
MSG_FASTBOOT_CONTINUE,
3334
};
3435

3536
#endif

device.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ void device_fastboot_boot(struct device *device)
303303
fastboot_boot(device->fastboot);
304304
}
305305

306+
void device_fastboot_continue(struct device *device)
307+
{
308+
fastboot_continue(device->fastboot);
309+
}
310+
306311
void device_fastboot_flash_reboot(struct device *device)
307312
{
308313
fastboot_flash(device->fastboot, "boot");

device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void device_fastboot_flash_reboot(struct device *device);
8888
void device_send_break(struct device *device);
8989
void device_list_devices(const char *username);
9090
void device_info(const char *username, const void *data, size_t dlen);
91+
void device_fastboot_continue(struct device *device);
9192

9293
enum {
9394
DEVICE_KEY_FASTBOOT,

fastboot.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,17 @@ int fastboot_reboot(struct fastboot *fb)
490490

491491
return 0;
492492
}
493+
494+
int fastboot_continue(struct fastboot *fb)
495+
{
496+
char buf[80];
497+
int n;
498+
499+
fastboot_write(fb, "continue", 8);
500+
501+
n = fastboot_read(fb, buf, sizeof(buf));
502+
if (n >= 0)
503+
fprintf(stderr, "%s\n", buf);
504+
505+
return 0;
506+
}

fastboot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ int fastboot_erase(struct fastboot *fb, const char *partition);
1717
int fastboot_set_active(struct fastboot *fb, const char *active);
1818
int fastboot_flash(struct fastboot *fb, const char *partition);
1919
int fastboot_reboot(struct fastboot *fb);
20+
int fastboot_continue(struct fastboot *fb);
2021

2122
#endif

0 commit comments

Comments
 (0)