Git Product home page Git Product logo

spindle's Introduction

spindle - a tool to help spin distribution images

Description

spindle is a set of scripts to aid building and working on a distribution image. I've been using this tool to generate Debian wheezy images for the Raspberry Pi, with the aim of producing reproducible, unbooted, clean setups that require no manual intervention. It works by producing a series of image files in QEMU's QED format (I exploit the format's support for backing files and copy on write).

It's not massively user friendly yet, but hopefully that should soon change (and of course, patches are welcome).

Project links

Current scripts

  • setup_spindle_environment: Sets up an schroot using wheezy and installs the pre-requisites needed for spindle (mainly QEMU, as it turns out I haven't used augeas). If you don't use this, please make sure you have at least QEMU 1.0.1
  • wheezy-stage0: Create and partition an SD card image, perform the initial debootstrap on the host and copy the files to the SD image.
  • wheezy-stage1: Complete second stage of debootstrap under QEMU after first setting up a squashfs filesystem derived from Rob Landley's excellent Aboriginal Linux. Setup dropbear.
  • wheezy-stage2: Add in Raspberry Pi 'firmware' and do misc config (e.g.
    fstab, network interfaces, hostname). The resulting image is bootable.
  • wheezy-stage3: Install and configure a few useful packages (such as ifplugd, sudo).
  • wheezy-stage4-lxde: Set up the lxde desktop.
  • wheezy-stage4-lxde-edu: Install MIT Scratch, Python development tools and other packages.

Getting started

The following describes how to start building SD card images using spindle.
The process isn't massively user friendly for people with no experience at all, but if you're currently doing this by hand then hopefully you'll find it helpful. Note that executing the downgrade_qemu script is necessary on most Debian and Ubuntu versions right now.

sudo ./setup_spindle_environment  my_spindle_chroot
sudo modprobe nbd max_part=16
schroot -c spindle
sudo ./downgrade_qemu
./wheezy-stage0
./wheezy-stage1
./wheezy-stage2
./wheezy-stage3
./wheezy-stage4-lxde
./helper export_image_for_release out/stage4-lxde.qed stage4-lxde.img

Now you can write stage4-lxde.img to SD card.

Take a look at wheezy-stage4-lxde to see how to add your own stage if you want further customisation.

HACKING

If you want to contribute, please do file issues on the bug tracker or send in patches/pull requests.

spindle is written in POSIX shell script and tries to make use of QEMU where possible for manipulating the filesystem of the target being generated. Look at the current scripts for examples. Please do talk to me if you're thinking of any large refactoring.

Good resources for shell scripting include:

License

MIT. See the LICENSE file.

Contact

Author: Alex Bradbury
Email: [email protected]
Homepage: http://asbradbury.org/

spindle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spindle's Issues

saned gets pulled in to the wheezy-stage4-lxde-edu image

I haven't had a look at exactly where, but it definitely gets installed. Likely as a side effect of and apt-get install pulling it in via recommended packages. Almost nobody wants saned, so we shouldn't provide it by default.

Include launcher for Qt5 graphics demos

We include the Qt5 libraries and graphics demos. We should make it easy for users to launch them, so they can get an instant taste of the graphical capability of the Raspberry Pi. This should work much like in the press image, and all graphics demos should be displayed full screen.

Should support producing a raspbian image

Raspbian is a community supports armv6 hard float build of Debian. It is developing rapidly, and it should be possible to produce at least an equivalent to the current wheezy-stage3 if not wheezy-stage4-lxde.

Enhancements aimed at the educational use

It looks like the Debian Release is moving towards the Educational Release. I have the following suggestions to enhance it for first time users:
Put a shortcut to the File Manager on the desktop
Use Chromium instead of Midori
Change the label of Idle to Idle2.7
Put the taskbar on the left of the screen and widen it. Works much better with HD monitors but maybe not with TV's
Change the option in Idle so that it opens in the editor screen
Make raspi-config accessible on the desktop
Reinstate the screen saver
Slow down Wormy, he must have speed up since I last played him 35 years ago!

lxpanel never loads

Logged in as pi, loading the desktop via startx: background image appears, mouse cursor appears and is responsive, then nothing. lxpanel doesn't appear at the bottom of the screen, and the process goes no further.

Switching out to another tty, top reports pcmanfm using 33% of the CPU and lxpanel another 10-30% variable. Leaving the system for twenty minutes - just in case it's being slow - results in no change. System is otherwise fully responsive at other ttys and over SSH during the process.

Same hardware combination (monitor, keyboard, mouse, SD card and Pi) using Debian 19-04-12 image works fine, with startx resulting in a fully working desktop environment with about fifteen seconds.

Better overscan configuration to raspi-config

Have an option that reboots with overscan disabled (if needed) and then allows top/left and bottom/right borders to be moved until they are just visible. This then writes overscan_left/overscan_right/overscan_top/overscan_bottom to config.txt and reboots.

Changing Overscan using raspi-config doesn't work

raspi-config adds a line after the last line of config.txt. However after sudo reboot that line has disappeared and the deliniating line above has lost its comment marking #.

It looks like the deliniating line is put in by raspi-config. It might be worth adding a comment to the file that changes made by raspi-config go below this line and will take precedence over uncommented out earlier changes to the file above the line.

update omxplayer package to latest version

There were a number of commits in the last week after a long quiet period. It would probably also make sense to move to date-based versioning of the package (given there is no official upstream versioning).

Default password 'raspberry' troublesome for users with qwertz keyboard

Currently, users with qwertz keyboards need to log in with pi/raspberry before they can change the key mapping. This means they have to notice the key mapping does not match their keyboard and type 'raspberrz'. Starting a configuration wizard on tty1 on first boot might be one way around this. There's also an argument for logging in automatically to tty1 until the users chooses they don't want this.

issues logging out of lxde?

A very odd bug report:

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=98600#p98600

Just noticed the following when checking I could attach using Putty.

Putty connected ok, I then start LXDE using the directly connected keyboard, all ok but when I tried to log out of the GUI the Rpi just hung. I tried it a few times always with the same result. I also tried typing startx on the remote terminal this time LXDE started but the remote link would not accept any input from the keyboard - but did display. This time when I tried to quit the GUI it just > restarted.

If I do not make the remote connection all seems fine with the logout process

midori in wheezy crashes frequently

It seems to crash just when loading e.g. guardian.co.uk or mail.google.com. Requires investigation. Valid fixes include pushing an alternative supported browser (though wheezy's iceweasel doesn't seem to work very nicely on the Pi either). chromium-browser is a contender, but sadly the wheezy version isn't available for armel. It may be possible to install the (now rather ancient) chromium-browser from squeeze.

'Firmware' (kernel and userspace libs) should be packaged

We should provide and make use of .deb packages for these, even if they're not perfect. We shouldn't request people completely wipe their SD cards to upgrade any more.

We have some contact with Debian developers, so proper packaging could make its way upstream. If that's a way off, we should just make do with imperfect packages in the interim.

Use swap file instead of swap partition?

Suggestion from mr10. This would make it easier to resize the root partition and for a user to set the size of swap they are happy with. On the other hand, if that resizing is all scripted for you anyway it's not such a big deal. It would also be worth testing if a swap file works with an NFS root or if it breaks horribly.

Startx message after login

After login you get a message to use startx to open the desktop which is fine. However the message is also displayed when you SSH in and I guess its undesirable to startx twice. Might be better to remove the message.

Wormy won't close

Trying to close wormy python game results in it not closing and near 100% CPU. kill pid would not kill the python process.

force proper partition alignment

The FAT32 partition is not optimally aligned. Although I ask for the ext4 partition to start at 60mb, it seems to end up at 58mb which is not ideal for cards with a 4mb erase block size.

no NAT/BRIDGE support

I thought I enabled all relevant netfilter/iptables options but it appears not.

See report at http://www.raspberrypi.org/phpBB3/viewtopic.php?p=99194#p99194

iptables is now compiled with the kernell : This is really good news, but ... still no NAT :
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables v1.4.13: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

Include a script to resize the root partition from the Raspberry Pi

This could be like the Fedora release, which resized root to fill the SD card on first boot, or just a script that is manually executed by the user. This could be done live, or we could use something like the 'emergency kernel' (a kernel+initramfs) to enlarge the FS while unmounted. Using a swap file rather than a partition as suggested in #15 might offer more flexibility also.

Add support for producing a sid image

This should be trivial - only blocked on the need to refactor the current scripts so that the logic for producing and configuring the wheezy image can be reused.

remove ssh key generation from critical path for launching initial raspi-config

While I'm at it, might want to move ssh key generation outside of rc.local (so it can be left untouched, for users to edit freely). ssh host keys can be generated in the background while raspi-config is being shown (improves the first boot experience for the common case of people who are using the device directly).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.