Comments (15)
Hey @StefanScherer, thanks a lot for the quick response. Let's work together and fix this 😄 .
I'll just like to point out that, even if we manage to solve this problem, the main issue I see here is the obscurity/lack of consistency of the docs. If the docs were clearer, I might have ended with the same problem, but I sure wouldn't have to try a hundred combinations of factors and play the guessing game. And I think my original post helps to point out several of these inconsistencies.
One of the nasty things about cloud-init is that this yaml file must contain a first line containing
I'd take a step back here.
As somebody who doesn't know about cloud-init
(just found out that it existed 2 days ago), this is one of the most obscure parts of all of this. Which file are we even referring to? userdata
or metadata
? What the difference between each of them? What should I put in which one of them? All of this is very implicit, especially in cloud-init doc (which does not include comprehensive documentation of both files, what are all the valid configurations, etc).
No one of these menus actually explains what it is. The first menu "User-Data Formats" talks a lot about file formats, shows some Python code, I and can't see the relationship between all of that and the yaml
file we are talking about here.
The second menu "Cloud config examples" seems better, it does look like the yaml
we are talking about (I still don't see the relationship of this with the User-Data Formats). And then it follows with a long list of examples that should supposedly just work, and only benefit people who already know what that actually does.
I'll not dive into the "metadata" part, whose documentation is even more obscure and confusing. But my point remains.
Let's talk about the issue in hand now.
#cloud-config
So, unfortunately, that was not my problem. I removed the comments in my examples shown in the original post, but in most of them (not all) I've actually copied examples from:
- https://blog.hypriot.com/faq/#wifi
- https://github.com/hypriot/flash/blob/master/sample/wifi-user-data.yml
in which they all have the #cloud-config
comment.
To be 100% sure, I have just tested it again:
- Raspberry Pi 2 Model B (so, no onboard wifi, but using a wifi stick). Still not sure whether this makes any difference (see my main post for all the confusion about needing an extra step for devices with onboard wifi)
- this exact configuration for
--userdata
(except for the password):#cloud-config # Set your hostname here, the manage_etc_hosts will update the hosts file entries as well hostname: black-pearl manage_etc_hosts: true # You could modify this for your own user information users: - name: pirate gecos: "Hypriot Pirate" sudo: ALL=(ALL) NOPASSWD:ALL shell: /bin/bash groups: users,docker,video plain_text_passwd: hypriot lock_passwd: false ssh_pwauth: true chpasswd: { expire: false } package_upgrade: false # # WiFi connect to HotSpot # # - use `wpa_passphrase SSID PASSWORD` to encrypt the psk write_files: - content: | allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp path: /etc/network/interfaces.d/wlan0 - content: | country=BR ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="TP-Link_11FE_5G" psk="--------" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP auth_alg=OPEN } path: /etc/wpa_supplicant/wpa_supplicant.conf # These commands will be ran once on first boot only runcmd: # Pickup the hostname changes - 'systemctl restart avahi-daemon' # Activate WiFi interface - 'ifup wlan0'
Some pictures of what I've got (note that these 3 pictures are from the Raspberry Pi 2 Model B, while in my original post they were all about the Raspberry Pi Zero, I don't have any pictures of the initial tests with the Pi 2 to compare).
Then I've retested the same configuration with the Pi Zero, and my results were the same as in the original post (including the pictures).
Update: I've tested on Pi Zero both with and without the --bootconf
with the enable_uart=0
config (just to remember that the documentation about that is one of the questions I raise in my original post).
@YasserAntonio has a really good point. I've had several problems with several applications after upgrading OS X to Catalina.
from flash.
@rafaeleyng I feel you
Was just about to run into the same problems... half a year later. Docs as inconsistent as ever.
What you describe matches so much to what I experienced that I start to believe that that's the destiny of the silent majority of first-time users.
Well, and opening PRs... You would have to have at least some moments of success to feel motivated enough.
from flash.
Hey @rafaeleyng Thank you very much for your detailed repot. Oh you really tried hard and the time you put into getting it work and writing this feedback is extraordinary.
I haven't read all scenarios yet as I want to give you some quick tips that might help. But be assured I'll read all and reply with more comments later.
So, the basic tests worked fine, but as soon as you created an own coud-init.yaml it started to fail.
One of the nasty things about cloud-init is that this yaml file must contain a first line containing
#cloud-config
Thanks to your feedback I realise that this should be made more visible in our docs.
If that line is missing, cloud-init does not recognise this file and then, of course, none of the configurations are applied and won't work.
Maybe this little piece is the only thing that unblocks you.
from flash.
Here is a link to the cloud-init FAQ https://cloudinit.readthedocs.io/en/latest/topics/faq.html#how-can-i-debug-my-user-data
Two of the most common issues with user data, that also happens to be cloud-config is:
- Incorrectly formatted YAML
- First line does not contain #cloud-config
It's hard to add a yaml check into flash
bash script, but at least we could check if the first line has the comment.
from flash.
I just found out that on macOS we already validate the YAML file. So the missing comment makes it to the top 1 problem. I've opened #178 to add a check for the comment in the first line of the user-data file.
from flash.
Hello, I upgraded my mac to Catalina and updated flash to it last version and I have the exacte same problem described in this issue with my rasp 3 and 4, even with the #cloud-config comment. Before everything was working well since I used the cloud-init config and flash several time before without any issue to report.
from flash.
Might be related: balena-io/etcher#2997
Note: I've also tried to run the flash
script with sudo
, getting the same results.
More information about notarization:
- https://www.npmjs.com/package/electron-notarize
- https://stackoverflow.com/questions/58596874/how-to-notarize-an-executable-shell-script-command-file-for-macos-10-15-catal
- https://forums.developer.apple.com/thread/127709 (discusses whether shell scripts need to be notarized. The answer seems to be "no")
from flash.
I just finished trying to set up the Raspberry Pi 2 Model B again, but with the Vagrant setup, in a Linux VM. I was able to write the image to the card and added --userdata
with the same configuration than I used in #177 (comment). I got the same results for all the commands.
from flash.
@rafaeleyng Thanks for your detailed report. Things evolved over time and the FAQ and docs got adapted from different persons as well. With that said sorry for the inconsistency.
For clarification of your hostname - fourth way section
This works white_check_mark. And by that, I mean: this did set the hostname (I'm not mentioning wifi so far).
I don't understand why. It seems that I've only added user information and wifi configuration, and that somehow makes the hostname work. I just give up investigating the
hostname
at this point.
When you add a cloud-init.yaml
file without a user block like:
# You could modify this for your own user information
users:
- name: pirate
gecos: "Hypriot Pirate"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video
plain_text_passwd: hypriot
lock_passwd: false
ssh_pwauth: true
chpasswd: { expire: false }
... then no user gets created so you cannot login.
That's why we added a default cloud-init userdata file if no specific userdata file is provided.
I have also struggled with the cloud-init docs in the beginning but if they are insufficient we should maybe open an issue or even better a PR there?
from flash.
Hey @firecyberice. I've ended up giving up on Hypriot some time after this issue was created. Since I wasn't able to make things work, I'm not comfortable in making a PR (I don't understand the problem and the solution, so I can't fix it).
from flash.
Hello guys just an easy workaround: When flashing dont set cloud-init.yml with the user-data param with flash. Just use flash to copy the Hypriot image on the sd card. After flashing remount the sd card and simply copy past your cloud-init.yml and rename it "user-data" (must be named this way, without extension) at the root of the sd card and it will work at boot.
from flash.
I did the following steps to change the hostname after run Hypriot 1.12.3 for the first time and it worked for me!
-
Change the hostname value in /boot/user-data.
-
Type the following commands:
- sudo cloud-init clean
- sudo cloud-init clean --logs
- sudo cloud-init clean --reboot
After this the hostname should have changed.
from flash.
I made wifi work! read this https://kerneldriver.wordpress.com/2012/10/21/configuring-wpa2-using-wpa_supplicant-on-the-raspberry-pi/
from flash.
I made wifi work! read this https://kerneldriver.wordpress.com/2012/10/21/configuring-wpa2-using-wpa_supplicant-on-the-raspberry-pi/
From what I can read of this github issue, and the resultant conversation, nothing has changed, and the wifi part is only 1 very small part of the whole issue.
I too have NOT been able to change the username or the whole thing breaks again, and I have reflashed, and tried many different methods to get the default user to be something else.
ANY CHANGES that I make to the initial user-config break all ability to login, even though I have not removed or added ANY spaces whatsoever.
from flash.
I did the following steps to change the hostname after run Hypriot 1.12.3 for the first time and it worked for me!
Change the hostname value in /boot/user-data.
Type the following commands:
- sudo cloud-init clean
- sudo cloud-init clean --logs
- sudo cloud-init clean --reboot
After this the hostname should have changed.
I have three pi's running Hypriotos, and am testing this RIGHT now.
Boot process is taking a bit longer.
Well, it did not undo my naming schema, however, I will have to re-reflash them again to know. For now, I will do it on the master only.
Can confirm that this whole issue, and the documentation still suck.
from flash.
Related Issues (20)
- WSL support? HOT 2
- unable to pull docker images on first boot HOT 3
- HyperiotOS very unstable with Raspberry Pi 4 HOT 3
- Prevent mistaking inherited environment variables as arguments
- Flash error: hdiutil: couldn't unmount "disk2" - Resource busy HOT 4
- how can i install a package by means of a user-data file HOT 1
- maintain a homebrew package for flash HOT 10
- MacOS dd: invalid number: ‘1m’ HOT 2
- Does the WiFi example really (still) work? HOT 7
- Request: Verify Flash?
- static.yml does not work for Version 1.12.3
- Segfault while dd HOT 1
- flash does not work if gnu sed is installed
- Change DHCP to static IP after first boot HOT 1
- Several issues on Big Sur (MacOS 11.1)
- dd uses cache so pv does not add much value.. HOT 2
- MacOS: flash not able to copy custom userdata (Read-only file system error)
- Nothing happens on macos Big sur HOT 4
- Is this repo still being maintained? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flash.