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

Debian Templates: fix / refactor 02_install_groups.sh #1112

Closed
adrelanos opened this Issue Aug 11, 2015 · 9 comments

Comments

Projects
None yet
3 participants
@adrelanos
Member

adrelanos commented Aug 11, 2015

There is,

I mostly care about jessie and further versions. I think rather than inventing template_debian/02_install_groups_stretch.sh, the whole template_debian/02_install_groups_jessie.sh can be abolished.

Let's go through all effective code of template_debian/02_install_groups_stretch.sh one by one and see what to do about it.


#### '--------------------------------------------------------------------------
info ' Adding contrib, non-free and Debian security to repository.'
#### '--------------------------------------------------------------------------
updateDebianSourceList
aptUpdate

Can be moved to the general 02_install_groups.sh, since required for any suite?


##### '=========================================================================
debug ' Replacing sysvinit with systemd'
##### '=========================================================================

#### '--------------------------------------------------------------------------
info ' Remove sysvinit'
#### '--------------------------------------------------------------------------
aptRemove sysvinit

#### '--------------------------------------------------------------------------
info ' Install Systemd'
#### '--------------------------------------------------------------------------
aptUpdate
aptInstall systemd-sysv

sysvinit does no longer get installed on jessie and upwards by default. Therefore no need to remove it. And since systemd gets installed by default, no need to install it. This is also confirmed by a build log, which is attached. [1] So it can be removed?


#### '--------------------------------------------------------------------------
info ' Set multu-user.target as the default target (runlevel 3)'
#### '--------------------------------------------------------------------------
chroot rm -f /etc/systemd/system/default.target
chroot ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Discussed in #1111 - maybe it can be removed (#1111 will tell) - or moved to the general 02_install_groups.sh?


From that perspective, that whole script can and should be abolished?


[1]

+ debug ' Replacing sysvinit with systemd'
+ output 'DEBUG: ' Replacing sysvinit with 'systemd'
+ '[' 1 -ge 1 ']'
+ [[ -z '' ]]
+ [[ ehB != ehxB ]]
+ info ' Remove sysvinit'
+ output 'INFO: ' Remove 'sysvinit'
+ '[' 1 -ge 1 ']'
+ [[ -z '' ]]
+ [[ ehB != ehxB ]]
+ aptRemove sysvinit
+ files=sysvinit
+ DEBIAN_FRONTEND=noninteractive
+ DEBIAN_PRIORITY=critical
+ DEBCONF_NOWARNINGS=yes
+ chroot eatmydata apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io --force-yes remove sysvinit
+ local retval
+ true ''
+ '[' '' == 1 ']'
+ /usr/sbin/chroot /home/user/qubes-builder/qubes-src/linux-template-builder/mnt eatmydata apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io --force-yes remove sysvinit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'sysvinit' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ retval=0
+ true
+ true ''
+ return 0
+ info ' Install Systemd'
+ output 'INFO: ' Install 'Systemd'
+ '[' 1 -ge 1 ']'
+ [[ -z '' ]]
+ [[ ehB != ehxB ]]
+ aptUpdate
+ debug 'Updating system'
+ output 'DEBUG: Updating' 'system'
+ '[' 1 -ge 1 ']'
+ [[ -z '' ]]
+ [[ ehB != ehxB ]]
+ DEBIAN_FRONTEND=noninteractive
+ DEBIAN_PRIORITY=critical
+ DEBCONF_NOWARNINGS=yes
+ chroot apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io update
+ local retval
+ true ''
+ '[' '' == 1 ']'
+ /usr/sbin/chroot /home/user/qubes-builder/qubes-src/linux-template-builder/mnt apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io update
Hit http://deb.torproject.org jessie InRelease
Hit http://security.debian.org jessie/updates InRelease                   
Hit http://deb.torproject.org jessie/main amd64 Packages                      
Hit http://security.debian.org jessie/updates/main amd64 Packages             
Hit http://security.debian.org jessie/updates/contrib amd64 Packages  
Hit http://ftp.us.debian.org jessie InRelease                                        
Hit http://security.debian.org jessie/updates/non-free amd64 Packages   
Ign http://deb.torproject.org jessie/main Translation-en                               
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/main Translation-en    
Hit http://security.debian.org jessie/updates/non-free Translation-en
Hit http://ftp.us.debian.org jessie/main amd64 Packages
Hit http://ftp.us.debian.org jessie/contrib amd64 Packages
Hit http://ftp.us.debian.org jessie/non-free amd64 Packages
Hit http://ftp.us.debian.org jessie/contrib Translation-en
Hit http://ftp.us.debian.org jessie/main Translation-en
Hit http://ftp.us.debian.org jessie/non-free Translation-en
Reading package lists... Done                  
+ retval=0
+ true
+ true ''
+ return 0
+ aptInstall systemd-sysv
+ files=systemd-sysv
+ DEBIAN_FRONTEND=noninteractive
+ DEBIAN_PRIORITY=critical
+ DEBCONF_NOWARNINGS=yes
+ chroot eatmydata apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io install systemd-sysv
+ local retval
+ true ''
+ '[' '' == 1 ']'
+ /usr/sbin/chroot /home/user/qubes-builder/qubes-src/linux-template-builder/mnt eatmydata apt-get -o Dpkg::Options::=--force-confnew --yes -o Acquire::Retries=3 -o Dpkg::Options::=--force-unsafe-io install systemd-sysv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
systemd-sysv is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ retval=0
+ true
@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Aug 11, 2015

stretch and jessie do not need a plugin script anymore; wheezy and some flavors of Ubuntu may.

  • KEEP: the general template_debian/02_install_groups.sh
  • KEEP: the specific template_debian/02_install_groups_wheezy.sh but remove multi-target lines
  • REMOVE: the specific template_debian/02_install_groups_jessie.sh
  • NOT NEEDED: specific template_debian/02_install_groups_stretch.sh (Seems like forgotten?)

The plugin scripts provide for additional rules as not to clutter the main scripts and allow other template flavors such as gnome or whonix

nrgaway commented Aug 11, 2015

stretch and jessie do not need a plugin script anymore; wheezy and some flavors of Ubuntu may.

  • KEEP: the general template_debian/02_install_groups.sh
  • KEEP: the specific template_debian/02_install_groups_wheezy.sh but remove multi-target lines
  • REMOVE: the specific template_debian/02_install_groups_jessie.sh
  • NOT NEEDED: specific template_debian/02_install_groups_stretch.sh (Seems like forgotten?)

The plugin scripts provide for additional rules as not to clutter the main scripts and allow other template flavors such as gnome or whonix

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Aug 11, 2015

Member

The plugin scripts provide for additional rules as not to clutter the main scripts and allow other template flavors such as gnome or whonix

Yes, generally speaking this looks like a nice feature.

KEEP: the general template_debian/02_install_groups.sh

Yes.

KEEP: the specific template_debian/02_install_groups_wheezy.sh but remove multi-target lines

I'd say let's keep it as is until wheezy gets finally deprecated. I personally wouldn't want to test and image after changing this.

REMOVE: the specific template_debian/02_install_groups_jessie.sh

Ok... But... What about...

  • updateDebianSourceList
  • aptUpdate

Those are no longer needed for some reason?

NOT NEEDED: specific template_debian/02_install_groups_stretch.sh (Seems like forgotten?)

Alright.

Member

adrelanos commented Aug 11, 2015

The plugin scripts provide for additional rules as not to clutter the main scripts and allow other template flavors such as gnome or whonix

Yes, generally speaking this looks like a nice feature.

KEEP: the general template_debian/02_install_groups.sh

Yes.

KEEP: the specific template_debian/02_install_groups_wheezy.sh but remove multi-target lines

I'd say let's keep it as is until wheezy gets finally deprecated. I personally wouldn't want to test and image after changing this.

REMOVE: the specific template_debian/02_install_groups_jessie.sh

Ok... But... What about...

  • updateDebianSourceList
  • aptUpdate

Those are no longer needed for some reason?

NOT NEEDED: specific template_debian/02_install_groups_stretch.sh (Seems like forgotten?)

Alright.

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Aug 11, 2015

Ya, you are right.

  • updateDebianSourceList
  • aptUpdate

Will be needed for both Jessie and Stretch. Anything version specific will
land in those files. Qubuntu also uses same base scripts as Debian
(sof-tlinked).

nrgaway commented Aug 11, 2015

Ya, you are right.

  • updateDebianSourceList
  • aptUpdate

Will be needed for both Jessie and Stretch. Anything version specific will
land in those files. Qubuntu also uses same base scripts as Debian
(sof-tlinked).

adrelanos added a commit to adrelanos/qubes-builder-debian that referenced this issue Aug 11, 2015

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Aug 11, 2015

Member

Commit attached above. (related) Please check out the specific template_debian/02_install_groups_jessie.sh at this revision.

There is no specific template_debian/02_install_groups_stretch.sh yet. For now, template_debian/02_install_groups_stretch.sh should have the very same contents as template_debian/02_install_groups_jessie.sh. Do you prefer a copy a softlink?

Member

adrelanos commented Aug 11, 2015

Commit attached above. (related) Please check out the specific template_debian/02_install_groups_jessie.sh at this revision.

There is no specific template_debian/02_install_groups_stretch.sh yet. For now, template_debian/02_install_groups_stretch.sh should have the very same contents as template_debian/02_install_groups_jessie.sh. Do you prefer a copy a softlink?

@nrgaway

This comment has been minimized.

Show comment
Hide comment
@nrgaway

nrgaway Aug 11, 2015

On 11 August 2015 at 09:40, Patrick Schleizer notifications@github.com
wrote:

Commit attached above. (related
#1111 (reference))
Please check out the specific template_debian/02_install_groups_jessie.sh
https://github.com/adrelanos/qubes-builder-debian/blob/beb83db0c9e867b038b92943f03f274029deb37e/template_debian/02_install_groups_jessie.sh
at this revision.

There is no specific template_debian/02_install_groups_stretch.sh yet. For
now, template_debian/02_install_groups_stretch.sh should have the very same
contents as template_debian/02_install_groups_jessie.sh
https://github.com/adrelanos/qubes-builder-debian/blob/beb83db0c9e867b038b92943f03f274029deb37e/template_debian/02_install_groups_jessie.sh.
Do you prefer a copy a softlink?

I would prefer a softlink

nrgaway commented Aug 11, 2015

On 11 August 2015 at 09:40, Patrick Schleizer notifications@github.com
wrote:

Commit attached above. (related
#1111 (reference))
Please check out the specific template_debian/02_install_groups_jessie.sh
https://github.com/adrelanos/qubes-builder-debian/blob/beb83db0c9e867b038b92943f03f274029deb37e/template_debian/02_install_groups_jessie.sh
at this revision.

There is no specific template_debian/02_install_groups_stretch.sh yet. For
now, template_debian/02_install_groups_stretch.sh should have the very same
contents as template_debian/02_install_groups_jessie.sh
https://github.com/adrelanos/qubes-builder-debian/blob/beb83db0c9e867b038b92943f03f274029deb37e/template_debian/02_install_groups_jessie.sh.
Do you prefer a copy a softlink?

I would prefer a softlink

adrelanos added a commit to adrelanos/qubes-builder-debian that referenced this issue Aug 11, 2015

added 02_install_groups_stretch.sh, which is a softlink to 02_install…
…_groups_jessie.sh since those are currently sharing the very same code

(thanks to @nrgaway for help with this)
fixes 'Debian Templates: fix / refactor 02_install_groups.sh' - QubesOS/qubes-issues#1112
@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Aug 11, 2015

Member

Ok, softlink added in above commit.

Member

adrelanos commented Aug 11, 2015

Ok, softlink added in above commit.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Sep 1, 2015

Member

@adrelanos Should I merge your builder-debian? Or you planning to make PR when its ready?

Member

marmarek commented Sep 1, 2015

@adrelanos Should I merge your builder-debian? Or you planning to make PR when its ready?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Sep 1, 2015

Member

Yes. Whenever you are ready. I just postponed any new merge requests before other pull requests are merged. Also to prevent overloading you when you come back from holiday. Perhaps I was overthinking it. You can merge them as-is (preferred by me) or squash (also great; if you care about small git history, I don't know that yet).

Member

adrelanos commented Sep 1, 2015

Yes. Whenever you are ready. I just postponed any new merge requests before other pull requests are merged. Also to prevent overloading you when you come back from holiday. Perhaps I was overthinking it. You can merge them as-is (preferred by me) or squash (also great; if you care about small git history, I don't know that yet).

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Sep 6, 2015

Member

The following pull request also solves this ticket:
marmarek/qubes-builder-debian#20

Member

adrelanos commented Sep 6, 2015

The following pull request also solves this ticket:
marmarek/qubes-builder-debian#20

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Oct 7, 2015

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Oct 7, 2015

added 02_install_groups_stretch.sh, which is a softlink to 02_install…
…_groups_jessie.sh since those are currently sharing the very same code

(thanks to @nrgaway for help with this)
fixes 'Debian Templates: fix / refactor 02_install_groups.sh' - QubesOS/qubes-issues#1112

@marmarek marmarek closed this Oct 8, 2015

@marmarek marmarek added this to the Release 3.1 milestone Oct 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment