Fenix, docker build, debian buster, krescue

Environment setup done.
Type 'make' to build.

khadas@92f7a138ad22:~/fenix$ make

Fenix Version:         0.8.3
Khadas Board:          VIM1
Uboot Version:         mainline
Uboot Configuration:   khadas-vim_defconfig
Uboot Branch:          master
Linux Version:         mainline
Linux Configuration:    defconfig
Linux DTB:             arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb
Linux Branch:          master
Distribution:          Debian
Distribution Release:  buster
Distribution Type:     server
Distribution Arch:     arm64
Install Type:          SD-USB
Final Image:           VIM1_Debian-server-buster_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200326.img

Info: Build host: bionic
config/functions/common-functions:79 Error: Building Debian Buster(10) images requires a Ubuntu Focal(20.04) build host, please upgrade your build host or try to build in Docker.
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 255

you did not say I now need to upgrade my whole machine into ubuntu 20 !! that’s not funny :pouting_cat:
is there anyone else already using ubuntu 20 that can test this docker build please ?

ok, i bypassed the OS version test and it started,
but ubfortunately ended again like this…

  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.o
  MODINFO modules.builtin.modinfo
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.o
  LD      vmlinux
  SORTEX  vmlinux
  SYSMAP  System.map
  OBJCOPY arch/arm64/boot/Image
  Building modules, stage 2.
  MODPOST 1746 modules

warning: same module names found:
make[1]: Leaving directory '/home/khadas/fenix/build/linux-mainline-5.5-rc2'
Info: Building debs...
Building package: linux-u-boot-vim1-mainline
dpkg-deb: error: control directory has bad permissions 777 (must be >=0755 and <=0775)
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 2

to be honest, the physical disk on which I installed the fenix directory is an USB3 hard disk, but it is an ext4 partition (as ntfs is know to be bad for building linux kernel)

any idea anyone ?

I checked both Bionic and Focal Docker can build Buster successfully on my PC.

It seems a permission issue. Can you check this:

$ ls -al
1 Like

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:


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!


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 

  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 (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v5.5) 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

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.


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"

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

this one /dev/mmcblk2 internal emmc

another example just print emmc blockdev name

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