Kali Linux for Pinebook Pro
#51
kali image:

Code:
parted -m kali-linux-2020.2-pinebook-pro.img print | tail -n +3 | awk -F ":" '{print $(NF-2)}'

ext3

kali on sd:

Code:
file -sL /dev/mmcblk1p1

/dev/mmcblk1p1: Linux rev 1.0 ext3 filesystem data

edited: There is no extlinux.conf (there are boot.txt and boot.src) in this Kali image and I was not able to boot from sd after flashing kali to emmc without reflashing e.g. manjaro to emmc.
  Reply
#52
Well, there clearly is not room in the image for idbloader & friends
So it must rely on the uboot on emmc
So, when you flash the emmc, there is no more a uboot...anywhere
Personally, I would hack the image, then test by disabling emmc
As so
15Mblank + kali + 1M blank,, fdisk image,, dd mrfixit idbloader, uboot, ATF to image
Try boot with working then non-working emmc
Maybe boot.txt need editing (&recompile)
As I said,, it must not have been tested, so I have little confidence
OR, if you can't do it right, why bother
  Reply
#53
As far as I know need to edit boot.txt to match kali on emmc (root=UID) and generate boot.src with command smth like the following.


Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
  Reply
#54
(06-10-2020, 07:31 AM)wdt Wrote: Well, there clearly is not room in the image for idbloader & friends
So it must rely on the uboot on emmc
So, when you flash the emmc, there is no more a uboot...anywhere
Personally, I would hack the image, then test by disabling emmc
As so
15Mblank + kali + 1M blank,, fdisk image,, dd mrfixit idbloader, uboot, ATF to image
Try boot with working then non-working emmc
Maybe boot.txt need editing (&recompile)
As I said,, it must not have been tested, so I have little confidence
OR, if you can't do it right, why bother

Perhaps one should look into if someone is working on an emmc installer image. It seems not that easy doing this by hand. It could have been a bit easier if Kali kept their /boot on a separate partition, but no. Damn I really want to use this computer with Kali installed on. the emmc.

(06-10-2020, 09:19 AM)granstr0m Wrote:
(06-10-2020, 07:31 AM)wdt Wrote: Well, there clearly is not room in the image for idbloader & friends
So it must rely on the uboot on emmc
So, when you flash the emmc, there is no more a uboot...anywhere
Personally, I would hack the image, then test by disabling emmc
As so
15Mblank + kali + 1M blank,, fdisk image,, dd mrfixit idbloader, uboot, ATF to image
Try boot with working then non-working emmc
Maybe boot.txt need editing (&recompile)
As I said,, it must not have been tested, so I have little confidence
OR, if you can't do it right, why bother

Perhaps one should look into if someone is working on an emmc installer image. It seems not that easy doing this by hand. It could have been a bit easier if Kali kept their /boot on a separate partition, but no. Damn I really want to use this computer with Kali installed on. the emmc.

The script for building the images is here:

https://gitlab.com/kalilinux/build-scrip...ook-pro.sh

Perhaps it can be modified to create an image that is installable. on the emmc. 
  Reply
#55
I did a quick check of the buildscript and it seems there is a bug.
In the beginning it sets up the partition 2048 sectors in to the device:

parted ${imagename}.img --script -- mkpart primary ext3 2048s 100%

At the end of the script it writes the idbloader and u-boot 64 sectors in and 16384 sectors in:

dd if="${basedir}"/../misc/pbp/idbloader.img of=${loopdevice} seek=64 conv=notrunc
dd if="${basedir}"/../misc/pbp/u-boot.itb of=${loopdevice} seek=16384 conv=notrunc

16384 obviously is far beyond the 2048 (if the default sector size is the same). This must be wrong.

So if you could change the line in the beginning to:

parted ${imagename}.img --script -- mkpart primary ext3 32768s 100%

and then build a new image perhaps it could be used to install with dd.
That is if there's no other configuration pointing at 2048 that needs to be changed???

I could give it a try though it will possibly take me some time to get the crosscompiler going...

I have reported our problems to the developers of the build script for Kali images.

https://gitlab.com/kalilinux/build-scrip...issues/189
  Reply
#56
I will try smth like bellow to move existing and configured Kali installation from SD to eMMC. 

Steps:

1. Boot from kali on sd
2. Write u-boot and friends to eMMC:
Code:
dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync
dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync
dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync
3. Create partition on eMMC (starting at 32768 sector)
Code:
(parted) mkpart primary ext3 32768s -1s
4. Mount the partition in /mnt
5.
Code:
cd /mnt
6.
Code:
mkdir dev proc sys mnt
7.
Code:
rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt
8.
Code:
chroot /mnt
9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/mmcblk2p1"
10.
Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
11. reboot (without sd)


Any suggestions and comments are appreciated.

(edited)
  Reply
#57
Is this right:

root=/dev/mmcblk1p1

I think mmcblk2 is always the emmc even if no sd is inserted.
  Reply
#58
(06-10-2020, 02:30 PM)granstr0m Wrote: Is this right:

root=/dev/mmcblk1p1

I think mmcblk2 is always the emmc even if no sd is inserted.

Yeah, you're right.
  Reply
#59
(06-10-2020, 01:11 PM)chaoskampf Wrote: I will try smth like bellow to move existing and configured Kali installation from SD to eMMC. 

Steps:

1. Boot from kali on sd
2. Write u-boot and friends to eMMC:
Code:
dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync
dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync
dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync
3. Create partition on eMMC (starting at 32768 sector)
Code:
(parted) mkpart primary ext3 32768s -1s
4. Mount the partition in /mnt
5.
Code:
cd /mnt
6.
Code:
mkdir dev proc sys mnt
7.
Code:
rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt
8.
Code:
chroot /mnt
9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/mmcblk2p1"
10.
Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
11. reboot (without sd)


Any suggestions and comments are appreciated.

(edited)

I will try your guide above during the day. Where do you find the latest version of these files:

idbloader.img 
uboot.img
trust.img 

I followed your guide and it works!!!
Thankyou!!!!!!
I actually had Manjaro installed so I skipped step 2 and just deleted p1 and p2 since the boot stuff was already there.

Added a few code steps that might not be obvious to everyone:

1. Boot from kali on sd

2. Write u-boot and friends to eMMC:

Code:
dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync
dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync
dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync

3. Create partition on eMMC (starting at 32768 sector)

Code:

parted /dev/mmcblk2
(parted) mkpart primary ext3 32768s -1s
mkfs.ext3 /dev/mmcblk2p1

4. Mount the partition in /mnt
mount -t ext3 /dev/mmcblk2p1 /mnt

5.
Code:
cd /mnt

6.
Code:
mkdir dev proc sys mnt

7.
Code:
apt update
sudo apt install rsync
rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt

8.
Code:
chroot /mnt

9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/mmcblk2p1"
cd /boot
vi boot.txt

10.
Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
11. reboot (without sd)
  Reply
#60
(06-11-2020, 01:07 AM)granstr0m Wrote:
(06-10-2020, 01:11 PM)chaoskampf Wrote: I will try smth like bellow to move existing and configured Kali installation from SD to eMMC. 

Steps:

1. Boot from kali on sd
2. Write u-boot and friends to eMMC:
Code:
dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync
dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync
dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync
3. Create partition on eMMC (starting at 32768 sector)
Code:
(parted) mkpart primary ext3 32768s -1s
4. Mount the partition in /mnt
5.
Code:
cd /mnt
6.
Code:
mkdir dev proc sys mnt
7.
Code:
rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt
8.
Code:
chroot /mnt
9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/mmcblk2p1"
10.
Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
11. reboot (without sd)


Any suggestions and comments are appreciated.

(edited)

I will try your guide above during the day. Where do you find the latest version of these files:

idbloader.img 
uboot.img
trust.img 

I followed your guide and it works!!!
Thankyou!!!!!!
I actually had Manjaro installed so I skipped step 2 and just deleted p1 and p2 since the boot stuff was already there.

Added a few code steps that might not be obvious to everyone:

1. Boot from kali on sd

2. Write u-boot and friends to eMMC:

Code:
dd if=idbloader.img of=/dev/mmcblk2 bs=32k seek=1 conv=fsync
dd if=uboot.img of=/dev/mmcblk2 bs=64k seek=128 conv=fsync
dd if=trust.img of=/dev/mmcblk2 bs=64k seek=192 conv=fsync

3. Create partition on eMMC (starting at 32768 sector)

Code:

parted /dev/mmcblk2
(parted) mkpart primary ext3 32768s -1s
mkfs.ext3 /dev/mmcblk2p1

4. Mount the partition in /mnt
mount -t ext3 /dev/mmcblk2p1 /mnt

5.
Code:
cd /mnt

6.
Code:
mkdir dev proc sys mnt

7.
Code:
apt update
sudo apt install rsync
rsync -aHxv --numeric-ids --progress /* /mnt --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/mnt

8.
Code:
chroot /mnt

9. Edit boot.txt and change "root=PARTUUID=${uuid}" to "root=/dev/mmcblk2p1"
cd /boot
vi boot.txt

10.
Code:
mkimage -A arm64 -T script -O linux -d boot.txt boot.scr
11. reboot (without sd)

It's my pleasure.

Code:
fdisk -l                                                                                                                                                                                                               
Disk /dev/mmcblk2: 58.25 GiB, 62537072640 bytes, 122142720 sectors                                                                                                                                                                       
Units: sectors of 1 * 512 = 512 bytes                                                                                                                                                                                                     
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                                                     
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                                                         
Disklabel type: dos                                                                                                                                                                                                                       
Disk identifier: 0x50435990                                                                                                                                                                                                               
                                                                                                                                                                                                                                         
Device        Boot Start      End  Sectors  Size Id Type                                                                                                                                                                               
/dev/mmcblk2p1      32768 122142719 122109952 58.2G 83 Linux
Code:
lsblk
mmcblk2      179:0    0 58.2G  0 disk
└─mmcblk2p1  179:1    0 58.2G  0 part /
mmcblk2boot0 179:32  0    4M  1 disk
mmcblk2boot1 179:64  0    4M  1 disk
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Attempting to install Void Linux, boots into a black screen 9a3eedi 1 1,110 09-28-2024, 09:23 AM
Last Post: throwawayforvoid
  Pinebook pro won't boot after bootloader installation jwensouls 4 830 08-21-2024, 04:17 AM
Last Post: KC9UDX
  Slackware Linux working on PBP vxzero 0 566 06-05-2024, 04:30 PM
Last Post: vxzero
  [Pinebook Pro/Mobian/XFCE4] can fix touch or screen in greeter not both SynthGal 0 368 05-31-2024, 09:42 AM
Last Post: SynthGal
  Debian on Pinebook Pro u974615 7 2,689 03-31-2024, 10:11 AM
Last Post: u974615
  Pinebook Pro upgrading from the factory image yamsoup 12 3,875 02-22-2024, 04:02 PM
Last Post: tllim
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 3,122 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 3,383 12-11-2023, 03:47 AM
Last Post: calinb
  Gentoo on Pinebook Pro RELEASE jannik2099 54 101,884 12-08-2023, 11:25 PM
Last Post: tllim
  Boot Order in Pinebook Pro food 8 2,531 11-23-2023, 07:37 AM
Last Post: KC9UDX

Forum Jump:


Users browsing this thread: 1 Guest(s)