Ticket #36 (closed task: fixed)
Boot OI from SD or internal memory
| Reported by: | dottedmag | Owned by: | dottedmag |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.1 |
| Component: | buildsystem | Version: | |
| Keywords: | Cc: | pit | |
| Blocked By: | Blocking: |
Description
We need the dual-boot firmware which allows booting from NFS if key was pressed at the some stage of startup.
This will allow booting development image from NFS while still using device as a regular book.
Idea:
- nfsboot kernel at 2nd megabyte, booted by bootloader
- bootloader boots without root=/dev/nfs
- rcS waits for keypress and kexec's current kernel with root=/dev/nfs if pressed
- else kexecs original kernel (from some unused place on flash)
Attachments
Change History
comment:1 Changed 4 years ago by pit
here is my programs for button reacting
#include <stdio.h>
#include <time.h>
#include <linux/input.h>
#define WAIT_TIME 2
#define INPUT_DEV "/dev/input/event0"
int main ()
{
clock_t endwait;
int lng;
int fd;
endwait = clock () + WAIT_TIME * (CLOCKS_PER_SEC);
fd = open(INPUT_DEV, O_RDONLY|O_NONBLOCK)
if (fd == -1)
{
printf("error opening file\n");
return 0;
}
while (clock() < endwait)
{
lng = read(fd, &data, sizeof(data));
if(lng != -1)
{
close(fd);
//printf("1\n");
return 1;
}
}
close(fd);
//printf("0\n");
return 0;
}
as you can see, it's reacting on any evdev event (key pressed, key released, etc). #defines should be params, but i'm to lazy to do checking and stuff, and this is program-for-a-one-time anyway. this program used by following script:
#!/bin/sh /home/key if [ "$?" = "1" ]; then echo 1 kexec -l /zImage kexec -e fi echo 0
comment:2 Changed 4 years ago by dottedmag
- Milestone changed from 0.1 to 0.2
There's a problem with kexec-like functionality for Hanlin kernel, so deferring it a bit.
comment:3 Changed 3 years ago by dottedmag
- Summary changed from dual-boot firmware to Boot OI from SD or internal memory
- Milestone changed from 0.2 to 0.1
We've got kexec replacement (reloaded.ko) working, so no need to reflash the original firmware - it should be enough to put OI to the SD/internal memory and boot into it using a reloaded.ko.
Targeting 0.1, should be easy to do.


