HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //etc/flash-kernel/bootscript/bootscr.mediatek-aiot
# Ubuntu Core and Classic MTK AIoT U-Boot script (for armhf and arm64)

# Expects to be called with the following environment variables set:
#
#  devtype              e.g. mmc/scsi etc
#  devnum               The device number of the given type
#  distro_bootpart      The partition containing the boot files
#                       (introduced in u-boot mainline 2016.01)
#  prefix               Prefix within the boot partiion to the boot files
#  kernel_addr_r        Address to load the kernel to
#  boot_conf            The dtb filename

setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@"
@@UBOOT_ENV_EXTRA@@

@@UBOOT_PREBOOT_EXTRA@@

setenv kernel_filename fitImage
setenv core_state "/uboot/ubuntu/boot.sel"
setenv kernel_bootpart ${distro_bootpart}

if test -z "${fk_image_locations}"; then
  setenv fk_image_locations ${prefix}
fi

for pathprefix in ${fk_image_locations}; do
  if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}; then
    # Core image; set defaults for core's state then import from the first
    # boot.sel file. Then load the mutable boot.sel file from the next
    # partition
    setenv kernel_filename kernel.img
    setenv kernel_vars "snap_kernel snap_try_kernel kernel_status"
    setenv recovery_vars "snapd_recovery_mode snapd_recovery_system snapd_recovery_kernel"
    setenv snapd_recovery_mode "install"
    setenv snapd_standard_params "panic=-1"

    env import -c ${kernel_addr_r} ${filesize} ${recovery_vars}
    setenv bootargs "${bootargs} snapd_recovery_mode=${snapd_recovery_mode} snapd_recovery_system=${snapd_recovery_system} ${snapd_standard_params}"

    if test "${snapd_recovery_mode}" = "run"; then
      setexpr kernel_bootpart ${distro_bootpart} + 1
      load ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state}
      env import -c ${kernel_addr_r} ${filesize} ${kernel_vars}
      setenv kernel_name "${snap_kernel}"

      if test -n "${kernel_status}"; then
        if test "${kernel_status}" = "try"; then
          if test -n "${snap_try_kernel}"; then
            setenv kernel_status trying
            setenv kernel_name "${snap_try_kernel}"
          fi
        elif test "${kernel_status}" = "trying"; then
          setenv kernel_status ""
        fi
        env export -c ${kernel_addr_r} ${kernel_vars}
        save ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${pathprefix}${core_state} ${filesize}
      fi
      setenv kernel_prefix "${pathprefix}uboot/ubuntu/${kernel_name}/"
    else
      setenv kernel_prefix "${pathprefix}systems/${snapd_recovery_system}/kernel/"
    fi
  else
    # Classic image; the kernel prefix is unchanged, nothing special to do
    setenv kernel_prefix "${pathprefix}"
  fi
  if load ${devtype} ${devnum}:${kernel_bootpart} ${kernel_addr_r} ${kernel_prefix}${kernel_filename}; then
    echo "Booting Ubuntu (with bootm ${kernel_addr_r}${boot_conf})"
    bootm ${kernel_addr_r}${boot_conf}
  fi
done