Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support booting the rootfs from the system partition #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions init-script
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ echo "Running Mer Boat Loader"
BOOTLOGO=%BOOTLOGO%
ALWAYSDEBUG=%ALWAYSDEBUG%
DATA_PARTITION=%DATA_PART%
SYSTEM_PARTITION=$(findfs LABEL="system")
Copy link
Member Author

@jbruechert jbruechert Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not working on all devices, only on my device it's automatically labeled

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also on mines, I think this is always labelled

DEFAULT_OS=%DEFAULT_OS%

set_welcome_msg(){
Expand Down Expand Up @@ -141,14 +142,27 @@ mount_stowaways() {
if [ ! -z $DATA_PARTITION ]; then
data_subdir="$(get_opt data_subdir)"

mkdir /data
mkdir /target
mkdir /data
mkdir /target

mount $DATA_PARTITION /data
mount /data/rootfs.img /target
mount $DATA_PARTITION /data

mkdir -p /target/data # in new fs
mount --bind /data/${data_subdir} /target/data
if [ -f /data/rootfs.img ]; then
mount /data/rootfs.img /target
else
if [ ! -z $SYSTEM_PARTITION ]; then
# Mount the system partition as root filesystem
mount $SYSTEM_PARTITION /target

# Refuse to boot android if installed on system partition
if [ -f /target/build.prop ]; then
echo "Refusing to boot android, install a Halium compatible rootfs first!" >> /diagnosis.log
fi
fi
fi

mkdir -p /target/data # in new fs
mount --bind /data/${data_subdir} /target/data
else
echo "Failed to mount /target, device node '$DATA_PARTITION' not found!" >> /diagnosis.log
fi
Expand Down