Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not delete NOOBS video settings after installation #1

Open
knghtbrd opened this issue Nov 1, 2015 · 5 comments
Open

Should not delete NOOBS video settings after installation #1

knghtbrd opened this issue Nov 1, 2015 · 5 comments
Labels

Comments

@knghtbrd
Copy link
Member

knghtbrd commented Nov 1, 2015

Raspple II installs a modification to /etc/rc.local which deletes video settings lines added to /boo
t/config.txt by NOOBS. NOOBS attempts to provide you with the most appropriate video settings for y
our system, whatever those might be. It'd be appropriate to remove these during packaging of Rasppl
e II, but once the system is installed, we should not touch config.txt without user interaction. Pa
rticularly we shouldn't randomly delete the last nine lines of the user's configuration file if we f
ind the word "NOOBS" somewhere in the file.

@knghtbrd knghtbrd added the bug label Nov 1, 2015
@IvanExpert
Copy link

I disagree (though I'll concede that more discriminating behavior could be applied). Under this proposal, the video settings for Raspbian would always force HDMI even if the user is using composite video. Therefore, someone hooked up to a composite display would not be able to see Raspbian without first connecting via SSH and hand-editing config.txt. That's bad. Raspbian should automatically use composite video if HDMI is not being used, and that's what NOOBS-less Raspbian does. And because NOOBS-installed Raspple II forces HDMI by adding lines to config.txt at install time, it's not possible to prevent that from happening at packaging time. Raspbian has to remove the lines from config.txt at boot time -- at least during first boot.

What NOOBS is doing is wrong behavior for Raspple II users with composite displays, and I would not characterize it as it's described here. NOOBS does not attempt to provide you with the most appropriate video settings for your system; rather, it assumes that what's good for NOOBS is what's good for Raspbian, and therefore forces Raspbian to use the same video settings that NOOBS is using at install time. Usually, that's not a problem if it's a typical user-interactive install; it's assumed that if the user can see NOOBS, then that's the display the user should see under Raspbian. (It's still a problem if the user changes displays at some point, which is why I dislike this behavior in NOOBS; I don't think it should be forcing outputs without the user explicitly being involved.)

However, because the Raspple II install is automated (not user-interactive), Raspbian is forced to use HDMI always, since that's the NOOBS default. Users with composite displays won't see the installation itself, but once it is complete, and Raspbian removes the lines from config.txt that force HDMI and reboots, they'll see Raspbian on their composite displays. If that behavior is removed, they'll never see Raspbian.

If you think that what's going into rc.local is too invasive, then I'd propose that what Raspple II puts into rc.local identifies that it's first boot after installation (perhaps we could include a file like /usr/local/etc/firstboot), rather than grepping for NOOBS in config.txt. If found, it keeps the same behavior of removing the nine lines from the end. If it's the first boot, those nine lines will have been added by NOOBS, not the user. It could then remove the firstboot file, and even remove itself from rc.local, and then reboot. It will be like NOOBS-less Raspbian then, and if the user chooses to tweak config.txt after that, there's no risk of it being touched.

But I can't endorse simply doing nothing once the system is installed, thereby making it unusable for people with composite video. The behavior is in there for a reason.

@knghtbrd
Copy link
Member Author

knghtbrd commented Nov 2, 2015

I'd argue that if NOOBS is always forcing HDMI on installed systems
even if it does not detect HDMI, then NOOBS has a significant bug.
I'm not 100% sure that I have a cable that will work for the Pi 2's
TRRS jack, but I'll investigate whether or not the latest versions
still force HDMI even if you have only composite.
I don't yet have a proposed solution for this problem. Removing
NOOBS' settings at first boot seems like it may be an ideal solution
if we can't stop NOOBS from writing bogus video settings, but the
real fix would be to address NOOBS writing settings you can't use.

I do think it's appropriate to suggest that if a person is using HDMI
at install time, they intend to continue using HDMI. However it
seems you're suggesting that NOOBS writes HDMI settings regardless of
what you're using at installation time. That's not acceptable
either, I agree.

Joseph

On Sun, Nov 01, 2015 at 03:18:16PM -0800, IvanExpert wrote:

I disagree (though I'll concede that more discriminating behavior could be applied). Under this proposal, the video settings for Raspbian would always force HDMI even if the user is using composite video. Therefore, someone hooked up to a composite display would not be able to use Raspbian without first connecting via SSH and hand-editing config.txt. That's bad. Raspbian should automatically use composite video if HDMI is not being used, and that's what NOOBS-less Raspbian does. And because NOOBS-installed Raspple II forces HDMI by adding lines to config.txt at install time, it's not possible to prevent that from happening at packaging time. Raspbian has to remove the lines from config.txt at boot time -- at least during first boot.

What NOOBS is doing is wrong behavior for Raspple II users with composite displays, and I would not characterize it as it's described here. NOOBS does not attempt to provide you with the most appropriate video settings for your system; rather, it assumes that what's good for NOOBS is what's good for Raspbian, and therefore forces Raspbian to use the same video settings that NOOBS is using at install time. Usually, that's not a problem if it's a typical user-interactive install; it's assumed that if the user can see NOOBS, then that's the display the user should see under Raspbian.

However, because the Raspple II install is automated (not user-interactive), Raspbian is forced to use HDMI always, since that's the NOOBS default. Users with composite displays won't see the installation itself, but once it is complete, and Raspbian removes the lines from config.txt that force HDMI and reboots, they'll see Raspbian on their composite displays. If that behavior is removed, they'll never see Raspbian.

If you think that what's going into rc.local is too invasive, then I'd propose that what Raspple II puts into rc.local identifies that it's first boot after installation (perhaps we could include a file like /usr/local/etc/firstboot), rather than grepping for NOOBS in config.txt. If found, it keeps the same behavior of removing the nine lines from the end. If it's the first boot, those nine lines will have been added by NOOBS, not the user. It could then remove the firstboot file, and even remove itself from rc.local, and then reboot. It will be like NOOBS-less Raspbian then, and if the user chooses to tweak config.txt after that, there's no risk of it being touched.

But I can't endorse simply doing nothing once the system is installed, thereby making it unusable for people with composite video. The behavior is in there for a reason.


Reply to this email directly or view it on GitHub:
#1 (comment)

@IvanExpert
Copy link

Not exactly, but close. Unlike NOOBS-less Raspbian, which falls back on composite if HDMI is unavailble, NOOBS doesn't detect HDMI at all. For a user with composite video booting stock NOOBS for the first time, what happens is that the user sees no video, and has to blindly press "4" to get NOOBS to switch to composite. This is documented here, https://github.com/raspberrypi/noobs, though no longer clearly on the main Raspberry Pi downloads page, as I'm guessing composite is being treated as an edge case at this point. (And see a related bug about this: raspberrypi/noobs#130)

Once the user sees NOOBS on composite, if they then install Raspbian, NOOBS will add the lines to config.txt that will force composite video, rather than HDMI. (I still don't think it should be forcing anything.)

However, Raspple II (unlike stock NOOBS) adds the "silentinstall" directive to NOOBS, so that it starts installing immediately, without user interaction, so a user needing composite video wouldn't get the chance to tell NOOBS to use compsite. While that's suboptimal, this arrangement a) makes it that much simpler for the user to get going with Raspple II by requiring no interaction, and b) facilitates headless installation, which is a specific (in fact, the original) use case for Raspple II. However, it results in forced HDMI, since that's what was enabled at install time. Hence the need to remove the forcing from Raspbian.

If you want any NOOBS behavior changes, I'd file a bug or enhancement request in NOOBS; they're reasonably responsive. Having "silentinstall" result in a forced HDMI probably qualifies as a bug; the correct behavior is to probably not write to config.txt when using silentinstall. The best behavior would be to have it figure out it's supposed to be on composite in the first place before install even starts. I can submit this if you like. Of course, if you want to track down and change the NOOBS behavior yourself, you can build your own.

I don't know how many Raspple II users are actually using composite video, but there are probably some, e.g. Apple II Pi users who are using their Apple II monitors for GSport.

@knghtbrd
Copy link
Member Author

knghtbrd commented Nov 2, 2015

Makes sense. Or actually it doesn't, I consider this NOOBS behavior broken. But it's not our bug. We'll try to figure out something more or less "better" for what to do when editing out NOOBS' noobiness in config.txt. Mostly the issue there is that multi-line matches in sed are annoying. It's almost easier to write an ex script or awk program. At least awk or even a larger scripting language for legibility

Nobody uses ed anymore. Ed is the standard editor. When you need to edit a text file, you don't need a viitor or an emacsitor. You need an editor. ;)

Joseph
Sent via mobile

On Nov 1, 2015, at 20:34, IvanExpert notifications@github.com wrote:

Not exactly, but close. Unlike Raspbian, NOOBS doesn't fall back on composite if HDMI is unavailable. For a user with composite video booting standard NOOBS for the first time, what happens is that the user sees no video, and has to blindly press "4" to get NOOBS to switch to composite. This is documented here, https://github.com/raspberrypi/noobs, though no longer clearly on the main Raspberry Pi downloads page, as I'm guessing composite is being treated as an edge case at this point. (And see a related bug about this: raspberrypi/noobs#130)

Once the user sees NOOBS on composite, if they then install Raspbian, NOOBS will add the lines to config.txt that will force composite video, rather than HDMI. (I still don't think it should be forcing anything.)

However, Raspple II adds the "silentinstall" directive to NOOBS, so that it starts installing immediately, without user interaction, so a user with composite wouldn't get the chance to tell NOOBS to use it. While that's suboptimal, this arrangement a) makes it that much simpler for the user to get going with Raspple II, and b) facilitates headless installation, which is a specific (in fact, the original) use case for Raspple II. However, it results in forced HDMI, since that's what was enabled at install time. Hence the need to remove it from Raspbian.

If you want any NOOBS behavior changes, I'd file a bug or enhancement request in NOOBS; they're reasonably responsive. Having "silentinstall" result in a forced HDMI probably qualifies as a bug; the correct behavior is to probably not write to config.txt when using silentinstall. The best behavior would be to have it figure out it's supposed to be on composite in the first place before install even starts. I can submit this if you like.

I don't know how many Raspple II users are actually using composite video, but there are probably some, e.g. Apple II Pi users who are using their Apple II monitors for GSport.


Reply to this email directly or view it on GitHub.

@IvanExpert
Copy link

Multi-line matching in sed ain't so bad once you know how. It can be done as follows:

sed ':a;N;$!ba;s/searchText/replaceText/'

With this, searchText can contain \n. Example, from https://github.com/RasppleII/a2server/blob/master/scripts/a2server-3-sharing.txt#L117

sed ':a;N;$!ba;s/case FILPBIT_ATTR :\n *change_mdate = 1;\n/case FILPBIT_ATTR :\n/g' etc/afpd/file.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants