File: bootscr.sunxi

package info (click to toggle)
flash-kernel 3.35%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 600 kB
  • ctags: 8
  • sloc: sh: 297; makefile: 23
file content (54 lines) | stat: -rw-r--r-- 2,085 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# boot script for Allwinner SunXi-based devices

# Mainline u-boot v2014.10 introduces a new default environment and
# a new common bootcmd handling for all platforms, which is not fully
# compatible with the old-style environment used by u-boot-sunxi.
# This script therefore needs to check in which environment it
# is running and set some variables accordingly.

# On u-boot-sunxi, this script assumes that ${device} and ${partition}
# are set.

# The new-style environment predefines ${boot_targets}, the old-style
# environment does not.
if test -n "${boot_targets}"
then
  echo "Mainline u-boot / new-style environment detected."
  # Mainline u-boot v2014.10 uses ${devtype}, ${devnum} and
  # ${bootpart} where u-boot-sunxi uses ${device} and ${partition}.
  if test -z "${device}"; then setenv device "${devtype}"; fi
  if test -z "${partition}"; then setenv partition "${devnum}:${bootpart}"; fi
else
  echo "U-boot-sunxi / old-style environment detected."
  # U-boot-sunxi does not predefine kernel_addr_r, fdt_addr_r and
  # ramdisk_addr_r, so they have to be manually set. Use the values
  # from mainline u-boot v2014.10, except for ramdisk_addr_r,
  # which is set to 0x44300000 to allow for initrds larger than
  # 13MB on u-boot-sunxi.
  setenv kernel_addr_r 0x42000000
  setenv fdt_addr_r 0x43000000
  setenv ramdisk_addr_r 0x44300000
fi

if test -n "${console}"; then
  setenv bootargs "${bootargs} console=${console}"
fi

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

image_locations='/boot/ /'
kvers='@@KERNEL_VERSION@@'

for pathprefix in ${image_locations}
do
  if test -e ${device} ${partition} ${pathprefix}vmlinuz-${kvers}
  then
    load ${device} ${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${kvers} \
    && load ${device} ${partition} ${fdt_addr_r} ${pathprefix}dtb-${kvers} \
    && load ${device} ${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${kvers} \
    && echo "Booting Debian ${kvers} from ${device} ${partition}..." \
    && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  fi
done