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

not working on usb-boot #2

Open
anton1234567879 opened this issue May 18, 2017 · 2 comments
Open

not working on usb-boot #2

anton1234567879 opened this issue May 18, 2017 · 2 comments

Comments

@anton1234567879
Copy link

partition_setup.sh isn't working on usb boot.
i have mannaged to work, nothing feanzy but does the job

`#!/bin/sh

set -ex

if [ -z "$part1" ] || [ -z "$part2" ] || [ -z "$part3" ] || [ -z "$part4" ]; then
printf "Error: missing environment variable part1 or part2\n" 1>&2
exit 1
fi

mkdir -p /tmp/1 /tmp/2 /tmp/2/ramdisk

mount "$part1" /tmp/1

path_loc=find / -type d | grep Android

tar xf $path_loc/boot.tar -C /tmp/1

mv /tmp/1/boot/* /tmp/1

rm -rf /tmp/1/boot*

mv /tmp/1/ramdisk.img /tmp/2/ramdisk.cpio.gz

cd /tmp/2

gzip -d ramdisk.cpio.gz

cd /tmp/2/ramdisk

$path_loc/cpio -i -F ../ramdisk.cpio

bl=$( blkid )

p2=$( echo "$part2" | sed -e "s|PARTUUID=||" )
p3=$( echo "$part3" | sed -e "s|PARTUUID=||" )
p4=$( echo "$part4" | sed -e "s|PARTUUID=||" )

a2=$( echo "$bl" | grep "$p2" )
b2=$( echo "$a2" | sed -e "s|/dev/|/dev/block/|" | sed "s|: .||" )
c2=$( echo "$a2" | sed "s|: .
||" )

a3=$( echo "$bl" | grep "$p3" )
b3=$( echo "$a3" | sed -e "s|/dev/|/dev/block/|" | sed "s|: .||" )
c3=$( echo "$a3" | sed "s|: .
||" )

a4=$( echo "$bl" | grep "$p4" )
b4=$( echo "$a4" | sed -e "s|/dev/|/dev/block/|" | sed "s|: .||" )
c4=$( echo "$a4" | sed "s|: .
||" )

dd if=$path_loc/system.img of=$c3 bs=1M

sed /tmp/2/ramdisk/fstab.rpi3 -i -e "s|^/dev.* /system |$b2 /system |"
sed /tmp/2/ramdisk/fstab.rpi3 -i -e "s|^/dev.* /cache |$b3 /cache |"
sed /tmp/2/ramdisk/fstab.rpi3 -i -e "s|^/dev.* /data |$b4 /data |"

$path_loc/cpio -i -t -F ../ramdisk.cpio | $path_loc/cpio -o -H newc > ../ramdisk_new.cpio

mv ../ramdisk_new.cpio /tmp/1/ramdisk.img

cd /

umount /tmp/1`

@anton1234567879
Copy link
Author

upps one faillure
line : dd if=$path_loc/system.img of=$c3 bs=1M
must be : dd if=$path_loc/system.img of=$c2 bs=1M

@anton1234567879
Copy link
Author

oh no my dear
you can leave
c4=$( echo "$a4" | sed "s|: .||" )
c3=$( echo "$a3" | sed "s|: .||" )
out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant