SteveSpencer
Posts: 351
Joined: Thu Mar 28, 2013 9:19 am
Location: Nottingham, UK

Updating a downloaded image

Wed Mar 01, 2017 11:30 am

What I want to do is relatively simple. I want to take a downloaded .img file, on a Pi, and bring it up to date in terms of having the latest version of packages (including the kernel).

In this way, I would avoid having to run

Code: Select all

 apt-get update && apt-get dist-upgrade
when I copy the image to a card and boot the pi.

I have previously made use of mount with a loop device to mount the boot partition and copy an empty ssh file and a wpa_supplicant.conf file to it so that I can boot headless (which in theory I can do from a Windows machine anyway).
I also mounted the root partition as well, and was able to access that successfully.

I did think that mounting the root, and using chroot /mountpoint ... would allow me to do this.

Of course, I would also have to mount the boot partition under the mount point's boot directory first, or updating the kernel and/or any overlays wouldn't work.

So, two questions:

1. Is what I want to do possible?
(I recognise that I would have to regularly run the process to keep the image updated)

2. Does the mechanism I describe allow me to do such a thing?

Thanks in advance for any advice, experience, or general comments.
Steve S
No, I can't think of anything funny that won't offend someone if they want it to...

SteveSpencer
Posts: 351
Joined: Thu Mar 28, 2013 9:19 am
Location: Nottingham, UK

Re: Updating a downloaded image

Wed Mar 01, 2017 12:57 pm

Hmm. The short answer is yes and no.
I can do Jessie lite, but not full Jessie, since it runs out of space :(

However, for this particular use-case that's fine, since I am producing headless images for Pi Zero (and Zero W!) anyway.
Steve S
No, I can't think of anything funny that won't offend someone if they want it to...

fruitoftheloom
Posts: 21586
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Updating a downloaded image

Wed Mar 01, 2017 1:01 pm

SteveSpencer wrote:Hmm. The short answer is yes and no.
I can do Jessie lite, but not full Jessie, since it runs out of space :(

However, for this particular use-case that's fine, since I am producing headless images for Pi Zero (and Zero W!) anyway.

?? DietPi http://dietpi.com
Retired disgracefully.....
......to a more gentile life !

Return to “Troubleshooting”