Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Revised format of 'new OS images'? #64

Closed
DeeJay opened this issue Jun 18, 2013 · 20 comments
Closed

Revised format of 'new OS images'? #64

DeeJay opened this issue Jun 18, 2013 · 20 comments
Labels

Comments

@DeeJay
Copy link

DeeJay commented Jun 18, 2013

The commit message for the fix to #43 refers to "requires new OS images".

The reply to #61 refers simply to compressing an existing image - is that still correct?

My interest is that I am 'shadowing' the development of NOOBS as I have a cheap HDMI-VGA adaptor that did not work correctly with the first public (zip) release of 1.1

Currently attempts to install an OS fail with an error relating to LBR. This is using compressed images distributed with NOOBS1.1

Have I misunderstood or misinstalled something, or what do I have to do to get compressed images compatible with the current /dev code, please?

@ghollingworth
Copy link

Yes the partition layout for the images has changed to fix a bug with NOOBS so old images cannot be installed with 1.2 We should have the new images available later today

@Rob-Bishop
Copy link
Contributor

In order to have a valid partitioning scheme we have had to change the partition layout on the OS images. The updated images will be released on /downloads soon and will be suitable for both standalone and NOOBS installs. The full NOOBS v1.2 zip release will contain these images.

Uses wanting to make a custom OS image for NOOBS will then be able to use one of the updated images from /downloads as a base to do so. Alternatively an existing image can be modified to work with the new partitioning scheme using parted.

@ghost
Copy link

ghost commented Jun 19, 2013

Any chance you could quantify "soon" for us, roughly? ;-)

@Rob-Bishop
Copy link
Contributor

Within a week.

@ghost
Copy link

ghost commented Jun 19, 2013

Cool - thanks.

Andrew.

On 19 June 2013 11:46, Rob Bishop notifications@github.com wrote:

Within a week.


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-19676307
.

@gyeben
Copy link
Contributor

gyeben commented Jun 19, 2013

What will the new partition layout be like?

@ghollingworth
Copy link

Partition

1- recovery primary partition fat16
2 extended partition
5 /boot logical partition fat16
6. / logical partition ext4

Gordon

@jrobinson-uk
Copy link

"Alternatively an existing image can be modified to work with the new partitioning scheme using parted."

Could you give further details of this.

Is it simply a case of changing the partitioning scheme to the one mentioned above, them imaging and compressing using dd and xz? Or do I change the scheme once the image is on the noobs sd card?

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=49377

@ghollingworth
Copy link

You need to change the image to use a different partitioning...

This means extracting the contents of the two partitions, recreating the partitioning and then copying the files across and finally xz'ing up the resultant image... You'd need to use the following commands (or this is one way)

losetup (this will create the loopback to the existing image)
partx (this will create the partition special devices from the loopback device)
mount (to mount the partitions)
tar (to copy off the files)
umount (to unmount the partitions)
kpartx (to remove the partition devices)
parted (to first delete the partitions from the special device then create the new ones in the extended partition)
kpartx (to create the new partition devices)
tar (to copy the files back across)
umount
kpartx (get rid of partitions)
losetup (get rid of loopback)

And you're done...

Gordon

@jrobinson-uk
Copy link

OK I'll try that, on separate machine acting of the existing custom image?

Can I PM you if I need more detail?

@lurch
Copy link
Collaborator

lurch commented Jul 9, 2013

You can see more of an example of using losetup and kpartx here http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=48811&p=380844&hilit=kpartx#p380844

Note that in that example Gordon's left off the -a (add) flag to kpartx, and I personally like to add the -v (verbose) flag too, so you can see what partitions kpartx has added without having to ls /dev/mapper/loop0*, i.e. replace sudo kpartx /dev/loop0 with sudo kpartx -av /dev/loop0

@jrobinson-uk
Copy link

Would it be easier to simply work from the original SD card and copy files to a new card and then image it? Having issues with buffer I/O errors reading p2. In a bit of a hurry so after the shortest route (I'm suppose to be handing out 40 pis to students tomorrow. If I copy to new card what would the partition sizes be for a 4GB card, how is the space divided?

@lurch
Copy link
Collaborator

lurch commented Jul 9, 2013

Maybe buffer errors would be fixed by using a different SD card reader?
I guess if you want the "shortest route possible", at the moment you'd probably be better of just using the traditional dd / Win32DiskImager method, rather than trying to create a special-format-image for use by NOOBS.

@jrobinson-uk
Copy link

@ghollingworth, thanks Gordon those instructions were really helpful. Managed to get 40 pis distrubuted to pupils in time. Even customized the noobs slides show. Now I can create a new sd card ready to go in about a minute.

thanks

James

@Rob-Bishop
Copy link
Contributor

@mr-minifig, that's really great news.

Are you planning on writing a blog post about how you set it up and what went well for you? I think it might be a helpful resource for other teachers who are thinking of doing the same thing.

@ghollingworth
Copy link

No problem James,

Good to see you were able to follow my somewhat random list of commands!

+1 on Rob's suggestion of writing it up for other teachers or even writing a script to automate...

Hope the kids enjoy the Raspberry Pi magazines...

Gordon

@jrobinson-uk
Copy link

@Rob-Bishop - If I get a chance I will, tho I still have a pi display to write up (and fix first), perhaps over the summer hols.

@Rob-Bishop
Copy link
Contributor

Thanks @mr-minifig.

I'm sure we could send some kudos or gifts your way if you were able to
find the time to write it up...

@jrobinson-uk
Copy link

Done!

I put together a quick guide and script this week which works with Raspbian based images, first real bash script so may be to be improved.

Rather than convert it builds a new image from the existing one. It currently reads the disk usage of the existing image and tries to create a partition of the correct size in the new. However I'm missing something as the new partition runs out of space. So at present it adds an arbitrary amount of space to accommodate this (yuck!)

Anyway, I've uploaded the guide and script to a git repo (still learning git)

https://github.com/mr-minifig/Pi-Noobs-Converter

@Rob-Bishop
Copy link
Contributor

Thanks @mr-minifig, that's great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants