Fenix, docker build, debian buster, krescue

Generally it is a bad idea to use usb drive to build anything.

Put it on ssd if you can.
I used to build ubuntu xfce vim3 image with docker on linux mint 19.3 without any problems, so no you don’t need to have ubuntu as host OS :wink:

S.

1 Like

I move the directory from USB drive to my local SDD then…and will rebuild in docker from there

the verification of OS matching in @numbqq’s code is maybe too strict…

ok, good news ! (I moved all fenix directory to a non USB connected filesystem, that solved the permission issue)

Info: Free space:
Filesystem      Size  Used Avail Use% Mounted on
overlay         111G   30G   76G  29% /
tmpfs            64M     0   64M   0% /dev
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
shm              64M     0   64M   0% /dev/shm
/dev/sda4       111G   30G   76G  29% /etc/timezone
/dev/loop0p2    2.2G  1.5G  664M  70% /home/khadas/fenix/build/images/rootfs
/dev/loop0p1    240M   59M  181M  25% /home/khadas/fenix/build/images/rootfs/boot
Info: Image install type: SD-USB

Info: IMAGE: /home/khadas/fenix/build/images/VIM1_Debian-server-buster_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200327.img  is ready!
Cleanup...

Done.

Fri Mar 27 17:54:51 CET 2020
Time elapsed: 22 minute(s).

but I’ll redo it with saving the logs because i’ve seen many core dumps in the logs…

@hyphop, now that I can build buster in docker but only for TF card , how can I go further and generate kresq file ? it seem that your fenix fork does not include the make_debian_mainline_server.sh anymore :face_with_raised_eyebrow:

krescue + fenix = WORK IN PROGRESS

but u can write this image directy to EMMC same as SD ( it possible if image have mainline uboot )

  1. connect and power your VIM board with HOST machine via usb otg cable
  2. start krescue from sd
  3. check VIM disks which exported via usb to your HOST like common flash disks
    for example this output from my working laptop
master@peace:~$ lsscsi | grep Krescue
[3:0:0:0]    disk    Krescue. MMC                    /dev/sdc 
[3:0:0:1]    disk    Krescue. SD                     /dev/sdd 
[3:0:0:2]    disk    Krescue. RAM                    /dev/sde 
  1. just write your image to emmc ( be carefully /dev/sdc - just for this example may be u can have any other name )
dd bs=1M of=/dev/sdc if=fenix/build/VIM3_Debian-server-buster_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200320.img 
sync

  1. remove sd and reboot from emmc

PS: u can fix or change some files on emmc via same usb export anytime

1 Like

do you mean that when VIM1 is booted from its SD having krescue, then its MMC drive can be seen as /dev/sdc (or other letter) from the host linux computer and then I just burn EMMC with the image file built by fenix for SD card ??

I do not currently have any TF card with krescue on it,but if I make one, why not just add the .img file on that same card and then just use dd from the openwrt shell to burn the .img into the EMMC ?

1 Like

I’m trying to build linux 5.5.0 (kernel/git/torvalds/linux.git - Linux kernel source tree) instead of rc2, so here what I did:

cd fenix/packages/linux-mainline
edit package.mk, change PKG_VERSION="5.5-rc2" into PKG_VERSION="5.5"

and change into
PKG_SHA256=“aca303b87c818cb41c2ddfd4c06d3fcaa85e935fbd61ea203232ccd2a81844bb”
into
PKG_SHA256=“87c2ecdd31fcf479304e95977c3600b3381df32c58a260c72921a6bb7ea62950”

cd patches
cp -r 5.5-rc2 5.5
cd ..
docker start fenix
docker exec -ti fenix bash
source env/setenv.sh
time make | tee buildLog 2>&1

but build fails with these errors:


patching file drivers/gpu/drm/meson/meson_rdma.h
patching file drivers/gpu/drm/meson/meson_crtc.c
patching file drivers/gpu/drm/meson/meson_osd_afbcd.c
patching file arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
patching file arch/arm64/boot/dts/amlogic/Makefile
patching file arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi
patching file arch/arm64/boot/dts/amlogic/meson-gxl-s905d-libretech-pc.dts
patching file arch/arm64/boot/dts/amlogic/meson-gxm-s912-libretech-pc.dts
patching file drivers/clk/clk.c
Hunk #1 succeeded at 3277 with fuzz 2 (offset 28 lines).
Hunk #2 FAILED at 3294.
Hunk #3 FAILED at 3442.
Hunk #4 succeeded at 4331 with fuzz 2 (offset 22 lines).
Hunk #5 succeeded at 4370 with fuzz 2 (offset 24 lines).
2 out of 5 hunks FAILED – saving rejects to file drivers/clk/clk.c.rej
make: *** [all] Error 1
Makefile:7: recipe for target ‘all’ failed

real 2m52.703s
user 1m21.318s
sys 0m23.211s

I need to check what’s wrong while patching file clk.c

Visibly, I need the appropiate patchset for VIM / amlogic boards for linux 5.5 as at least one file has changed since rc2…
Where can I find the patchset for 5.5 @chewitt and @numbqq please ?

yes u right!

I do not currently have any TF card with krescue on it,

its same not problem ! can burn Krescue to emmc and start from emmc ! i hope if u buy SD card its was same very usefully

goto openwrt shell and type next command which write krescue to emmc - sure we must have internet connection at this time

curl -sfL dl.khadas.com/.mega | sh -s - -y -X > /dev/mmcblk?

but if I make one, why not just add the .img file on that same card and

sure we have many ways and this one same ok!

then just use dd from the openwrt shell to burn the .img into the EMMC ?

remember !!! if your current os works from emmc , u can broke everything becouse emmc can used by os same time

another situation with krescue because its special system which works fully from RAM, and didnt use emmc/sd after booting! and u can write any data to emmc safety already

1 Like

I have a 5.5 tree here: https://github.com/chewitt/linux/commits/amlogic-5.5-integ … but I stopped work on it some time before 5.5 release due to work committments. It would be better to use my 5.6 tree here: https://github.com/chewitt/linux/commits/amlogic-5.6-integ.

2 Likes

as i already have a tf card with bootable ubuntu on it, i will copy the img on it, boot from it and will dd the img from there to the emmc, will that succeed ? or paybe just use amlogic flashing tools on linux after erasing emmc and put vim1 in flash ready mode ?

u can try ! must works !

It should work. If you need a plan B, the krescue image or an LE (AMLGX) image from https://test.libreelec.tv/ will get you to a usable console.

1 Like

ok, i’m trying to flash the new image,
I copied the file to a TF card having ubuntu 18 on it;
then I booted from that ubuntu,
I installed lsscsi but it shows no partition
so i tried to identify the emmc partitions names like that:

khadas@Khadas:~$ sudo blkid| grep mmc
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="BOOT" UUID="DFBE-76FF" TYPE="vfat" PARTUUID="4123a459-01"
/dev/mmcblk0p2: LABEL="ROOTFS" UUID="71956927-a6da-4ed0-b212-89316de30b9f" TYPE="ext4" PARTUUID="4123a459-02"
/dev/mmcblk1p1: SEC_TYPE="msdos" LABEL="BOOT" UUID="9CD6-1050" TYPE="vfat" PARTUUID="7678ba0e-01"
/dev/mmcblk1p2: LABEL="ROOTFS" UUID="037c4299-3af3-40fc-a85e-4ee0240df036" TYPE="ext4" PARTUUID="7678ba0e-02"
/dev/mmcblk0: PTUUID="4123a459" PTTYPE="dos"
/dev/mmcblk1: PTUUID="7678ba0e" PTTYPE="dos"
khadas@Khadas:~$ 

I think TF is mmcblk0 , EMMC is mmcblk1,
so img shall be flashed to /dev/mmcblk1p1 or p2 ??

for the record, the complete failed build log is here : http://s000.tinyupload.com/?file_id=00630927829574754596

howto detect internal emmc example

ls /dev/mmcblk?boot0
/dev/mmcblk2boot0

this one /dev/mmcblk2 internal emmc

another example just print emmc blockdev name

echo $(ls /dev/mmcblk?boot0 | head -c12)

ok, I did this…

dd bs=1M of=`ls /dev/mmcblk?boot0 | head -c12` if=/home/VIM1_Debian-server-buster_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200327.img
sync
sudo halt

remove the TF card
then press reset btn and see VIM1 boot docker fenix built manline uboot, mainline 5.5-rc2, and debian buster lite !!

..
[    7.095299] Bluetooth: BNEP socket layer initialized
[    7.133854] Bluetooth: hci1: BCM4345C0 (003.001.025) build 0075
[    8.236651] meson8b-dwmac c9410000.ethernet eth0: PHY [0.e40908ff:08] driver [Meson GXL Internal ]
[    8.254281] meson8b-dwmac c9410000.ethernet eth0: No Safety Features support found
[    8.256235] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[    8.265118] meson8b-dwmac c9410000.ethernet eth0: configuring for phy/rmii link mode
[    9.852393] meson8b-dwmac c9410000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[    9.855481] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Debian GNU/Linux 10 Khadas ttyAML0

Khadas login: khadas
Password: 
Last login: Sat Mar 28 12:31:36 CET 2020 on ttyAML0

Welcome to Fenix 0.8.3 Debian GNU/Linux 10 (buster) Linux 5.5.0-rc2  
 _  ___               _            __     _____ __  __ _ 
| |/ / |__   __ _  __| | __ _ ___  \ \   / /_ _|  \/  / |
| ' /| '_ \ / _` |/ _` |/ _` / __|  \ \ / / | || |\/| | |
| . \| | | | (_| | (_| | (_| \__ \   \ V /  | || |  | | |
|_|\_\_| |_|\__,_|\__,_|\__,_|___/    \_/  |___|_|  |_|_|
                                                         

 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

khadas@Khadas:~$

Now, let’s see how to inject chewitt’s 5.6-rc7 into this build method…

1 Like

@hyphop, could you help us to upgrade just the kernel to a more recent one ? (like 5.5.13 or 5.6-rc y)

Sure it easy I can write how to tomorrow today I’m tired :wink:

1 Like