How to use linux kernel I compiled?

you uploaded “ArchLinuxArm_Server_VIM1_20190718.tar .xz”
when uncompressed and untared, does it output an img file we just need to flash (w/ dd or etcher) to EMMC ? SD ? USB drive ?

It’s a SD card/USB image
I didn’t try USB drive, I think you should modify boot.ini before booting with USB drive

I still do not understand how you made your ubuntu system in emmc correctly boot mainline kernel + arch linux on SD;

I think SD image and usb image behave the same when correctly started by emmc’s uboot …

Maybe the emmc’s uboot will read SD’s boot.ini at first

You can also boot with sd card by modifying boot.ini which in emmc

is this approved by @balbes150 and @numbqq as a relevant and pertistant solution ?
please publish here your current emmc’s boot ini

cf Manjaro Linux - Desktop Environment for KVIM1 and all the FUD related to the mess in the non android firmware in EMMC

Please wait, I’m on my way home.

KHADAS-UBOOT-CONFIG

echo "Starting boot.ini..."

setenv kernel_loadaddr "0x11000000"
setenv dtb_loadaddr "0x1000000"
setenv initrd_loadaddr "0x13000000"
setenv env_loadaddr "0x20000000"

setenv hdmiargs "logo=${display_layer},loaded,${fb_addr},${outputmode} vout=${outputmode},enable hdmimode=${hdmimode}"

if test "X$lcd_exist" = "X1"; then setenv panelargs "panel_exist=${lcd_exist} panel_type=${panel_type}";fi;

setenv boot_start booti ${kernel_loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}

setenv mmc_devplist "1 5"
setenv mmc_devnums "0 1"
setenv usb_devplist "1"
setenv usb_devnums "0 1 2 3"

setenv mark_prefix ""

if test "$hostname" = "KVIM1"; then setenv ml_dtb "/dtb/meson-gxl-s905x-khadas-vim.dtb"; else if test "$hostname" = "KVIM2"; then setenv ml_dtb "/dtb/meson-gxm-khadas-vim2.dtb";fi;fi;

## First, boot from mmc
## 0 - SD card, higher priority
## 1 - eMMC
for dev_num in ${mmc_devnums}; do for distro_bootpart in ${mmc_devplist}; do echo "Scanning mmc ${dev_num}:${distro_bootpart}..."; if load mmc ${dev_num}:${distro_bootpart} ${initrd_loadaddr} uInitrd; then if load mmc ${dev_num}:${distro_bootpart} ${kernel_loadaddr} zImage; then if load mmc ${dev_num}:${distro_bootpart} ${dtb_loadaddr} dtb.img || load mmc ${dev_num}:${distro_bootpart} ${dtb_loadaddr} ${ml_dtb}; then if load mmc ${dev_num}:${distro_bootpart} ${env_loadaddr} /boot/env.txt || load mmc ${dev_num}:${distro_bootpart} ${env_loadaddr} env.txt; then echo "Import env.txt"; env import -t ${env_loadaddr} ${filesize};fi;if test "X${rootdev}" = "X"; then echo "rootdev is missing! use default: root=LABEL=ROOTFS!";setenv rootdev "LABEL=ROOTFS";fi;if test "X${custom_ethmac}" != "X"; then echo "Found custom ethmac: ${custom_ethmac}, overwrite eth_mac!"; setenv eth_mac ${custom_ethmac};fi;if test "X${eth_mac}" = "X"; then echo "Set default mac address to ethaddr: ${ethaddr}!";setenv eth_mac ${ethaddr};setenv save_ethmac "yes";fi;if test -e mmc ${dev_num}:${boot_env_part} ${mark_prefix}.next; then echo "Booting mainline kernel...";setenv condev "console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0";else echo "Booting legacy kernel...";setenv condev "console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0";fi;if test "X${hwver}" = "XVIM2.V14"; then fdt addr ${dtb_loadaddr};fdt resize 65536;fdt set /fan hwver "VIM2.V14";fdt set /i2c@c11087c0/khadas-mcu hwver "VIM2.V14";fdt set /soc/cbus@c1100000/i2c@87c0/khadas-mcu hwver "VIM2.V14";fi;setenv bootargs "root=${rootdev} rootflags=data=writeback rw ${condev} ${hdmiargs} ${panelargs} fsck.repair=yes net.ifnames=0 ddr_size=${ddr_size} wol_enable=${wol_enable}  jtag=disable mac=${eth_mac} androidboot.mac=${eth_mac} save_ethmac=${save_ethmac} fan=${fan_mode} hwver=${hwver} coherent_pool=${dma_size}";run boot_start;fi;fi;fi;done;done;

## Second, boot from USB storage
for dev_num in ${usb_devnums}; do for distro_bootpart in ${usb_devplist}; do echo "Scanning usb ${dev_num}:${distro_bootpart}...";if fatload usb ${dev_num}:${distro_bootpart} ${initrd_loadaddr} uInitrd; then if fatload usb ${dev_num}:${distro_bootpart} ${kernel_loadaddr} zImage; then if fatload usb ${dev_num}:${distro_bootpart} ${dtb_loadaddr} dtb.img || fatload usb ${dev_num}:${distro_bootpart} ${dtb_loadaddr} ${ml_dtb}; then if fatload usb ${dev_num}:${distro_bootpart} ${env_loadaddr} /boot/env.txt || fatload usb ${dev_num}:${distro_bootpart} ${env_loadaddr} env.txt; then echo "Import env.txt"; env import -t ${env_loadaddr} ${filesize};fi;if test "X${rootdev}" = "X"; then echo "rootdev is missing! use default: root=LABEL=ROOTFS!";setenv rootdev "LABEL=ROOTFS";fi;if test "X${custom_ethmac}" != "X"; then echo "Found custom ethmac: ${custom_ethmac}, overwrite eth_mac!"; setenv eth_mac ${custom_ethmac};fi;if test "X${eth_mac}" = "X"; then echo "Set default mac address to ethaddr: ${ethaddr}!";setenv eth_mac ${ethaddr};setenv save_ethmac "yes";fi;if test -e usb ${dev_num}:${distro_bootpart} ${mark_prefix}.next; then echo "Booting mainline kernel...";setenv condev "console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0";else echo "Booting legacy kernel...";setenv condev "console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0";fi;if test "X${hwver}" = "XVIM2.V14"; then fdt addr ${dtb_loadaddr};fdt resize 65536;fdt set /fan hwver "VIM2.V14";fdt set /i2c@c11087c0/khadas-mcu hwver "VIM2.V14";fdt set /soc/cbus@c1100000/i2c@87c0/khadas-mcu hwver "VIM2.V14";fi;setenv bootargs "root=${rootdev} rootflags=data=writeback rw ${condev} ${hdmiargs} ${panelargs} fsck.repair=yes net.ifnames=0 ddr_size=${ddr_size} wol_enable=${wol_enable} jtag=disable mac=${eth_mac} androidboot.mac=${eth_mac} save_ethmac=${save_ethmac} fan=${fan_mode} hwver=${hwver} coherent_pool=${dma_size}";run boot_start;fi;fi;fi;done;done;
1 Like

The current mmc device number is 0 , so another one is 1
If you want to boot SD card with the emmc’s boot.ini, reverse the mmc_devnums.

@_no_proxy, I have a question that the security key is the password in WiFi menu?

Yes, It is.(20 char)

@_no_proxy,I check it just now . DHCP service & WiFi all is fine.I suggest that you can open the Serial Port Printing.

1 Like

How to open the Serial Port Printing ? linux kernel .config?

thank you! I’m far from my VIM1 for now, so please other testers report here what they achieve with this very very up-to-date kernel and Arch linux server image !

It means you didn’t turn off serial printing, did you?

No, it seems to have closed, I’m trying to compile kernel with some UART drivers and printk

1 Like

@Frank
Oh, I don’t have to re-compile the kernel, I found somthing in uboot output and boot.ini
the kernel is detected as legacy kernel.

 echo "Booting mainline kernel...";setenv condev "console=ttyAML0,1152....
 echo "Booting legacy kernel...";setenv condev "console=ttyS0,1152....

mainline kernel use ‘/dev/AML0’ to instead of ‘/dev/ttyS0’
Just replace ‘ttyS0’ to ‘ttyAML0’

1 Like

.tar.xz now downloaded…
==> -rw-rw-r-- 1 raxy raxy 3565159936 juil. 18 19:50 ArchLinuxArm_Server_VIM1_20190718.tar
fighting for free disk space…
you could have just uploaded a .img.7z file…

sudo tar xvf ~/Downloads/ArchLinuxArm_Server_VIM1_20190718.tar
ArchLinuxArm_Khadas_VIM1_20190718.img
tar: ArchLinuxArm_Khadas_VIM1_20190718.img: Cannot change ownership to uid 0, gid 0: Operation not permitted
tar: Exiting with failure status due to previous errors

anyway, I get this:
-rw-r–r-- 1 raxy raxy 3565158400 juil. 18 13:02 ArchLinuxArm_Khadas_VIM1_20190718.img
I hope this img is correct !
Now flashing it… sudo dd if=ArchLinuxArm_Khadas_VIM1_20190718.img bs=8M of=/dev/sdb status=progress
425+0 records in
425+0 records out
3565158400 bytes (3,6 GB, 3,3 GiB) copied, 430,833 s, 8,3 MB/s
Let the fun really begin now…

Latest changes are here

Yes, that’s correct.

I’ll try 7z with next image.