The minimal Raspbian unattended netinstaller for Raspberry Pi Model B.
This project provides Raspbian power users the possibility to install a minimal base system unattended using latest Raspbian packages regardless when the installer was built.
The installer with default settings configures eth0 with DHCP to get Internet connectivity and completely wipes the SD card from any previous installation.
There are different kinds of "presets" that define the default packages that are going to be installed. Currently, the default one is called server which installs only the essential base system packages including OpenNTPd and OpenSSH to provide a sane minimal base system that you can immediately after install ssh in and continue installing your software.
Other presets include minimal which has even less packages (no logging, no text editor, no cron) and base which doesn't even have networking. You can customize the installed packages by adding a small configuration file to your SD card before booting up.
- completely unattended, you only need working Internet connection through the Ethernet port
- DHCP and static ip configuration (DHCP is the default)
- always installs the latest version of Raspbian
- configurable default settings
- extra configuration over HTTP possible - gives unlimited flexibility
- installation takes well under 15 minutes with fast Internet from power on to sshd running
- fits in 512MB SD card
- default install includes fake-hwclock to save time on shutdown
- default install includes OpenNTPd to keep time
- /tmp is mounted as tmpfs to improve speed
- no clutter included, you only get the bare essential packages
- option to install root to USB drive
- a Raspberry Pi Model B
- SD card of at least 512MB (or at least 64MB for USB root install)
- working Ethernet with Internet connectivity
Installer archive is around 9MB and contains all firmware files and the installer.
https://github.com/hifi/raspbian-ua-netinst/releases/download/v1.0/raspbian-ua-netinst-v1.0.zip
Format your SD card as FAT32 (MS-DOS on Mac OS X) and extract the installer files in.
Prebuilt image is around 6MB xz compressed and 32MB uncompressed. It contains the same files as the .zip but is more convenient for Linux users.
https://github.com/hifi/raspbian-ua-netinst/releases/download/v1.0/raspbian-ua-netinst-v1.0.img.xz
To flash your SD card on Linux:
xzcat /path/to/raspbian-ua-netinst-latest.img.xz > /dev/sdX
Replace /dev/sdX with the real path to your SD card.
In normal circumstances, you can just power on your Pi and cross your fingers.
If you don't have a display attached you can monitor the Ethernet card leds to guess activity. When it finally reboots after installing everything you will see them going out and on a few times when Raspbian configures it on boot.
If you do have a display, you can follow the progress and catch any possible errors in the default configuration or your own modifications.
The system is almost completely unconfigured on first boot. Here are some tasks you most definitely want to do on first boot.
The default root password is raspbian.
Set new root password:
passwd
Configure your default locale:dpkg-reconfigure locales
Configure your timezone:dpkg-reconfigure tzdata
Install latest kernel and firmware package:apt-get update && apt-get install linux-image-rpi-rpfv raspberrypi-bootloader-nokernel
Replace old kernel.img with latest kernel:cp /vmlinuz /boot/kernel.img
Reboot to new kernel and firmware:reboot
Installing the firmware package is strongly recommended because the installer does not install any kernel modules which are required for ipv6, sound and many more stuff you might need.
Optional:
apt-get install raspi-copies-and-fills
for improved memory management performance. Optional: Create a swap file withdd if=/dev/zero of=/swap bs=1M count=512 && mkswap /swap
(example is 512MB) and enable it on boot by appending/swap none swap sw 0 0
to/etc/fstab
.
If you want to reinstall with the same settings you did your first install you can just move the original config.txt back and reboot. Make sure you still have kernel_emergency.img and installer.cpio.gz in your /boot partition. If you are replacing your existing system which was not installed using this method, make sure you copy those two files in and the installer config.txt from the original image.
mv /boot/config-reinstall.txt /boot/config.txt
reboot
Remember to backup all your data and original config.txt before doing this!
While defaults should work for most power users, some might want to customize default configuration or the package set even further. The installer provides support for this by reading a configuration file installer-config.txt from the first vfat partition. The configuration file is read in as a shell script so you can abuse that fact if you so want to.
Easiest way to do this is to first xzcat the image to your SD card and then mount the first partition to add your configuration file.
The format of the file and the current defaults:
preset=server
packages= # comma separated list of extra packages
mirror=http://mirrordirector.raspbian.org/raspbian/
release=wheezy
hostname=pi
domainname=
rootpw=raspbian
cdebootstrap_cmdline=
bootsize=+50M # /boot partition size as given to fdisk
rootsize= # / partition size, leave empty to use all free space
timeserver=time.nist.gov
ip_addr=dhcp
ip_netmask=0.0.0.0
ip_broadcast=0.0.0.0
ip_gateway=0.0.0.0
ip_nameservers=
online_config= # URL to extra config that will be executed after installer-config.txt
usbroot= # set to 1 to install to first USB disk
cmdline="dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline"
rootfstype=ext4
rootfs_mkfs_options=
rootfs_install_mount_options='noatime,data=writeback,nobarrier,noinit_itable'
rootfs_mount_options='errors=remount-ro,noatime'
All of the configuration options should be clear. You can override any of these in your installer-config.txt. The time server is only used during installation and is for rdate which doesn't support the NTP protocol.
Available presets: server, minimal and base.
Presets set the cdebootstrap_cmdline
variable. For example, the current server default is:
--flavour=minimal --include=kmod,fake-hwclock,ifupdown,net-tools,isc-dhcp-client,ntp,openssh-server,vim-tiny,iputils-ping,wget,ca-certificates,rsyslog,dialog,locales,less,man-db
There's also a post-install script support which is executed just before unmounting the filesystems. You can use it to tweak and finalize your automatic installation. The script should reside in the first vfat partition and have a name of post-install.txt. See scripts/etc/init.d/rcS
for more details what kind of environment your script will be run in.
We take no responsibility for ANY data loss. You will be reflashing your SD card anyway so it should be very clear to you what you are doing and will lose all your data on the card. Same goes for reinstallation.
See LICENSE for license information.