Git Product home page Git Product logo

pibakery-blocks's Introduction

pibakery-blocks

PiBakery is a program that allows super-easy presetup of Raspberry Pi SD cards. Customisation is done using a Scratch-style interface, where each block represents a script to run on startup.

Anyone can create and add new blocks to PiBakery, meaning that if there's a setup task you always do to a new Raspbian install, or if you have some software you'd like everyone to be able to easily add to their Pi, you can create a block, and people can just drag that block into their setup script to run your code! Anyone can create a block, and once it's been added to this GitHub repo, everyone running PiBakery will automatically get the newly added block.

Creating a PiBakery block

The instructions for creating and submitting a block to PiBakery have moved to the PiBakery website

pibakery-blocks's People

Contributors

0e800 avatar cognitivegears avatar darthtoker avatar davidferguson avatar dkirkby avatar imgrant avatar johnnysheppard avatar stevethomas avatar toldyaonce avatar yombo avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pibakery-blocks's Issues

Feature Request: Add an arbitrary file to the build.

I didn't find an issue/request/comment that's similar to my request, so if I'm duplicating, could I ask you to please point me in the right direction?

I'm hoping to include rsa keys with my build so that I could then transfer my config files securely from a server on my local network. Then I could use the 'Run a command block' to either git clone or use some other transfer mechanism using an authenticated user.

OR, another approach would be to include these config files with the build and then do something like:

for h in `ls /home/*`; 
do cp <source-location-where?>/vimconfigs.tgz /home/$h && tar -xzf /home/$h/vimconfigs.tgz

Whether it's an rsa key, or the config files, the core of this request is: can I include an arbitrary file with the build? If so, might you have any pointers on how to do that?

Or better still, maybe point me to the block that does this already. I'd be happy to try to write my own block, but I have no idea as to how include an arbitrary file to the build. Any references on how to do that would be highly appreciated.

Description in newcronjob.json refers to changing the password

In pibakery-blocks/newcronjob/newcronjob.json in PiBakery 0.3.8 on Windows, the descriptive text refers to changing the user password:

"shortDescription":"Change the password for the default pi user",
"longDescription":"Raspbian comes with a user account already setup, with the username 'pi' and the password 'raspberry'. For the sake of security, you can choose to change your password to anything you want. If you don't change it now, you'll still be able to change it later."

Error-checking on newcronjob silently prevents valid configurations

I first found that pibakery-blocks/newcronjob/newcronjob.sh in PiBakery 0.3.8 on Windows gave "invalid cron timing" when I tried using 1,16,31,46 for the minutes.

So I changed to having 4 copies of newcronjob, but only the first one worked, and nothing happened with the 2nd, 3rd and 4th cron lines - only the first one was saved, according to crontab -l

According to this official Raspberry Pi page on cron, the order of the timing fields for cron is:

m h dom mon dow command

That order agrees with the comment at the start of pibakery-blocks/newcronjob/newcronjob.json

However, the error-checking in pibakery-blocks/newcronjob/newcronjob.sh appears to check in the opposite order, so only minutes in the range -1 to 8 are allowed, for example.

#check that the values for the timings are valid before inserting them into cron
if [ "$1" != "*" ] && ! [ "$1" -ge -1 -a "$1" -le 8 ]
then
  exit 1
fi

if [ "$2" != "*" ] && ! [ "$2" -ge 0 -a "$2" -le 13 ]
then
  exit 1
fi

if [ "$3" != "*" ] && ! [ "$3" -ge 0 -a "$3" -le 32 ]
then
  exit 1
fi

if [ "$4" != "*" ] && ! [ "$4" -ge 0 -a "$4" -le 24 ]
then
  exit 1
fi

if [ "$5" != "*" ] && ! [ "$5" -ge 0 -a "$5" -le 60 ]
then
  exit 1
fi

I confirmed this by changing the timings of my 4 cron commands in PiBakery to 1, 2, 3 and 4 minutes, and then all 4 were added successfully during installation.

  1. Could the error-checking be revised to apply the correct order?

  2. The error-checking on the values fails silently, instead of writing out error messages, so it took me a long time to work out what the problem was. If any of the error conditions triggers, it would be helpful to print a message so aid in tracking down the errors.

Simple Rotate Option for LCD Screens in “official" frames

The Official LCD screens for Raspberry Pi’s leave the display rotated 180 degrees when in the supplied cases. ( See https://support.thepihut.com/hc/en-us/articles/115002072865-Official-touchscreen-is-upside-down ).

It would be useful to have a block to handle this which would add the line
lcd_rotate=2
into /boot/config.txt
This rectifies screen and touch screen so that R Pi 3’s can go the usual LCD case and have the power cable at the top so they don’t topple over !

Suggestion

How about a "comment" block? So that we can create grouped commands, such as a "group" for installing and configuring CUPS. Call it something fun like a "preparation." Really just for organizing large setups

Suggestions

Some other nice "first boot" blocks might be some of the stuff that you typically use raspi-config to do just once, e.g. setting timezone, enabling camera, setting localisation, setting memory split, etc. etc.
You could look at https://github.com/RPi-Distro/rc_gui/blob/master/src/rc_gui.c to see how to 'drive' raspi-config using just command-line options.

Question about scope of this repo

So I currently have some commits here on a local fork which I wanted to invest some time in, but I want to know if merging would be on the table otherwise I'd just be wasting my time.

In short I'd go for a more modular approach where packages are loose blocks from the system-level blocks like updating, rebooting, networking etc:

  1. Have a folder packages/<package_name> which resides separate packages (just like a package repository like apt does) which you install from. For example: packages/glances/ would have the files necessary to install https://github.com/nicolargo/glances
  2. Makes for a better approach since installing a full lamp stack is not what everyone wants. Instead of installing apache, mysql, php etc. one might want to switch out apache for nginx but would then need an uninstall block and nginx install block.
  3. These package blocks could have a dependencies property which would check for dependencies installed on the fs and if they are not present abort the install. For example glances (mentioned above) needs python-dev installed from apt before glances can install from pip (and of course needs pip too). It would check is python-dev & pip are installed and abort if not present.
  4. Aborted installs can go to a log which user can visit on first/second boot to see failed installs.
  5. Instead of having a sidebar full of blocks in the UI of PiBakery itself users could pick between a system blocks menu or a package blocks menu, the latter would be searchable.

PiBakery can't be installed on this disk

Hi,

I'm getting this error while trying to install the new version of pibakery on Mac (I removed the old version).
Any idea why I can't install on that disk?

screen shot 2016-09-21 at 21 42 22

Ability to pipe STDOUT from one block to another?

Hi David - RJ here from Open Pipe Kit, we exchanged comments on Hacker News. I see from your Docs that we could add JSON files to the Open Pipe Kit CLIs in order for them to be configurable in PiBakery, but how about piping STDOUT from one block to another? Is that something that is currently possible in PiBakery? I'm also interested in running these block combinations at an interval so you can do something like "Every 60 seconds run the Raspberry Pi CPU temperature pull command and pipe the STDOUT to the Adafruit IO push command".

New block suggestion: install ssh public key

This would be a block under "Settings" where you paste in a public ssh key and it will add it to .ssh/authorized_keys, creating .ssh and authorized_keys with the necessary permissions, if necessary.

Allow installation of multiple packages

Can you remove the "'s around the package names by default? When I want to install a load of packages, I shouldn't have to put them all separately. I run into this error, which is happening because of the quotes:
E: Unable to locate package nginx php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip php7.0-mysql

Would love to see this changed as it cleans things up a lot.

image

Increase char limit to newcronjob input values

We should be able to input more digits in the newcronjob inputs

e.g a cron job executed every twenty minutes should be written as: */20 but atm the minutes field accepts only 1 character, and other fields accept only 2

Enable serial console

I often use a USB to serial cable to connect to the serial console on the Pi as described here:
http://elinux.org/RPi_Serial_Connection
This is helpful when there is an issue with network configs.

Right now the SD card I made with pibakery does not have the serial console enabled.
I enabled it in raspi-config, advanced, serial (which calls a function do_serial in /usr/bin/raspi-config). The change in my /boot/cmdline.txt file made by raspi-config are as follows:

Original /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

With the serial port enabled:
dwc_otg.lpm_enable=0 console=tty1 **console=serial0,115200** root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

It would be great to either have a block that enables the serial port, or have it enabled by default in the distribution

Pi-Bakery and Compute Module.

I am currently trying to get PI-Bakery to work with the compute module and the POE board, but I only get the rainbow screen out of HDMI.

I have edited the config.txt in the boot partition to force HDMI but that does not work. Is there something I might be missing, has anyone else gotten PI-Bakery to work with the Compute module 3+.

It does burn the EMMC just fine though which is nice, now if only I can get it to boot.

sethostname block not really complete

At least for the RPi3, the current "sethostname" block does not change the broadcasted hostname. With the current block, after changing the hostname, you must still connect via "ssh [email protected]". The sethostname.sh script should look like this:

#!/bin/bash

raspi-config nonint do_hostname "$1"
hostname -b "$1"
systemctl restart avahi-daemon

Then the broadcasted hostname is correct, no reboot needed.

My new block causes SD Write Failed

I've written two now blocks. The more complex of the two works fine. The simple one consistently causes "SD Write Failed, Error: Can't write PiBakery blocks. Please try writing to the SD card again. ...". I've tried re-installing PiBakery as indicated, no help. If I remove this block from the chain I get no problems. If I add this block, even by itself, I get the error.

The json:

{
  "name": "nodejs",
  "text": "Install NodeJS\\nversion: %1",
  "script": "node-install.sh",
  "args": [
    {
      "type": "menu",
      "options": ["4.x", "5.x", "6.x", "7.x", "8.x", "9.x"]
    }
  ],
  "network": true,
  "continue": true,
  "type": "software",
  "category":"software",
  "supportedOperatingSystems": [
    "raspbian-pibakery.img",
    "raspbian-lite-pibakery.img"
  ],
  "shortDescription":"Install NodeJS",
  "longDescription":"Install ytour favorite version of node."
}

The node-install.sh script:

#!/bin/bash

version="$1"

curl -sL https://deb.nodesource.com/setup_$version | sudo bash -
apt-get install nodejs -y

Is there a log file I can examine somewhere? I am on a Mac.

Wifi Country Codes need further documentation.

When setting up a wifi connection the parameter simply states "Country Code ISO 3166". However, as documented here there are multiple codes for that ISO standard. It would appear this is requiring the Alpha-2 code.

Feature request: VNC server with display-nr and geometry

The current VNC server block only starts VNC server. This is perfect if you have a HDMI monitor to use.

Though this is uncomfortable for headless pis, because you only get the minimum resolution of 600xsomething via VNC viewer. This resolution can't display e.g a complete terminal windows.

My suggestion is to use another block that provides something like this:
vncserver [:display] [-geometry widthxheight]

This way you can already define certain display ports and resolutions.

(If i have enough time, i will try this myself and provide it late on, if successful)

Unable to write

I'm getting the exact same error as seen in issue #9.

I'm on a mac and this has been working properly for thousands of years until today.

I'm writing to a 16GB card, so there should be plenty of room.

I've tried reinstalling PiBakery, but that doesn't help.

Wifi doesnt seem to work after update &dist-upgrade

Im using a Pi3 and on the first boot its running the wifi setup, "apt-get update" and "apt-get dist-upgrade" (and installs a few packages).
now while its downloading those packages i can scan for the pi3 with an ip scanner, but as soon as it reboots it doesnt work anymore. could it be because of the first two commands?

Remove .local from default hostname in "Set hostname" block

The current default hostname in this block is "raspberrypi.local" which suggests that the new name should retain the ".local" extension. Although it appears to work, I don't recommend this since the dot (.) is not actually a valid hostname character, even though raspberrypi.local is often how you will access your Pi using the magic of avahi.

This block runs:

raspi-config nonint do_hostname "$1"

which then writes the specified name into /etc/hosts and /etc/hostsname. An unmodified Pi does not have ".local" in these files, but running this command with the default name adds it to them. The reason this works at all is that /etc/init.d/hostname.sh sanitizes these files during the next boot startup, removing the ".local" extensions.

Documentation on creating a new release of blocks

Leaving this here because I would like to know if this is the best way to edit and test existing blocks

edit some blocks

prepare the folder

mkdir pibakery-blocks-new
cp -r pibakery-blocks pibakery-blocks-new
rm -rf pibakery-blocks-new/.git

edit the info.json

  • remove the compressed md5
  • update the url and version
vim pibakery-blocks-new/info.json

release the zip

zip -r pibakery-block.zip pibakery-blocks-new

go back and edit the source info.json

vim pibakery-blocks/info.json
  • add the new compressed md5
  • update the url and version

The circular dependency of zips and updates is a bit confusing, is there a good way to remove this?

hotspot question

Hi
I loved this tool. Do you think is possible in some way to script one time for all a block to create an hotspot with your rpi3?
In this way you can choose to expose a wifi from your rpi but scripting in a block is better than create it on your own

Exporting generates wrongly nested xml

An example from the Mac OS version:

<xml xmlns="http://www.w3.org/1999/xhtml"><block type="onfirstboot" id="onfirstboot" x="196" y="17"><next><block type="wifisetup" id="tdj{ab/qfO0U8OZk;;d3"><field name="1">network-name</field><field name="2">network-password</field><field name="3">WPA/WPA2</field><next><block type="downloadfile" id="kp6B#4)Jt!tnen6B@W/-"><field name="1">http://example.com/my-file</field><field name="2">/home/pi/new-name</field></block></next></block></next></block></xml>

But on the bright side, importing works anyway.

Feature request: WPA Enterprise

The wifi setup block supports WPA pre-shared key, but it wouldn't be hard to also support WPA Enterprise (username/password authentication).

The WPA_Supplicant network block would look like this:

network={
ssid="NETWORK_SSID"
scan_ssid=1
key-mgmt=WPA-EAP
identity="USERNAME"
password="PASSOWRD"
}

No way to disable updates for blocks?

When developing updates for blocks or new blocks, PiBakery overwrites the boot directory with blocks downloaded from this repo. This makes it hard to test. Whats the easiest way to test without having the scripts on the microsd get overwritten with the latest release here?

not able to write image -5

screen shot 2016-09-07 at 19 27 26

This might be a faulty sd card, but the text about reinstalling pibakery suggests it might be a pibakery issue?

Blocks for pi-zero USB OTG?

Are there plans to include any blocks to configure the Pi Zero OTG USB? This projects would be perfect to configure the Etherner or mass storage USB gadgets.

Enable camera block?

Can I suggest a block to enable the camera, which results eventually in:

start_x=1  
gpu_mem=128 

Being added to the boot config.

newcronjob block failing to create job correctly

I have been attempting to use the newcronjob block in my Pi builds. However it has not been creating the job correctly, if any of the first 5 fields are left as default then instead of passing the default (*) it passes the directory listing.

Example:
/boot/PiBakery/blocks/newcronjob/newcronjob.sh 0 0 "*" "*" "*" '/home/pi/bginfo Nemesis "NAS" 0' pi >>/boot/PiBakery/firstboot.log 2>&1 || true

su - pi -c (crontab -l ; echo 0 0 createjob.sh newcronjob.json newcronjob.sh createjob.sh newcronjob.json newcronjob.sh createjob.sh newcronjob.json newcronjob.sh /home/pi/bginfo Nemesis "NAS" 0) | crontab -

This looks to be because the command line is expanding the * out instead of passing the * in to the command.

Multiple Package install

Currently we can only install one package at a time since the script in pibakery-block is using only $1 from the command line. However, the command line apt-get allows us to install several in one command line. Would it be possible to implement it, it will save long list of package install blocks!
Anyway, thanks for this really nice app, very useful indeed!

updateupgrade not accessible

Hi David, I was writing a script to apt-get update and upgrade, when I saw that you actually have this in your source! It's not referenced in your info.json though, so end users don't have access to it yet.

Many interesting pull requests NOT merged

I was getting ready to contribute a couple of my own blocks, but I see pending pull requests that already implement what I re-implemented! NodeJS and Docker for example. What's the deal? Is this project maintained any more? I find it very useful. Or is there something better out there now I don't know about?

Even many of the committed blocks are not present in the PiBakery image (at least for the Mac).

Wi-Fi and Bluetooth radio's not reconised

I've not narrowed down specific cause or common events however I've set up several RPi's and often I will need to start from scratch because the Wi-Fi and Bluetooth radios are not recognised as being installed. This didn't occur before Pixel and it's happening on different RPi's. I have several of each type. If I find a common cause I'll update this, although it may have something to do with the setup WiFi ingredient.

However If I plug in a dongle, it works straight away. Ethernet doesn't appear affected.

Q: PR -- One per package or one big PR

I hope to be submitting about 10+ installer scripts for various tools. Do you prefer one branch and PR for each one or a single branch and PR for everything?

(Personally I would suggest the former)

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.