alecmuffett
Posts: 2
Joined: Fri Dec 02, 2016 11:24 am

Two NOOBS-to-Raspbian-Lite-Install Questions

Mon Dec 05, 2016 3:03 pm

Hi! I looked for a NOOBS forum but could not find one, so I hope it's okay to post here.

Two quick questions:
  • What would I have to to NOOBS to make it install a local copy of a Jessie-Lite image, rather than the full Jessie image?
  • Is there a "hook" in stock Raspbian/Raspbian-Lite which calls/executes a script that exists in "/boot"?
Why?

Well, I am building a 6-node RPi3b cluster. I will have 6+ SD cards to install, one per node + any future systems.

These are running headless (therefore Lite is appropriate) and I would like to not have to pull "Lite" over the network 6+ times when I could instead just copy it to the SD cards along with NOOBS.

I could build a "gold" image of a fully-configured machine, and then burn that image to the other SD cards, but in that circumstance I would be copying 16Gb not 350Mb to the blank SD cards, which is wasteful.

Also: I would like - during initial boot - to run a script that remounts /tmp, /var/tmp and /var/log as "tmpfs" after moving-aside any pre-existing rubbish in those directories, and maybe it could do other housekeeping like set hostnames, etc, without having to mess with DHCP and network servers.

Doable?

alecmuffett
Posts: 2
Joined: Fri Dec 02, 2016 11:24 am

Re: Two NOOBS-to-Raspbian-Lite-Install Questions

Tue Dec 06, 2016 2:47 pm

Aha!

There is some help, here - https://github.com/raspberrypi/noobs/bl ... /README.md

...though it's not evident that Raspbian is equipped with a "run script from /boot" hack yet.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Two NOOBS-to-Raspbian-Lite-Install Questions

Tue Dec 06, 2016 2:58 pm

alecmuffett wrote:Aha!

There is some help, here - https://github.com/raspberrypi/noobs/bl ... /README.md

...though it's not evident that Raspbian is equipped with a "run script from /boot" hack yet.

... but Raspbian does already have the ability to detect and relocate a wpa_supplicant.conf file from /boot if one exists so perhaps it would be possible to leverage that? I think it is an argument on the content of /boot/cmdline.txt.

(Just guessing from the name that you don't need a How To, just a tiny crack to get a sonic screwdriver into.. )

User avatar
jojopi
Posts: 3274
Joined: Tue Oct 11, 2011 8:38 pm

Re: Two NOOBS-to-Raspbian-Lite-Install Questions

Tue Dec 06, 2016 5:35 pm

I am surprised you are considering NOOBS. It mostly exists for people who do not have access to a "dd" command, and therefore cannot use the image downloads directly. (NOOBS also has some recovery features, but I do not think they are useful when headless.)

The Lite image is about 1.3GB uncompressed, and that is how much data has to be copied to the cards, even if you let NOOBS do the decompression.

On Linux you can mount both of the filesystems of an image locally before you install it to the card, which makes /boot hooks less necessary.

Code: Select all

unzip -x 2016-11-25-raspbian-jessie-lite.zip
sudo -s
mkdir /mnt/boot /mnt/root
mount -oloop,offset=$((8192*512)) 2016-11-25-raspbian-jessie-lite.img /mnt/boot
mount -oloop,offset=$((137216*512)) 2016-11-25-raspbian-jessie-lite.img /mnt/root
touch /mnt/boot/ssh
umount /mnt/boot
editor /mnt/root/etc/shadow
umount /mnt/root
dd bs=1M if=2016-11-25-raspbian-jessie-lite.img of=/dev/sdX

User avatar
procount
Posts: 2215
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Two NOOBS-to-Raspbian-Lite-Install Questions

Wed Dec 07, 2016 12:11 am

Maybe https://github.com/procount/noobsconfig would be useful to you? This functionality is also built into PINN.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Raspberry Pi OS”