You are not logged in.

#1 2017-07-04 11:35:16

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

[NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

Installation: Stretch installed using HoaS's debootsrap+chroot method, followed by the helium-dev netinstall script.

I don't know if this is intentional, but installing bunsen-images-extra has updated grub. The consequence is that manually added boot parameters for booting other partitions have been overwritten.

damo@helium:~$ sudo apt-get install bunsen-images-extra
[sudo] password for damo: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  bunsen-images-extra
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 90.2 MB of archives.
After this operation, 107 MB of additional disk space will be used.
Get:1 https://kelaino.bunsenlabs.org/~johnraff/debian helium/main amd64 bunsen-images-extra all 9.0-2 [90.2 MB]
Fetched 90.2 MB in 14s (6,014 kB/s)                                                
Selecting previously unselected package bunsen-images-extra.
(Reading database ... 127844 files and directories currently installed.)
Preparing to unpack .../bunsen-images-extra_9.0-2_all.deb ...
Unpacking bunsen-images-extra (9.0-2) ...
Setting up bunsen-images-extra (9.0-2) ...
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-3-amd64
Found initrd image: /boot/initrd.img-4.9.0-3-amd64
Found Linux Mint 18 Sarah (18) on /dev/sda2
Found Debian GNU/Linux 9 (stretch) on /dev/sda5
Found Debian GNU/Linux 9 (stretch) on /dev/sda7
done

Last edited by damo (2017-07-04 19:25:37)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#2 2017-07-04 14:45:30

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

Can you boot that Linux Mint Sarah partition from GRUB, and did you have any ISO images setup to boot from the GRUB menu?


Real Men Use Linux

Offline

#3 2017-07-04 14:55:55

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

The problem is with the /dev/sda5 and /dev/sda7 Stretch partitions. I can boot them by manually adding the required boot parameters, or by adding them to the updated grub.cfg. I just wasn't expecting it after the package install!

Mint isn't a problem because it deals OK with my optimus graphics. I should have chmod -x'd /usr/bin/os-prober!


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2017-07-04 15:00:52

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

damo wrote:

The problem is with the /dev/sda5 and /dev/sda7 Stretch partitions. I can boot them by manually adding the required boot parameters, or by adding them to the updated grub.cfg. I just wasn't expecting it after the package install!

Mint isn't a problem because it deals OK with my optimus graphics. I should have chmod -x'd /usr/bin/os-prober!

I agree there should been a sort of "script was modified by user" prompt by apt/dpkg and give you a list of options which one option that says something like "Keep existing file". If you had custom options you should have been offered that option to keep your existing grub config.


Real Men Use Linux

Offline

#5 2017-07-04 15:27:36

earlybird
ほやほや
Registered: 2015-12-16
Posts: 738
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

bunsen-images-extra is well-behaved and does nothing unusual with grub https://github.com/BunsenLabs/bunsen-im … a.postinst.

Changes to grub including custom boot entries MUST be entered in /etc/grub.d/4[01]_* (simplest way is probably to  copy from grub.cfg and then just paste & modify there).

Offline

#6 2017-07-04 15:51:04

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

earlybird wrote:

bunsen-images-extra is well-behaved and does nothing unusual with grub https://github.com/BunsenLabs/bunsen-im … a.postinst.

Changes to grub including custom boot entries MUST be entered in /etc/grub.d/4[01]_* (simplest way is probably to  copy from grub.cfg and then just paste & modify there).

On my system there's /etc/grub.d/40_custom and 41_custom where the custom boot entries and boot parameters are placed. I don't think updates to grub touch those files (other than initial install or reinstall)


Real Men Use Linux

Offline

#7 2017-07-04 16:16:10

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

earlybird wrote:

bunsen-images-extra is well-behaved and does nothing unusual with grub https://github.com/BunsenLabs/bunsen-im … a.postinst.

Changes to grub including custom boot entries MUST be entered in /etc/grub.d/4[01]_* (simplest way is probably to  copy from grub.cfg and then just paste & modify there).

Is this what is triggering it in the postinst?

update-alternatives --install "$GRUB_ALT_LINK" desktop-grub "$i" 25

If this is the expected behaviour I will add "[NOTABUG]" to the thread title wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#8 2017-07-04 17:26:21

unklar
Member
Registered: 2015-10-31
Posts: 1,094

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^ The change of theme/image of Grub2 has always been with one

update-grub

connected. Otherwise it would not be visible.

So if the manually inserted parameters "changed", then they stood simply in the wrong file.  big_smile

Offline

#9 2017-07-04 17:38:15

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

unklar wrote:

...
So if the manually inserted parameters "changed", then they stood simply in the wrong file.  big_smile

I know, but it was a shortcut which I have now done in the proper manner wink

I was still suprised though, by an update-grub I wasn't anticipating sad


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#10 2017-07-04 18:02:07

unklar
Member
Registered: 2015-10-31
Posts: 1,094

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

damo wrote:

I was still suprised though, by an update-grub I wasn't anticipating sad

Such surprises I could so far "bypass"  devil

When it is time (I guess in 10 years) my wife is happy, because I then  the computer "give off"  glasses

Offline

#11 2017-07-04 19:01:00

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

The bunsen-images-extra package has this section in it's postinst file:

    if which update-grub > /dev/null ; then
        sync
        update-grub || true
    fi

I would recommend uninstalling os-prober entirely; the "foreign" GRUB entries can be added to /etc/grub.d/40_custom, as already mentioned.

Be sure to point to /vmlinuz & /initrd.img (in your Mint and Debian systems) rather than the numbered images in /boot — the symlinks in the root directory will always be to the current kernel version and this removes the need to update the GRUB configuration when the kernel is upgraded in Mint or Debian.

Something like this should do the trick:

menuentry 'Mint' {
    set root=(hd0,2)
    linux /vmlinuz root=/dev/sda2 ro # add kernel parameters here
    initrd /initrd.img
}

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#12 2017-07-04 19:06:01

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

If you also have Windows on your system you can add its GRUB entry(s) to /etc/grub.d/40_custom as well.


Real Men Use Linux

Offline

#13 2017-07-04 19:24:50

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

Head_on_a_Stick wrote:

The bunsen-images-extra package has this section in it's postinst file:

    if which update-grub > /dev/null ; then
        sync
        update-grub || true
    fi

I would recommend uninstalling os-prober entirely; the "foreign" GRUB entries can be added to /etc/grub.d/40_custom, as already mentioned.

I have already put the menuentries in 40_custom (as recommended ops ), but I have removed the exec bit from 30_os-prober. That was always the intention, but I hadn't got round to it!

Be sure to point to /vmlinuz & /initrd.img (in your Mint and Debian systems) rather than the numbered images in /boot — the symlinks in the root directory will always be to the current kernel version and this removes the need to update the GRUB configuration when the kernel is upgraded in Mint or Debian.

Something like this should do the trick:

menuentry 'Mint' {
    set root=(hd0,2)
    linux /vmlinuz root=/dev/sda2 ro # add kernel parameters here
    initrd /initrd.img
}

Good point.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#14 2017-07-04 20:51:15

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 817

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

Not a bug but err, a feature devil


Real Men Use Linux

Offline

#15 2017-07-05 00:09:40

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,567
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

DeepDayze wrote:

Not a bug but err, a feature

Yes.
bunsen-images-extra installs some alternative images which can be used as grub background, chosen via Debian alternatives. It's quite normal to do an update-grub when something has changed there - surely you'll see that happen at least when installing an upgraded kernel?

HoaS wrote:

I would recommend uninstalling os-prober entirely

Why? Does it sometimes fail to detect every available system on the disk, or make errors? (It's always worked well for me.)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Online

#16 2017-07-05 06:03:23

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

johnraff wrote:
HoaS wrote:

I would recommend uninstalling os-prober entirely

Why?

Because the OP wants to add different kernel parameters to each menu entry and this is only possible with /etc/grub.d/40_custom — if that file is used for all of the menu entries then all os-prober will do is create duplicate menu entries with incorrect kernel command line parameters.

To be clear: I am not advocating that all users should remove os-prober, I just think that it is serving no purpose in this particular setup.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#17 2017-07-05 06:32:08

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,567
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^ah... understood. cool


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Online

#18 2017-07-05 10:28:17

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

chmod -x on '30_os-prober' does the trick, without having to remove it.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#19 2017-07-05 13:22:28

unklar
Member
Registered: 2015-10-31
Posts: 1,094

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^
My system looks e.s. so out

fdisk -l

Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0009fef1

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  31541247  31539200    15G 83 Linux
/dev/sda2        31541248 488396799 456855552 217,9G  5 Extended
/dev/sda5        31543296  62222335  30679040  14,6G 82 Linux swap / Solaris
/dev/sda6        62224384 269068287 206843904  98,6G  b W95 FAT32
/dev/sda7       269070336 290017279  20946944    10G 83 Linux
/dev/sda8       384696320 419389439  34693120  16,6G 83 Linux
/dev/sda9  *    419391488 440379391  20987904    10G 83 Linux
/dev/sda10      440381440 488396799  48015360  22,9G 83 Linux
/dev/sda11      290019328 384694271  94674944  45,1G 83 Linux

Partition table entries are not in disk order.
Disk /dev/sdb: 232,9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1d371d36

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1              63 352562560 352562498 168,1G  7 HPFS/NTFS/exFAT
/dev/sdb2       352571373 488397167 135825795  64,8G  5 Extended
/dev/sdb5  *    352571392 383782911  31211520  14,9G 83 Linux
/dev/sdb6       383784960 488396799 104611840  49,9G  b W95 FAT32

2017-07-03-09-22-19_scrot.th.png
Main Bootloader is the grub of bunsenlab. Only here os-prober is active.
An update-grub takes about 3 minutes, 15 seconds.
Since I have two times siduction in the employment and here very often the kernel is changed, is the stressful.

Testwise I have my 40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Chainload Mageia 6 (auf /dev/sda8)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos8'
	linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=aeac8153-a888-4389-b866-b1c72247c28a splash quiet noiswmd resume=UUID=045398f2-dfbc-4cc5-99c5-dca098051969 vga=788
	initrd /boot/initrd.img
}
menuentry 'Chainload Paint It Black - lxde (2016.1" ) (auf /dev/sda10)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos10'
	configfile /boot/grub/grub.cfg
}
menuentry 'Chainload 2017.1.0 patience (kde) (auf /dev/sda11)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos11'
	configfile /boot/grub/grub.cfg
}	
menuentry 'Chainload ROSA (lxqt) (auf /dev/sda7)' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos7'
	configfile /boot/grub2/grub.cfg
}
	

in

cp /etc/grub.d/40_custom /etc/grub.d/09_my_linux

copied and renamed. So my entries in the Grub selection menu are above and the 3Min15Sec are no longer interesting.  wink

Offline

#20 2017-07-05 18:53:30

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

@unklar: you can move the insmod commands to before the menuentry stanzas to avoid having to call them in every entry, like this:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
insmod part_msdos
insmod ext2
menuentry 'Chainload Mageia 6 (auf /dev/sda8)' {
	set root='hd0,msdos8'
	linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=aeac8153-a888-4389-b866-b1c72247c28a splash quiet noiswmd resume=UUID=045398f2-dfbc-4cc5-99c5-dca098051969 vga=788
	initrd /boot/initrd.img
}
menuentry 'Chainload Paint It Black - lxde (2016.1" ) (auf /dev/sda10)' {
	set root='hd0,msdos10'
	configfile /boot/grub/grub.cfg
}
menuentry 'Chainload 2017.1.0 patience (kde) (auf /dev/sda11)' {
	set root='hd0,msdos11'
	configfile /boot/grub/grub.cfg
}	
menuentry 'Chainload ROSA (lxqt) (auf /dev/sda7)' {
	set root='hd0,msdos7'
	configfile /boot/grub2/grub.cfg
}

Also, I don't think you actaully need to call insmod at all (GRUB is pretty good at loading the modules automatically), have you tried leaving them out?

damo wrote:

chmod -x on '30_os-prober' does the trick, without having to remove it.

...until the package is updated  wink


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#21 2017-07-06 07:53:31

unklar
Member
Registered: 2015-10-31
Posts: 1,094

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^^ HoaS, you're right. The insmod entries are not more necessary. All systems start properly with the Bunsen-labs grub. Thanks for that.  smile

HoaS wrote:
damo wrote:

chmod -x on '30_os-prober' does the trick, without having to remove it.

...until the package is updated wink

I can not confirm.
I've been working with the -x for over a year. The os-prober package has been updated several times.  wink

Last edited by unklar (2017-07-06 07:54:56)

Offline

#22 2017-07-06 11:59:33

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^ I reinstalled grub2 and os-prober, and it didn't re-enable the exec bit.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#23 2017-07-06 19:50:16

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

OK, I am slightly surprised but also clearly wrong. Sorry about that.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#24 2017-07-07 01:18:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,567
Website

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

dpkg respects files under /etc (or any file marked as a conffile) as being the province of the sysadmin, and never undoes sysadmin edits without permission. (It uses (md5?) digest sums to keep track.)

My understanding, after package upgrade, three cases:

1) Package wants to change file, sysadmin has not edited file: package change is implemented.

2) Package does not change file, sysadmin has edited it: sysadmin edit remains.

3) Package wants to change file, sysadmin has edited it: dpkg puts up a dialogue asking what sysadmin wants to do.

This is why reinstalling a package is not enough to get /etc/* files back to the default state - you have to purge, or otherwise make sure no conffiles remain on the system.

Also, this is only for conffiles - files under /usr/share or wherever are just overwritten in an upgrade.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Online

#25 2017-07-07 01:38:33

damo
....moderator....
Registered: 2015-08-20
Posts: 5,837

Re: [NOTaBUG]helium-dev: bunsen-images-extra overwrites grub.cfg

^ Useful info, thanks smile


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB