-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: | ||
mkdir -p initramfs/{,s}bin | ||
cp -L /bin/busybox initramfs/sbin/ | ||
for a in $$(initramfs/sbin/busybox --list-full); do \ | ||
ln -sf /sbin/busybox initramfs/$$a; \ | ||
done | ||
chmod 755 initramfs/init | ||
|
||
clean: | ||
rm -rf initramfs/{,s}bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bootsize = 0x1000000 | ||
pagesize = 0x800 | ||
kerneladdr = 0x40080000 | ||
ramdiskaddr = 0x44000000 | ||
secondaddr = 0x40f00000 | ||
tagsaddr = 0x4e000000 | ||
name = | ||
cmdline = bootopt=64S3,32N2,64N2 | ||
id = 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
export PATH=/bin | ||
|
||
USERDATA=/dev/block/mmcblk0p24 | ||
FSROOT=/mnt/userdata | ||
NEWROOT=$FSROOT/gnu | ||
NEWINIT=/sbin/init | ||
|
||
# write log to kmsg | ||
log() { | ||
echo new_era: $@ > /dev/kmsg | ||
} | ||
|
||
die() { | ||
log FATAL: $@ | ||
exit 1 | ||
} | ||
|
||
# set up psuedo-filesystems | ||
mount -t devtmpfs none /dev | ||
|
||
log Preinit started! | ||
log Trying to mount $USERDATA on $FSROOT... | ||
mkdir -p $FSROOT | ||
mount -t ext4 $USERDATA $FSROOT || die Failed to mount $USERDATA | ||
|
||
log Setting up $NEWROOT as mountpoint... | ||
mount -o bind,ro $NEWROOT $NEWROOT || die Failed to setup $NEWROOT as mountpoint | ||
|
||
log Cleaning up mounts, switching root to $NEWROOT, and launching $NEWINIT... | ||
mount --move /dev $NEWROOT/dev | ||
exec switch_root $NEWROOT $NEWINIT | ||
|