This is just the real basics as I figured out and a work in progress. I have not really figured out yet what wireless network driver that needs to be added to a Pi2 image to make it see the embedded Pi3 wireless network, but using a wired ethernet it at least gives me the option to capture some code off a distributed Pi2 image so it can be dropped onto a fresh install of 2016-05-27-raspian-jessie.
So in the example, I am using the ProxyMagic image for a Raspberry Pi 2 and want to drop the code onto a newer Pi3 Raspbian image.
- Download the latest raspbian image – I am using the debian jessie version dated May 27th 2016 from https://www.raspberrypi.org/downloads/raspbian/
- Unpack the .zip to expand to the .img file 2016-05-27-raspbian-jessie.img
- View the disk contents – this shows 2 partitions, the 63MB MSDOS boot partition and the 3.7GB linux partition
$> fdisk -lu 2016-05-27-raspbian-jessie.img
Disk 2016-05-27-raspbian-jessie.img: 3.8 GiB, 4019191808 bytes, 7849984 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x14c20151 Device Boot Start End Sectors Size Id Type 2016-05-27-raspbian-jessie.img1 8192 137215 129024 63M c W95 FAT32 (LBA) 2016-05-27-raspbian-jessie.img2 137216 7849983 7712768 3.7G 83 Linux
- Copy this off to a 8GB microSD card – my sdcard came in as /dev/sdd – you can check your dmesg output after inserting your card to get the device.
$> sudo dd if=2016-05-27-raspbian-jessie.img of=/dev/sdd
- As soon as the dd completes, my linux file manager (nemo) refreshed with the “boot” partition and a 3.7GB Volume. I can click on each to mount them in userspace – ie, the mount as /media/glaw/boot and /media/glaw/<some big long UID>
- In a terminal window, I did a cd to the sdcard ext4 mount and wiped everything out
$> cd /media/glaw/fc254b57-8fff-4f96-9609-ea202d871acf
$> sudo rm -rf *
$> sudo sync
- Now to mount up the ProxyMagic image to copy the files over. I’ve read about how you can calculate the total sectors offset based on the start # and the sector size and then specify the offset when doing a loop back mount, but found that kpartx does the trick very well.
$> kpartx -v -a ProxyMagic-RPI-v1.img
add map loop2p1 (253:0): 0 114688 linear /dev/loop2 8192
add map loop2p2 (253:1): 0 5662720 linear /dev/loop2 122880
- Up pops an authentication window asking for sudo rights to mount the new boot file system – it should mount as /media/glaw/boot1 and then click on the 2.9GB volume to mount.
- Locate the other