-
Notifications
You must be signed in to change notification settings - Fork 15
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
making build to work in EMMC #30
Comments
The build log seems no problem, how about the boot log? |
it seems no output to HDMI(when tried in eMMC) nor ssh connection. if anything I can get additonal logs I will try again. |
Well, it seems that it didn't boot successfully. I'll paste some critical file for EMMC boot image, you can check below:
firstboot.sh #!/bin/bash
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export PATH
# resize root filesystem
if (lsblk | grep -q "mmcblk1p2"); then
parted -s /dev/mmcblk1 "resizepart 2 -0"
resize2fs /dev/mmcblk1p2
fi
parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2
# add normal user
useradd -s /bin/bash -m -k /etc/skel sipeed
echo 'sipeed:licheepi' | chpasswd
echo 'root:root' | chpasswd
usermod -a -G dialout sipeed
usermod -a -G cdrom sipeed
usermod -a -G sudo sipeed
usermod -a -G audio sipeed
usermod -a -G video sipeed
usermod -a -G plugdev sipeed
usermod -a -G users sipeed
usermod -a -G netdev sipeed
# generate locale data
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen
# change hostname
NEW_HOSTNAME="lpi3h-$(cat /sys/class/net/end0/address | tr -d ':\n' | tail -c 4)"
echo "NEW HOSTNAME: $NEW_HOSTNAME"
echo "$NEW_HOSTNAME" > /etc/hostname
echo "127.0.0.1 $NEW_HOSTNAME" > /etc/hosts
hostname "$NEW_HOSTNAME"
nmcli general hostname "$NEW_HOSTNAME"
systemctl enable avahi-daemon
# regenerate openssh host keys
dpkg-reconfigure openssh-server
# enable rc-local service
systemctl enable rc-local
# change the timezone
timedatectl set-timezone Asia/Shanghai And the other files has no difference between SD boot image and EMMC boot image. |
I tried method introduced in guide
then
then
so I proceed with and then noticed section 4. make file system with
while section 3 make file system with
tried both method and when I checked so I tried
instead. while now
said no error but still no boot from eMMC when I checked
also
now I suspect first assumation of 'rootfs' build failed is in fact there but |
Try this (make sure the extlinux.conf and firstboot.sh are modified for EMMC boot before run the script below): #!/bin/bash -e
# make a image file in size of 3G
export DATE=$(date +"%Y%m%d")
dd if=/dev/zero of=LPI3H_${DATE}.img bs=1M count=3072
echo "n
p
1
2048
+64M
n
p
2
t
1
c
a
1
w
" | fdisk LPI3H_${DATE}.img
sudo losetup -f LPI3H_${DATE}.img
sudo losetup -f -o $[2048*512] --sizelimit $[131072*512] LPI3H_${DATE}.img
sudo losetup -f -o $[133120*512] --sizelimit $[6158336*512] LPI3H_${DATE}.img
img_file=$(sudo losetup -l | grep LPI3H | grep " 0 0" | awk '{print $1}')
boot_partition=$(sudo losetup -l | grep LPI3H | grep " 67108864 1048576" | awk '{print $1}')
root_partition=$(sudo losetup -l | grep LPI3H | grep "3153068032 68157440" | awk '{print $1}')
sudo mkfs.vfat -F 32 -n boot $boot_partition
sudo mkfs.ext4 -L rootfs $root_partition
sudo dd if=build/u-boot-sunxi-with-spl.bin of=$img_file bs=1k seek=8 conv=fsync
mkdir -p /tmp/kernel
sudo mount $boot_partition /tmp/kernel
sudo cp -r overlay/boot/* /tmp/kernel
mkdir -p /tmp/rootfs
sudo mount $root_partition /tmp/rootfs
sudo tar -vxf build/rootfs.tar -C /tmp/rootfs/
sync
sudo umount /tmp/rootfs
sudo umount /tmp/kernel
sudo losetup -d $root_partition
sudo losetup -d $boot_partition
sudo losetup -d $img_file This script should work, it still need some changes though. |
tried. I'll try re-install host(ubuntu22.04) next day and build one from clean state only with minimal dependencies also might this could be an issue? curious. |
Yes, you can post your serial log here. |
it seems I completely failed to burn image on to eMMC? tried again March 20th yield same result. (failed one)
=================
(0228_EMMC.img)
...
|
Sorry for late reply, I'll check this problem this week. |
It turns out my patch file missed something to for emmc usage in uboot. #39 shuold fix this, you can try out. |
I got different errors, but I assume it's either due to my bad formatting/packaging or partioning. either way, will try next Dat again. always thanks for help && let me know if I am doing something wrong. ;) EDIT : 2024-04-02
|
tried to make 'bootable TF' from new TF card, I'd assume TFcard itself was corrupted? anyway this issue will be marked as closed as issue is resolved
|
It seems, cat /mnt/mmcblk0p2/boot/extlinux/extlinux.conf
default g1
menu title U-Boot menu
prompt 2
timeout 5
label g0
menu label Linux (boot from SD)
linux /Image
fdtdir /dtbs
append root=/dev/mmcblk0p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
label g1
menu label Linux (boot from EMMC)
linux /Image
fdtdir /dtbs
append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused |
The boot media priority is that the TF card has a higher priority than the eMMC. If you want to boot from eMMC and use TF card as a storage device, you need format the TF card. |
Yes I know that.
ERROR ### Please RESET the board
|
It seems not problem of the device partition number, because your boot stuck at uboot. |
EDIT : was my thought but it seems eMMC totally failed on boot(hence same issue with U-Boot SPL 2024.01-rc2-00070-g2ce6ac3430 (Apr 01 2024 - 20:33:22 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
EDIT: EDIT2: boot normal in TFCard. root@lpi3h-c6dd:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.5G 0 disk
├─mmcblk0p1 179:1 0 64M 0 part
└─mmcblk0p2 179:2 0 29.5G 0 part /
mmcblk1 179:32 0 28.9G 0 disk
├─mmcblk1p1 179:33 0 64M 0 part
└─mmcblk1p2 179:34 0 2.9G 0 part
mmcblk1boot0 179:64 0 4M 1 disk
mmcblk1boot1 179:96 0 4M 1 disk
root@lpi3h-c6dd:~# sudo reboot
Broadcast message from root@lpi3h-c6dd on pts/0 (Wed 2024-04-10 16:43:58 KST):
The system will reboot now!
~~~
[ 52.248243] reboot: Restarting system Start from TFCard, manually input eMMC boot from Serial Console.
TFCard Removed and reboot.
it seems uboot setup is the problem I guess(as you said)Update 3: |
It seems I have hard time make proper image due to lack of my skill hehe,
What I did
based on
does steps according to link with some modification :
git clone https://github.com/sipeed/LonganPi-3H-SDK.git
then
modify mkrootfs.sh collate to this
run scripts as order of
build an image from same article from
3. Make a boot TF card
4. Make a boot TF card image
either boot from baked TF(microSD) card
or
SCP built image to /opt and
to copy stuff to eMMC.
===========
also tried :
modify LonganPi-3H-SDK/overlay/boot/extlinux to have below
modify LonganPi-3H-SDK/overlay/opt/firstboot.sh to have below
logs are attached below.
mkatf_output.log
mklinux.log
mkuboot.log
mkrootfs.log
The text was updated successfully, but these errors were encountered: