Page MenuHomePhabricator

cleanup / deprecate anon-shared-build-fix-grub package
Closed, ResolvedPublic

Description

Likely the following code block can be removed, because likely the grub issue was fixed in jessie:

If so, creation of the whole backup folder /var/lib/anon-dist/grub-backup would also be unnecessary.

If that is so, the only remaining action rm --force "/boot/grub/device.map" could perhaps be moved to whonix-initializer and so the anon-shared-build-fix-grub package could be deprecated.

Whonix 11.0.0.2.3 /boot/grub/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
else
  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Whonix GNU/Linux' --class whonix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-26ada0c0-1165-4098-884d-aafd2220c2c6' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_msdos
	insmod ext2
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
	else
	  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
	fi
	echo	'Loading Linux 3.16.0-4-686-pae ...'
	linux	/boot/vmlinuz-3.16.0-4-686-pae root=UUID=26ada0c0-1165-4098-884d-aafd2220c2c6 ro  apparmor=1 security=apparmor quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-3.16.0-4-686-pae
}
submenu 'Advanced options for Whonix GNU/Linux' $menuentry_id_option 'gnulinux-advanced-26ada0c0-1165-4098-884d-aafd2220c2c6' {
	menuentry 'Whonix GNU/Linux, with Linux 3.16.0-4-686-pae' --class whonix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-686-pae-advanced-26ada0c0-1165-4098-884d-aafd2220c2c6' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
		else
		  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
		fi
		echo	'Loading Linux 3.16.0-4-686-pae ...'
		linux	/boot/vmlinuz-3.16.0-4-686-pae root=UUID=26ada0c0-1165-4098-884d-aafd2220c2c6 ro  apparmor=1 security=apparmor quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-3.16.0-4-686-pae
	}
	menuentry 'Whonix GNU/Linux, with Linux 3.16.0-4-686-pae (recovery mode)' --class whonix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-686-pae-recovery-26ada0c0-1165-4098-884d-aafd2220c2c6' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
		else
		  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
		fi
		echo	'Loading Linux 3.16.0-4-686-pae ...'
		linux	/boot/vmlinuz-3.16.0-4-686-pae root=UUID=26ada0c0-1165-4098-884d-aafd2220c2c6 ro single  apparmor=1 security=apparmor
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-3.16.0-4-686-pae
	}
	menuentry 'Whonix GNU/Linux, with Linux 3.16.0-4-586' --class whonix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-586-advanced-26ada0c0-1165-4098-884d-aafd2220c2c6' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
		else
		  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
		fi
		echo	'Loading Linux 3.16.0-4-586 ...'
		linux	/boot/vmlinuz-3.16.0-4-586 root=UUID=26ada0c0-1165-4098-884d-aafd2220c2c6 ro  apparmor=1 security=apparmor quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-3.16.0-4-586
	}
	menuentry 'Whonix GNU/Linux, with Linux 3.16.0-4-586 (recovery mode)' --class whonix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.16.0-4-586-recovery-26ada0c0-1165-4098-884d-aafd2220c2c6' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  26ada0c0-1165-4098-884d-aafd2220c2c6
		else
		  search --no-floppy --fs-uuid --set=root 26ada0c0-1165-4098-884d-aafd2220c2c6
		fi
		echo	'Loading Linux 3.16.0-4-586 ...'
		linux	/boot/vmlinuz-3.16.0-4-586 root=UUID=26ada0c0-1165-4098-884d-aafd2220c2c6 ro single  apparmor=1 security=apparmor
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-3.16.0-4-586
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

TODO:

  • Test build without these code blocks.
  • See generated /boot/grub/grub.cfg.
  • Compare with above /boot/grub/grub.cfg.
  • If it matches, clean this up.

Details

Impact
Normal

Event Timeline

Patrick raised the priority of this task from to Normal.
Patrick updated the task description. (Show Details)
Patrick set Impact to Normal.
Patrick added subscribers: Patrick, HulaHoop.

clean up /boot/grub/device.map because the anon-shared-build-fix-grub package can be deprecated - https://phabricator.whonix.org/T340:
https://github.com/Whonix/whonix-initializer/commit/c7c5cddc595d41079d54752a1c3f1949298d592b

deactivated most code, testing to deprecate anon-shared-build-fix-grub package - https://phabricator.whonix.org/T340:
https://github.com/Whonix/anon-shared-build-fix-grub/commit/3ce9b90b02f25d4cf7ea0733eb9228dc668b144b

Patrick changed the task status from Open to Review.Jul 29 2015, 3:52 PM

Checking this again when the next test release has been created.

Patrick claimed this task.
deprecated anon-shared-build-fix-grub - no longer required

https://phabricator.whonix.org/T340

https://github.com/Whonix/Whonix/commit/c2b0e56e322ed55656513a65ba9281cf6e1cb520