int fd = -1;
int i;
char *args[] = { "bash", "-l", NULL };
- char demo[2];
r = devmount_setup();
if (r < 0) {
fprintf(stderr, "failed to mount devtmpfs, proceeding anyway\n");
do_write(PREFIX "/idVendor", "04E8");
do_write(PREFIX "/idProduct", "6860");
do_write(PREFIX "/f_acm/acm_transports", "tty");
- do_write(PREFIX "/functions", "acm");
+ do_write(PREFIX "/functions", "acm,rndis");
do_write(PREFIX "/enable", "1");
do_mknod("/sys/class/tty", "ttyGS0", 0, 1);
fd = open("/dev/ttyGS0", O_RDWR);
write(fd, "Hello World!\n", 13);
sleep(1);
}
- read(fd, demo, 2);
write(fd, "G\n", 2);
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
- read(fd, demo, 2);
printf("N\n");
r = do_mknod("/sys/block/mmcblk1", "mmcblk1p3", 1, 1);
if (r < 0) {
fprintf(stderr, "Failed to create mmcblk1p3\n");
}
- read(fd, demo, 2);
printf("U\n");
printf("Mounting root\n");
r = mkdir("/root", 0755);
if (r) printf("failed chroot\n");
r = chdir("/");
if (r) printf("failed second chdir\n");
+ sysfsmount_setup();
+ devmount_setup();
+ devpts_setup();
+ do_mknod("/sys/class/tty", "ttyGS0", 0, 1);
execve("/bin/bash", args, NULL);
return 0;
}