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

check for availability of openrc #64

Closed
oberon-manjaro opened this issue Feb 26, 2017 · 31 comments
Closed

check for availability of openrc #64

oberon-manjaro opened this issue Feb 26, 2017 · 31 comments

Comments

@oberon-manjaro
Copy link
Collaborator

I think we should check if a given profile supports openrc or not. We can still adjust most of the missing ones, but certain like for example Deepin do not play well, others are not ready.
How about we check if at least one >openrc flag is present in the profile and if not we disable the choice?

@oberon-manjaro
Copy link
Collaborator Author

Or in fact we'd need to check which base install is present and then inhibit the choice of certain profiles.

@oberon-manjaro
Copy link
Collaborator Author

maybe some kind of an evaluate_profiles function at the beginning of install_manjaro_de_wm()

@Chrysostomus
Copy link
Owner

Should we check for ">openrc" flags to see if profile is viable?

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

in install_manjaro_de_wm()

cat $PROFILES/shared/Packages-Root "$target_desktop" > /tmp/.edition
        if [[ -e /tmp/.openrc ]]; then
            [[ ! $(grep ">openrc" /tmp/.edition) ]] && DIALOG ... ...
            # Remove any packages tagged with >systemd and remove >openrc tags

Where it says "DIALOG ... ..." we could offer a choice to either return to profile selection or back to base install to change the init sys

@oberon-manjaro
Copy link
Collaborator Author

The only situation where it would be wrong would be an openrc-only profile that would carry no >openrc flags - but we don't have such currently and it is pretty unlikely, too ;)

@Chrysostomus
Copy link
Owner

I think it's best if we just filter the profile selection based on the base.

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

if [[ ! $(grep ">openrc" /tmp/.edition) ]]; then
    DIALOG "no openrc version" --menu "This profile is currently not available for openrc\nPlease adjust your selection:" 0 0 2 \
      "1" "Select different profile" \
      "2" "Install systemd base" 2>${ANSWER}
    case $(cat ${ANSWER}) in
        "1") install_desktop_menu
            ;;
        "2") install_base
            ;;
    esac
fi

@oberon-manjaro
Copy link
Collaborator Author

Is filtering the profiles first easier to accomplish?
The advantage of the just proposed would be that the user sees that a profile is available if they use systemd base.

@oberon-manjaro
Copy link
Collaborator Author

Otherwise those profiles just disappear.

@Chrysostomus
Copy link
Owner

Good point. Could we also tag openrc capable profiles with '*' or something? That way users would not need to blindly test different options to see which ones are working.

Also, I think the menu should read "install systemd base" instead of "install openrc bsse".

Another distantly related point: would it be a good idea to place the openrc check file in /mnt/.openrc instead of /tmp/.openrc?

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

  1. do we have a way to check the profiles before the package list gets copied? If so we could just include that information in the init sys dialog
  2. of course, my bad ;) - edited the post.
  3. don't know. why you mean?

@oberon-manjaro
Copy link
Collaborator Author

  1. we don't. The only way is at profile selection of course ;)

@oberon-manjaro
Copy link
Collaborator Author

so we'd need to evaluate all profiles first and then find a way to deliver the information at profile selection.

@oberon-manjaro
Copy link
Collaborator Author

Also, maybe at that point an option to go back to re-install base with systemd would make sense ... ?

@oberon-manjaro
Copy link
Collaborator Author

btw. since the architect profile is now also included in iso-profiles repo we will have to exclude it from installable profiles! 😆

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

echo $PROFILES/{manjaro,community}/* | xargs -n1 | cut -f2 -d'/' | grep -vE "netinstall|architect" | awk '$0=$0" - off"'

btw: why is there cut -f7 at the moment ??

@Chrysostomus
Copy link
Owner

Cuts away the directory path to only print the profile names instead of the full paths.

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

Sure thing. But I mean, why is it 7 and not 2 ??

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

when I run the command locally in my iso-profiles dir I need -f2. when I use -f7 it returns an empty list:

[bernhard@oberon iso-profiles]$ echo {manjaro,community}/* | xargs -n1 | cut -f7 -d/ | grep -vE "netinstall|architect" | awk '$0=$0" - off"'
 - off
 - off
 - off
 - off
 - off
 - off
 - off
 - off
 - off
 - off
 - off
 - off

@oberon-manjaro
Copy link
Collaborator Author

while using -f2:

[bernhard@oberon iso-profiles]$ echo {manjaro,community}/* | xargs -n1 | cut -f2 -d/ | grep -vE "netinstall|architect" | awk '$0=$0" - off"'
gnome - off
kde - off
lxqt - off
xfce - off
bspwm - off
budgie - off
cinnamon - off
deepin - off
i3 - off
mate - off

@Chrysostomus
Copy link
Owner

The git profiles are with -f2. The package profiles are deeper in directory path and need -f7. Are you sure you aren't mixing the two?

@oberon-manjaro
Copy link
Collaborator Author

I am ;) sorry.

@oberon-manjaro
Copy link
Collaborator Author

no actually, I only assumed $PROFILE to be the last layer. That was the mistake...

@Chrysostomus
Copy link
Owner

3.If you install openrc base, reboot and remount your system, installing any profile fails because system does not recognize that the base is openrc and filters packages as if it was systemd

@oberon-manjaro
Copy link
Collaborator Author

excluded architect profile: 3814fb7

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

good point about using /mnt/.openrc ! 👍
I guess we should do the same for .base_installed

@oberon-manjaro
Copy link
Collaborator Author

# return list of profiles not containing >openrc flag in Packages-Desktop
evaluate_profiles() {
  echo "" > /tmp/.systemd_only
  for p in $(find $PROFILES/{manjaro,community} -mindepth 1 -maxdepth 1 -type d ! -name 'netinstall' ! -name 'architect'); do
    [[ ! $(grep ">openrc" $p/Packages-Desktop) ]] && echo $p | cut -f7 -d'/' >> /tmp/.systemd_only
  done
  echo $(cat /tmp/.systemd_only)
}

@oberon-manjaro
Copy link
Collaborator Author

$ evaluate_profiles
bspwm deepin cinnamon i3

@oberon-manjaro
Copy link
Collaborator Author

oberon-manjaro commented Feb 26, 2017

We can then simply use a text tring like this in the profile selection dialog:

These profiles are currently available for systemd base only:\n\n$(evaluate_profiles)

oberon-manjaro pushed a commit that referenced this issue Feb 26, 2017
@oberon-manjaro
Copy link
Collaborator Author

976bb58
eb930c8

@oberon-manjaro
Copy link
Collaborator Author

I'll update manjaro-architect-dev / manjaro-architect-dev-launcher packages for testing in vbox and such ...

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

No branches or pull requests

2 participants