64studio / pdk

64 Studio Platform Development Kit
GNU General Public License v2.0
20 stars 8 forks source link

Add support for ARM Dev-board SD-Card Image Generation #23

Closed obbardc closed 6 years ago

obbardc commented 7 years ago

This issue will track the progress of adding in ARM dev board support to PDK.

obbardc commented 7 years ago

PICAX has been written with only CD media in mind. This will take a bit of thinking about to implement in the cleanest way... but it is definitely doable.

One thing to keep in mind is the mounting of the temporary image files (in the pifactory script) has to be done as root... so the pdk mediagen command probably will have to be run as root, so may post some security risk?

obbardc commented 7 years ago

One thing to keep in mind is the mounting of the temporary image files (in the pifactory script) has to be done as root... so the pdk mediagen command probably will have to be run as root, so may post some security risk?

Looks like I might have figured this one out with some clever fuse-mount hacking for the image generation and a mixture of fakeroot and fakechroot for the debootstrap. Not a pretty hack by any means; but it will work! So some progress on this.

Next step (after some more testing) is to Pythonize it :)

obbardc commented 7 years ago

I've been looking into how best to implement this feature today. PDK was originally designed to support CD media, with different installers (e.g d-i and anaconda).

It will be very difficult to modify the existing way the pdk mediagen command works. So, I have come up with a few different ideas which will be a lot easier to implement:

  1. Create a separate command pdk imggen (for Raspberry Pi images) and leave pdk mediagen intact for ISOs.
  2. Create a separate command pdk imggen (for Raspberry Pi images) and a separate command pdk isogen for ISOs as to not confuse users.
  3. Use pdk mediagen as we currently do, but depending on the Metadata in the picax.xml file generate a CD, DVD, USB stick or preinstalled IMG file.
  4. (I did have a fourth option but I forgot it. It couldn't have been that good)

I like option 1 for our current testing, then we can gradually work into option 3. Option 3 allows us to do a lot more in the future as well, for instance pre-installed virtual machine drives.

The picax scripts need significant changes, anyway. A lot has changed since then in terms of how media is created in the Linux land.

I invision a simple re-write of picax (upgraded picax) which solves these issues................. To be continued.

danielhjames commented 7 years ago

Might be good to have support for creating images with 'holes' that can be written more efficiently with bmaptools: https://source.tizen.org/documentation/reference/bmaptool/introduction

obbardc commented 7 years ago

I think the best way to achieve this is to generate raw image files, then do any zipping, bmapping, md5summing in the project makefile.

obbardc commented 7 years ago

Update: This feature is now at 90% complete for the Raspberry Pi Debian Jessie image creation.

Currently, we can generate raw images; partition them; debootstrap from our PDF created APT Repo; then cleanup.

All we now need to be able to do is: get configuration from a preseed file; install custom packages; setup basic Linux stuff so we can boot a system; run a postinst script. We also need to modify our PDK Debian package to have a metapackage to install the required packages on the host system. The pdk imggen command should only run if this metapackage is installed. I estimate another eight hours at most...

Then we will have a working (but rough! Not much error checking) Proof of Concept of version 1.0 ready!

obbardc commented 6 years ago

Support for this is now merged into master. See instructions posted in documentation soon. See #36