Skip to content

Instantly share code, notes, and snippets.

@penk
Created December 10, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save penk/c899ceb1d93296fe6d72f6fee75bce84 to your computer and use it in GitHub Desktop.
Save penk/c899ceb1d93296fe6d72f6fee75bce84 to your computer and use it in GitHub Desktop.
Custom bootscript to boot Ubuntu Core from USB on RPi2/3
snap_core=core_584.snap
snap_kernel=pi2-kernel_24.snap
snappy_usb_boot=run loadfiles; setenv mmcroot "/dev/sda2 ${snappy_cmdline} snap_core=${snap_core} snap_kernel=${snap_kernel}"; run mmcargs; bootz ${loadaddr} ${initrd_addr}:${initrd_size} 0x02000000
loadinitrd=load usb ${mmcdev}:${mmcpart} ${initrd_addr} ${snap_kernel}/${initrd_file}; setenv initrd_size ${filesize}
loadkernel=load usb ${mmcdev}:${mmcpart} ${loadaddr} ${snap_kernel}/${kernel_file}
uenvcmd=echo USB-BOOT; run usb_boot; run snappy_usb_boot
@penk
Copy link
Author

penk commented Dec 11, 2016


DRAM:  560 MiB
WARNING: Caches not enabled
RPI 3 Model B (0xa02082)
MMC:   bcm2835_sdhci: 0
reading uboot.env
In:    serial
Out:   lcd
Err:   lcd
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
LOADBOOTENV
reading uEnv.txt
512 bytes read in 48 ms (9.8 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
USB-BOOT
starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 5 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 1 Ethernet Device(s) found

USB device 0: 
    Device 0: Vendor: SanDisk  Rev: 4.08 Prod: Cruzer Contour  
            Type: Removable Hard Disk
            Capacity: 15679.8 MB = 15.3 GB (32112269 x 512)
... is now current device
Scanning usb 0:1...
Scanning usb 0:2...
reading pi2-kernel_24.snap/kernel.img
reading pi2-kernel_24.snap/initrd.img
Kernel image @ 0x200000 [ 0x000000 - 0x660fd0 ]
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Ramdisk to 22840000, end 22b2a03f ... OK
   Loading Device Tree to 22838000, end 2283f35b ... OK

Starting kernel ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment