About Building Armbian

Recommended Posts

Hi all!


I need to back to an older kernel version that I had used past year. In my PC, I conserve without any kind of changes, the working directory used to run compile.sh. If I did not missunderstood my Armbian documentation reading, there is an option to tell compilation process that don't try to upgrade sources files before compile (touch .ignore_changes).


Am I right? And, if it's fine, Could somebody please explain me where and how must I apply these parameter?


Thanks in advances!


Edit: You could ask. Why he want to re-compile if he has past_year.img file? The reason is I need to include kernel headers nad my old compilation does not have them.



Link to post
Share on other sites
Donate and support the project!

Yes werner, I think offline mode will be fine for me, I just need to preserve source files to re-generate 4.19 image (if I do it normal way I think my generated image will be 5.4.47). Sorry for basic questions, how do I setup offline mode?

Link to post
Share on other sites

Mmmmmmmh, I don't know where is my error, finally compile is done, but now I've 2 problems.


Firstly, Although I have compiled using the following statement:




and have received this messagges at begining of compilation process:


/tmp/tmp.lU8KzaKHib: line 4: update_src: command not found
[ o.k. ] Using config file [ /compilacion_viejo_kernel/Armbian-5.4.29/build/userpatches/config-example.conf ]
[ o.k. ] Command line: setting INSTALL_HEADERS to [ yes ]
[ o.k. ] Command line: setting OFFLINE_WORK to [ yes ]
[ o.k. ] Command line: setting BUILD_MINIMAL to [ yes ]

[ .... ] *  [ You are working offline. ]
[ .... ] *  [ Sources, time and host will not be checked ]

when compilation is finished, I just have this output files:



I tried with kernel version 5.4.29, instead of 4.19, but I think it doesn't matter for this issue???


My second problem is also, when I flash img file using etchoer, just like ever did it, system doesn't boot at all. I know HW is working, cause if I flash SD card with other image file, everything works fine.


Is there some obvious thing that I'm missing?


Thanks in advances!


Link to post
Share on other sites

Ah okey, offlinemode is not necessarily what you want.


Aight to get this puzzle together.


Each baord has a config file to determ the board family: https://github.com/armbian/build/tree/master/config/boards

In your case sun8i.

Then there is a source config to determ which sources to be used on a specific board family: https://github.com/armbian/build/tree/master/config/sources/families

Still in your case sun8i. But you won't find any linked sources there.

There is an include in the config that inludes sunxi (which is general term für the whole family, to say sun4i, sun8i, sun9i and so on).

So check this include and there you will find the linked sources.


At this very moment there are three branches filled with these kernel versions:

- legacy: 4.19.x

- current: 5.4.x

- dev: 5.6.x


If none of those matches the kernel you are looking for you have to search in the file history for changes. Some I can remember is that last year the support for old-legacy 3.10.x and 3.14.x has been dropped. And current (which name was "next" back then) was on 4.14.x

Link to post
Share on other sites

Firstly, thanks for your answer Werner, and sorry for delay in my answer, I could connect again just today.


Things are exactly has you said, here is my board file in /build/config/boards/bananapim2ultra.csc


# R40 quad core 2Gb SoC Wifi eMMC
BOARD_NAME="Banana Pi M2U"

It is my family file /build/config/sources/families/sun8i.conf


source "${BASH_SOURCE%/*}/include/sunxi_common.inc"

if [[ -z ${OVERLAY_PREFIX} ]]; then

[[ -z $CPUMIN ]] && CPUMIN=480000
[[ -z $CPUMAX ]] && CPUMAX=1400000

	if [[ ${BOARD} == nanopi-r1 ]]; then
		# rename eth1 to wan0
		echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",KERNEL=="eth1", NAME="wan0"' > $SDCARD/etc/udev/rules.d/70-persisetn-net.rules
		# change default console to tty1 which is wired to the chasis
		sed -i "s/ttyS0/ttyS1/" $SDCARD/boot/boot.cmd
		mkimage -C none -A arm -T script -d $SDCARD/boot/boot.cmd $SDCARD/boot/boot.scr



And finally here is /build/config/sources/families/include/sunxi_common.inc, the file that contains links to kernel's source.


UBOOT_FW_ENV='0x88000,0x20000' # /etc/fw_env.config offset and env size

case $BRANCH in








	# execute specific tweaks function if present
	[[ $(type -t family_tweaks_s) == function ]] && family_tweaks_s

	cp $SRC/packages/blobs/splash/armbian-u-boot-24.bmp $SDCARD/boot/boot.bmp

	# execute specific tweaks function if present
	[[ $(type -t family_tweaks_bsp_s) == function ]] && family_tweaks_bsp_s

	dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1
	dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=8 status=noxfer > /dev/null 2>&1

	if grep -q "ubootpart" /proc/cmdline; then
		local tmp=$(cat /proc/cmdline)
		tmp="${tmp%% *}"
		[[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2>/dev/null)
		[[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null)
		[[ -n $dev ]] && DEVICE="/dev/$dev"
	elif [[ -f /var/lib/armbian/force_search_uboot ]]; then
		# This may cause overwriting u-boot for android or other non-Armbian OS installed on eMMC
		# so don't run this function by default
		for dev in $(lsblk -d -n -p -o NAME); do
			if grep -q 'eGON.BT0' <(dd if=$dev bs=32 skip=256 count=1 status=none); then
				# Assuming that only one device with SPL signature is present
				echo "SPL signature found on $dev" >&2

So, if I'm not wrong, I can't get a specific kernel version (for example 5.4.29) from a branch, I have to select a branch (legacy, current or dev) and it gives me the last version of this branch. Am I right?


Link to post
Share on other sites

That cannot be answered by a simple yes or no. It depends.

Let's take the 5.4 example.

If you follow the current branch it leads us to megi's orangepi-5.4 branch. If you check the Makefile (https://github.com/megous/linux/blob/orange-pi-5.4/Makefile)

you will notice that the actual version of this branch is 5.4.18. But when you compile the kernel it is actually 5.4.47 or something like that.

This means these patches come from Armbian. If you check the patch directory for your board family (https://github.com/armbian/build/tree/master/patch/kernel/sunxi-current)

you can see that the upstream patches are added here. If you need a very specific kernel version remove or rename the patches you do not need.


That was a quite easy example to get what you want.

On other sources, vanilla for example, it is a bit tougher. You would need to specify a commit at which point you want to use the sources.

Sometimes a board is fixed to a specific commit or kernel version because it is known that newer version of the same kernel branch are known to be broken and (as most of the times) nobody has time or resources to deal with it.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.