Skip to content

Commit

Permalink
gpd_xds: new port
Browse files Browse the repository at this point in the history
  • Loading branch information
oxr463 committed Oct 10, 2018
1 parent 1946316 commit a76c033
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
10 changes: 10 additions & 0 deletions devices/gpd_xds/Makefile
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
9 changes: 9 additions & 0 deletions devices/gpd_xds/bootimg.cfg
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
34 changes: 34 additions & 0 deletions devices/gpd_xds/initramfs/init
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

0 comments on commit a76c033

Please sign in to comment.