hostname: invalid option -- '-b' displayed during boot

Bug #1545297 reported by Björn Schließmann
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

During boot, you can see for a short time "hostname: invalid option -- 'b'" and a line about busybox, and a few other lines.

Checking /usr/share/initramfs-tools/init, which is copied into the initramfs during creation, indeed reveals a hostname call with "-b".

Also, unpacking my current initramfs and calling bin/hostname, the following is displayed, which IIRC coincides very well with the message displayed during boot for a short time:

$ bin/hostname -b
bin/hostname: invalid option -- 'b'
BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) multi-call binary.

Usage: hostname [OPTIONS] [HOSTNAME | -F FILE]

Get or set hostname or DNS domain name

 -s Short
 -i Addresses for the hostname
 -d DNS domain name
 -f Fully qualified domain name
 -F FILE Use FILE's content as hostname
$

The initramfs should only use hostname options which busybox understands.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: initramfs-tools 0.120ubuntu6
ProcVersionSignature: Ubuntu 4.2.0-27.32-generic 4.2.8-ckt1
Uname: Linux 4.2.0-27-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl nvidia
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Feb 13 16:43:48 2016
PackageArchitecture: all
SourcePackage: initramfs-tools
UpgradeStatus: Upgraded to wily on 2016-02-11 (1 days ago)

Revision history for this message
Björn Schließmann (b-schliessmann) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in initramfs-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
costinel (costinel) wrote :
Revision history for this message
costinel (costinel) wrote :

ubuntu@ubuntu-mate:/tmp/test$ zcat /boot/initrd.img-4.4.0-4-generic | cpio -i
192905 blocks
ubuntu@ubuntu-mate:/tmp/test$ grep -n -C2 hostname init64-
65-
66:# mdadm needs hostname to be set. This has to be done before the udev rules are called!
67:if [ -f "/etc/hostname" ]; then
68: /bin/hostname -b -F /etc/hostname 2>&1 1>/dev/null
69-fi
70-

Changed in initramfs-tools (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Benjamin Drung (bdrung) wrote :

This has been fixed in initramfs-tools 0.125ubuntu1 in Ubuntu 16.10 yakkety. From debian/changelog:

- init: drop -b from hostname as it is not supported by busybox

Changed in initramfs-tools (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.