#801961 base-installer: needs to install queued packages before linux-image

#801961#5
Date:
2015-10-16 11:09:53 UTC
From:
To:
I couldn't boot my install so this bug report is by template from docs
and from a different system:

Boot method: usb (iso image)
Image version:
http://cdimage.debian.org/cdimage/stretch_di_alpha3/amd64/iso-cd/debian-stretch-DI-alpha3-amd64-netinst.iso
also
http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso
(2015-10-12)

Machine: Asus Eee PC 1001P
Processor: atom
Memory: 2GB
Partitions: gpt - bios_grub + several primary.  dual boot with already
functioning debian os (stretch dist-upgraded from jessie).
Other os on same disk uses xfs on / and no problems.

Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it

Initial boot:           [o ]
Detect network card:    [o ]
Configure network:      [o ]
Detect CD:              [ o]
Load installer modules: [o ]
Detect hard drives:     [o ]
Partition hard drives:  [o ]
Install base system:    [o ]
Clock/timezone setup:   [o ]
User/password setup:    [ o]
Install tasks:          [o ]
Install boot loader:    [o ]
Overall install:        [ e]

Comments/Problems:

I chose the largest available freespace and allocated 10GB for / ,
2GB for swap, about 90GB for /home and chose xfs for my root
and /home file systems.  I used the debian installer to partition the
free space and create the file systems.

The system apparently installed perfectly but on booting grub
errored with an error:

"error: not a correct xfs inode"

I chrooted in from systemrescue cd and checked disk UUIDs.  All good.
Ran 'update-initramfs -u -k all', and got message showing that no xfs
utilities were installed.  The installer needs xfsprogs and dependency
libreadline5 (or to fetch them).  Currently install using xfs on / is
_guaranteed_ fail.

#801961#10
Date:
2015-10-16 12:33:46 UTC
From:
To:
Hello!

Julian Hughes wrote on 2015-10-16 12:09:
...

I always use xfs for my partitions. And in the past I never could
boot with grub2 with an xfs partition on "/". And that is the reason
for me to always use LiLO as bootloader.

I know about some patches for grub2 to work together with xfs, but
it seems that grub2 don't have all these needed patches.
--- Have a nice day. Joachim (Germany)
#801961#15
Date:
2015-10-16 14:40:07 UTC
From:
To:
<snip>

Hi Julian,

If possible, it would be very helpful to see the installer logs from
that system. The current stretch netinst images include both the
xfsprogs .deb and .udeb, and I've just checked that partman-xfs is
marking xfsprogs for installation (it is). Something has broken, and
logs may help us track it down.

Cheers,

Steve

#801961#20
Date:
2015-10-17 17:03:20 UTC
From:
To:
clone 801961 -1
reassign -1 grub-pc
retitle -1 grub-pc: can't boot off newer xfs filesystems: "not a correct xfs inode"
severity -1 important
reassign 801961 base-installer
retitle 801961 base-installer: needs to install queued packages before linux-image
severity 801961 important
thanks

[ Julian, please keep bug addresses in CC - it helps if all the
  information is available to everybody. ]

Hi Julian, KiBi!

OK...
correct xfs inode"), then that's apparently caused by a "new" (3yo)
feature in XFS that's not supported in grub2. A quick google search
for that error turns up several hits:

https://bugzilla.redhat.com/show_bug.cgi?id=1001279
http://lists.opensuse.org/opensuse-factory/2014-06/msg00179.html
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1103187
https://groups.google.com/forum/#!topic/voidlinux/8hE0cEV38dU

If you want to use XFS as your root filesystem, I'd suggest for now
that you use another filesystem on a small separate /boot partition.

I've cloned this bug report and move the new bug over to the grub-pc
package now, to help us track it. Until that's fixed, it's probably
worth us adding a check in d-i and recommending the use of a /boot
partition with XFS for now. KiBi: what do you think about that?
first installation, I can see

Oct 16 21:37:38 apt-install: Queueing package xfsprogs for later installation
...
Oct 16 21:41:25 in-target: Setting up linux-base (4.0) ...
Oct 16 21:41:25 in-target: Setting up linux-image-4.2.0-1-amd64 (4.2.1-2) ...
Oct 16 21:41:27 in-target: update-initramfs: Generating /boot/initrd.img-4.2.0-1-amd64
Oct 16 21:41:32 in-target: Warning: /sbin/fsck.xfs doesn't exist, can't install to initramfs, ignoring.
Oct 16 21:41:46 in-target: Setting up linux-image-amd64 (4.2+68) ...
...
Oct 16 21:41:58 in-target: Preparing to unpack .../xfsprogs_4.2.0_amd64.deb ...
Oct 16 21:41:58 in-target: Unpacking xfsprogs (4.2.0) ...
Oct 16 21:41:58 in-target: Setting up libreadline5:amd64 (5.2+dfsg-3)...
Oct 16 21:41:59 in-target: Setting up xfsprogs (4.2.0) ...

which means there's an ordering problem here - update-initramfs is
being run before we've had a chance to install xfsprogs and so it's
failing there. It looks like we need to explicitly add some sequencing
for the package installations here to fix that. If we just made sure
xfsprogs was installed first, that would help!

For now, there should a simple workaround here - re-run the package
installation step for linux-image-* and it'll get xfsprogs on the
second pass.

<snip - ext4 works>

ACK - I've just seen that mentioned in another bug log elsewhere today
(#802025 - a stupid systemd mis-feature to hang hard here,
sigh). Currently grub-installer (at the very least) faithfully updates
/etc/mtab during d-i, and I guess we should also change that
too. Maybe just simply rm /target/etc/mtab as part of d-i
finalisation. KiBi?

#801961#25
Date:
2015-10-16 23:03:34 UTC
From:
To:
On Fri, 16 Oct 2015 15:40:07 +0100 Steve McIntyre <steve@einval.com> wrote:

....

OK I started over.  As before, start point is a disk with gpt and
already existing and fully functional Debian Stretch (upgraded from
Jessie) with bios_grub, / and /home on xfs and a swap partition and a
little over 100GB free space. Output of parted -l:

Model: ATA ST9160301AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name              Flags
 2      1049kB  2097kB  1049kB
bios_grub
 1      2097kB  10.7GB  10.7GB  xfs             Linux filesystem
 5      10.7GB  53.7GB  42.9GB  xfs             Linux filesystem
 3      158GB   160GB   2146MB  linux-swap(v1)  Linux swap


Then used weekly netinstaller of 2015-10-12 (md5sum checked and good)
to install standard debian system (no desktop, no print server) using
debian installer in non-graphical non-expert mode to create in
freespace:

10GB / xfs
2GB swap
remainder /home xfs

Opted to install grub to /dev/sda.  No error messages.

Install apparently succeeds but fails on reboot with grub error.

Then used systemrescue to chroot and copy /var/log/installer to
external media.

Output of parted -l after new install:

Model: ATA ST9160301AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name              Flags
 2      1049kB  2097kB  1049kB
bios_grub
 1      2097kB  10.7GB  10.7GB  xfs             Linux filesystem
 5      10.7GB  53.7GB  42.9GB  xfs             Linux filesystem
 4      53.7GB  63.7GB  10.0GB  ext4
 6      63.7GB  65.7GB  2000MB  linux-swap(v1)
 7      65.7GB  158GB   92.2GB  ext4
 3      158GB   160GB   2146MB  linux-swap(v1)  Linux swap

Then used parted to wipe the newly created partitions and restore
freespace.  Then used same netinstaller to perform install identical in
every respect except choosing ext4 for / and /home.  Boots to grub menu
which offers me both the new install and the original pre-existing
Debian OS.

Booting to new install fails with message:

"systemd[1]: /etc/mtab is not a symlink or not pointing
to /proc/self/mounts.  This is not supported anymore.  Please
replace /etc/mtab with a symlink to /proc/self/mounts.
systemd[1]: Freezing execution." (timestamps omitted)

So I boot my original OS, chroot into new OS, rm /etc/mtab, reboot and
all is well.  I finally _can_ boot my new stretch install on
ext4.....but I want xfs....sniff, cry.

(Booting to the original pre-existing Debian from the newer grub menu
was 100% OK).

Output of parted -l after newest install is identical to above.

I'm attaching from each new install
the /var/log/installer/{syslog,status}.  First attachments are the xfs
ones, followed by ext4 install.

I retain all of /var/log/installer in each case if you want anything
else.  Currently I have retained the ext4 install on disk and am happy
to wipe it and do the xfs install again if this would help.

regards,

Julian

#801961#38
Date:
2015-10-17 18:44:13 UTC
From:
To:
...........

Sorry I forgot to cc, habitual low brain power + late night
tinkering.... my bad.

Thanks very much for all you guys' analysis.  Looking forward to
enjoying the fixes.

#801961#43
Date:
2015-10-17 18:34:46 UTC
From:
To:
Hi,

Steve McIntyre <steve@einval.com> (2015-10-17):

I have only very limited (mental) bandwidth for that right now but from
a quick look, that doesn't look like a bad idea.

TBH I have no idea what d-i is doing at the moment; I thought we have
/etc/mtab a symlink to /proc/mounts, at least in installed systems? This
seems to be the case here on multiple systems at least:

lrwxrwxrwx 1 root root 12 Aug 12 20:41 /etc/mtab -> /proc/mounts

I realize this doesn't immediately answer your question, just
mentioning…

Mraw,
KiBi.

#801961#48
Date:
2015-10-17 20:20:41 UTC
From:
To:
OK, I'll look into that.

The evidence suggests otherwise, including the discussion at
https://github.com/systemd/systemd/issues/1495#issuecomment-148744470
and in the log for #802025. It seems that this is *new* stupid
behaviour in systemd; previously an extra script in the Debian setup
would fix things up later after boot, but now it doesn't get that
far. A simple test with today's daily netinst confirms - I see the
same problem.

I've just checked in a quick-hack fix in finish-install for now.

#801961#53
Date:
2015-10-17 21:44:06 UTC
From:
To:
Steve McIntyre <steve@einval.com> (2015-10-17):


I haven't checked the history behind /proc/self/mounts and /proc/mounts,
nor whether they're supposed to be equivalent (I see a symlink from the
latter to the former, so hopefully); but assuming pointing directly to
the former, feel free to upload with high urgency so that the package
hits testing in a timely fashion.

I have no clear plans for the next d-i release as far as timing goes,
but having fixes in testing soon would be nice.

Mraw,
KiBi.

#801961#58
Date:
2015-10-18 11:23:45 UTC
From:
To:
Hi again,

Cyril Brulebois <kibi@debian.org> (2015-10-17):

I've started handling duplicate bug reports, and uploaded the package.
Additionally urgented, should reach testing through the 1000Z run. I don't
suppose it makes sense to schedule an image build right after that since
there's one happening tomorrow already? (Except if it's quick enough
that it would make a difference for people grabbing an image during the
next n hours?)

(No d-i upload should be needed since this package isn't pulled during
its build AFAICS.)

Mraw,
KiBi.

#801961#63
Date:
2015-10-31 02:30:28 UTC
From:
To:
Following up on this particular thread...

Following through on this, I can see that the ordering is determined
right at the end of base-installer/debian/bootstrap-base.postinst :

waypoint 1      check_target
waypoint 1      get_mirror_info
waypoint 100    install_base_system
waypoint 1      pre_install_hooks
waypoint 1      setup_dev
waypoint 1      configure_apt_preferences
waypoint 1      configure_apt
waypoint 3      apt_update
waypoint 5      post_install_hooks
waypoint 1      pick_kernel
waypoint 20     install_kernel
waypoint 10     install_extra
waypoint 0      final_apt_preferences
waypoint 0      cleanup

install_kernel and install_extra are the two functions in question. It
*seems* like simply changing the order of those two calls may fix this
bug, and I've just done a successful (simple!) test installation with
that change made. However, this is also a key part of the installer
and I'm worried that changing this may break installation of other
packages, e.g. if there are any that queue things via apt-install but
need the kernel to be installed first. Checking through current d-i, I
can see lots of callers to apt-install:

./arcboot-installer/debian/arcboot-installer.postinst:#if ! apt-install arcboot; then
./arcboot-installer/debian/arcboot-installer.postinst:apt-install arcboot
./babelbox/preseed_early:apt-install alsa-base || true
./babelbox/preseed_early:apt-install alsa-utils || true
./base-installer/library.sh:                    log-output -t base-installer apt-install $OPTS $PKG || \
./base-installer/library.sh:            if ! log-output -t base-installer apt-install "$rd_generator"; then
./base-installer/library.sh:            if ! log-output -t base-installer apt-install busybox; then
./base-installer/library.sh:            log-output -t base-installer apt-install "$package" || true
./base-installer/library.sh:    # avoid apt-install installing things; apt is not configured yet
./base-installer/library.sh:    log-output -t base-installer apt-install "$KERNEL" || kernel_install_failed=$?
./base-installer/library.sh:    log-output -t base-installer apt-install "$KERNEL" || kernel_install_failed=$?
./base-installer/library.sh:    log-output -t base-installer apt-install "$KERNEL" || kernel_install_failed=$?
./console-setup/debian/console-setup-udeb.base-installer:    apt-install console-setup || true
./console-setup/debian/console-setup-udeb.base-installer:    apt-install keyboard-configuration || true
./elilo-installer/debian/elilo-installer.postinst:if ! apt-install elilo ; then
./flash-kernel/debian/flash-kernel-installer.postinst.in:       if ! apt-install "$package"; then
./flash-kernel/debian/flash-kernel-installer.postinst.in:       if ! apt-install "$package"; then
./flash-kernel/debian/flash-kernel-installer.postinst.in:if ! apt-install flash-kernel; then
./grub-installer/debian/grub-installer/usr/bin/grub-installer:          apt-install $grub_package || exit_code=$?
./grub-installer/debian/grub-installer/usr/bin/grub-installer:          apt-install dmsetup
./grub-installer/debian/grub-installer/usr/bin/grub-installer:          apt-install grub-common
./grub-installer/debian/grub-installer/usr/bin/grub-installer:  apt-install $grub_package || exit_code=$?
./grub-installer/debian/grub-installer/usr/bin/grub-installer:  if apt-install --no-recommends grub-legacy ; then
./grub-installer/grub-installer:                apt-install $grub_package || exit_code=$?
./grub-installer/grub-installer:                apt-install dmsetup
./grub-installer/grub-installer:                apt-install grub-common
./grub-installer/grub-installer:        apt-install $grub_package || exit_code=$?
./grub-installer/grub-installer:        if apt-install --no-recommends grub-legacy ; then
./hw-detect/hw-detect.post-base-installer.d/60install-mouseemu:                 apt-install mouseemu || true
./hw-detect/hw-detect.post-base-installer.d/60install-mouseemu:                 apt-install mouseemu || true
./hw-detect/hw-detect.post-base-installer.d/60install-mouseemu:         if apt-install laptop-detect && \
./hw-detect/hw-detect.pre-pkgsel.d/20install-hwpackages:apt-install discover || true
./hw-detect/hw-detect.sh:                       apt-install libc6-sparcv9b || true
./hw-detect/hw-detect.sh:               apt-install libc6-i686 || true
./hw-detect/hw-detect.sh:       apt-install eject || true
./hw-detect/hw-detect.sh:       apt-install pbbuttonsd || true
./hw-detect/hw-detect.sh:       apt-install pciutils || true
./hw-detect/hw-detect.sh:       apt-install pcmciautils || true
./hw-detect/hw-detect.sh:       apt-install usbutils || true
./hw-detect/hw-detect.sh:apt-install udev || true
./installation-report/pre-pkgsel.d/50save-logs:apt-install --no-recommends installation-report || true
./kbd-chooser/post-base-installer.d/20kbd-chooser:      apt-install console-setup kbd || true ;;
./kbd-chooser/post-base-installer.d/20kbd-chooser:      apt-install keyboard-configuration || true ;;
./kickseed/handlers/auth.sh:            apt-install nis || true
./lilo-installer/debian/lilo-installer/DEBIAN/postinst:if ! apt-install lilo ; then
./lilo-installer/debian/postinst:if ! apt-install lilo ; then
./localechooser/finish-install.d/05localechooser:               apt-install libfribidi0 || true
./localechooser/post-base-installer.d/05localechooser:  apt-install locales || true
./lvmcfg/lvmcfg.sh:[ $1 -gt 0 ] && apt-install lvm2
./mdcfg/mdcfg.sh:apt-install mdadm
./netcfg/autoconfig.c:                  di_exec_shell_log("apt-install rdnssd");
./netcfg/netcfg-static.c:                di_exec_shell("apt-install iw wireless-tools");
./netcfg/netcfg.c:                di_exec_shell_log("apt-install iw wireless-tools");
./netcfg/netcfg.c:                di_exec_shell_log("apt-install wpasupplicant");
./network-console/debian/network-console.postinst:apt-install openssh-server || true
./nobootloader/debian/postinst:                 if apt-install mkvmlinuz; then
./partman-auto-raid/auto-raidcfg:apt-install mdadm || true
./partman-base/debian/partman-base/usr/lib/post-base-installer.d/60dmraid:              apt-install dmraid
./partman-base/post-base-installer.d/60dmraid:          apt-install dmraid
./partman-basicfilesystems/finish.d/aptinstall_basicfilesystems:        apt-install dosfstools || true
./partman-basicfilesystems/finish.d/aptinstall_basicfilesystems:        apt-install e2fsprogs || true
./partman-btrfs/finish.d/aptinstall_btrfs:      apt-install btrfs-tools || true
./partman-crypto/debian/partman-crypto/lib/partman/finish.d/70crypto_aptinstall:                apt-install cryptsetup || true
./partman-crypto/finish.d/crypto_aptinstall:            apt-install cryptsetup || true
./partman-ext3/finish.d/aptinstall_ext3:        apt-install e2fsprogs || true
./partman-iscsi/finish.d/iscsi_settings:        apt-install open-iscsi || true
./partman-jfs/finish.d/aptinstall_jfs:  apt-install jfsutils || true
./partman-lvm/debian/partman-lvm/lib/partman/finish.d/70aptinstall_lvm:         apt-install lvm2 || true
./partman-lvm/finish.d/aptinstall_lvm:          apt-install lvm2 || true
./partman-md/post-base-installer.d/60partman-md:        apt-install mdadm
./partman-multipath/post-base-installer.d/60multipath:apt-install multipath-tools-boot || true
./partman-nbd/finish.d/partman-nbd:     apt-install nbd-client || true
./partman-ufs/finish.d/aptinstall_ufs:  apt-install ufsutils || true
./partman-xfs/finish.d/aptinstall_xfs:  apt-install xfsprogs || true
./partman-zfs/finish.d/aptinstall_zfs:  apt-install zfsutils || true
./partman-zfs/post-base-installer.d/60partman-zfs:        apt-install zfs-initramfs
./pkgsel/pre-pkgsel.d/10laptop-detect:  apt-install laptop-detect || true
./pkgsel/pre-pkgsel.d/90popcon:if apt-install --no-recommends popularity-contest; then
./quik-installer/debian/postinst:if ! apt-install quik yaboot powerpc-utils; then
./s390-sysconfig-writer/debian/s390-sysconfig-writer.post-base-installer:apt-install sysconfig-hardware || true
./sibyl-installer/debian/postinst:if ! apt-install sibyl ; then
./silo-installer/debian/silo-installer.postinst:if ! apt-install silo; then
./user-setup/user-setup-apply:                  apt-install sudo 2>/dev/null || $log $chroot $ROOT apt-get -q -y install sudo || true
./yaboot-installer/debian/postinst:if ! apt-install $PACKAGES; then

Some things like bootloaders here are probably going to care about
being installed after the kernel (maybe), but well-behaved such
packages should also be triggered by further kernel package
installations anyway I'd hope. Filesystem tools shouldn't care. Not
sure about others here - anybody?

So we have a few ways to go, I think:

 1. Make the change and test / wait for people to scream?!?

 2. Split up the apt-install delayed queue, add a separate queue for
    things like fs tools to be installed before kernel

 3. Excplicitly add an extra call to update the initramfs late in
    installation, to make sure that all necessary tools are installed

 4. Any others?

#801961#68
Date:
2015-11-05 11:19:47 UTC
From:
To:
<snip>

So, talking to Colin at the miniconf, he's worried that this may break
lots of things. A better answer would be to make sure that all the fs
tools packages force an update of the initramfs after
installation. That's probably what we want *anyway* in the longer
term, to make sure that when updates happen to tools we get those
updates in the initramfs too. This means that we need to file bugs
agsinst all the existing fs tools packages that don't call
update-initramfs right now.

Unless any of you see a problem with that, I'll start filing bugs
shortly with patches.

#801961#73
Date:
2015-11-05 14:07:10 UTC
From:
To:
Steve McIntyre <steve@einval.com> (2015-11-05):

I only skimmed over the first mail, but got a bit wary about the
proposed approach. Going a safe route instead looks good to me.

Mraw,
KiBi.

#801961#78
Date:
2015-11-05 16:19:12 UTC
From:
To:
ACK. Checking in sid:

$ zgrep bin/fsck /scratch/mirror/debian/dists/unstable/Contents-amd64.gz
bin/fsck.btrfs                                          admin/btrfs-tools
sbin/fsck                                               utils/util-linux
sbin/fsck.cramfs                                        utils/util-linux
sbin/fsck.exfat                                         otherosfs/exfat-utils
sbin/fsck.ext2                                          admin/e2fsprogs
sbin/fsck.ext3                                          admin/e2fsprogs
sbin/fsck.ext4                                          admin/e2fsprogs
sbin/fsck.ext4dev                                       admin/e2fsprogs
sbin/fsck.f2fs                                          admin/f2fs-tools
sbin/fsck.fat                                           otherosfs/dosfstools
sbin/fsck.gfs2                                          admin/gfs2-utils
sbin/fsck.hfs                                           otherosfs/hfsprogs
sbin/fsck.hfsplus                                       otherosfs/hfsprogs
sbin/fsck.jfs                                           admin/jfsutils
sbin/fsck.minix                                         utils/util-linux
sbin/fsck.msdos                                         otherosfs/dosfstools
sbin/fsck.nfs                                           admin/initscripts
sbin/fsck.ocfs2                                         admin/ocfs2-tools
sbin/fsck.reiser4                                       admin/reiser4progs
sbin/fsck.reiserfs                                      admin/reiserfsprogs
sbin/fsck.vfat                                          otherosfs/dosfstools
sbin/fsck.xfs                                           admin/xfsprogs
usr/bin/fsck-larch                                      python/python-larch
usr/bin/fsck.cpm                                        otherosfs/cpmtools
usr/bin/fsck.s3ql                                       misc/s3ql
usr/sbin/fsck.vmfs                                      otherosfs/vmfs-tools

Ignoring those that don't make sense as a root/usr fs at all, I think
we have (possibly?)

btrfs-tools      - calls update-initramfs -u in post{inst,rm} and has an
                   initramfs hook to put things in the right path
e2fsprogs        - does nothing
f2fs-tools (?)   - does nothing
gfs2-utils (?)   - does nothing
jfsutils         - does nothing
ocfs2-tools (?)  - does nothing
reiser4progs     - adds an initramfs hook, but doesn't call update-initramfs
reiserfsprogs    - does nothing
xfsprogs	 - does nothing

About to start looking at bugs and filing if they're not already reported.

#801961#83
Date:
2021-11-30 07:14:39 UTC
From:
To:
-- 
Hello Dear,
how are you today?hope you are fine
My name is Dr Ava Smith ,Am an English and French nationalities.
I will give you pictures and more details about me as soon as i hear from you
Thanks
Ava