Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267094 - sys-apps/baselayout-1 - checkfs tries to remove a non-existant /fastboot file from read-only filesystem
Summary: sys-apps/baselayout-1 - checkfs tries to remove a non-existant /fastboot file...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-22 13:25 UTC by Mark Tomich
Modified: 2010-03-16 17:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tomich 2009-04-22 13:25:39 UTC
/etc/init.d/checkfs:15 reads:

        if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]] ; then
                rm -f /fastboot

...it should be "&&" rather than "||" because if /fastboot exists, *and* it's not a read-only root (hence CDBOOT contains something), only then it should attempt to remove it.

In my case, /fastboot does not exist, but CDBOOT is set, so checkfs bombs out because it can't remove a non-existant file on a read-only filesystem


Reproducible: Always

Steps to Reproduce:
1. rm /fastboot
2. reboot with a read-only root filesystem

Actual Results:  
checkfs bombs out, offers maintenance mode, or reboots

Expected Results:  
system boots as expected
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2009-04-23 20:56:49 UTC
Please post your `emerge --info' too.
Comment 2 Mark Tomich 2009-04-24 11:13:05 UTC
Portage 2.1.6.7 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.18-xen-r8-domU x86_64)
=================================================================
System uname: Linux-2.6.18-xen-r8-domU-x86_64-Intel-R-_Xeon-TM-_CPU_3.40GHz-with-glibc2.0
Timestamp of tree: Fri, 24 Apr 2009 10:45:02 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.7
dev-lang/python:     2.5.4-r2
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -mtune=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -mtune=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US"
MAKEOPTS="-j8"
PKGDIR="/var/diskless-packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa bzip2 cli cpudetection cups dri firefox gtk iconv ipv6 isdnlog midi minimal mmx mudflap ncurses nonfsv4 nptl nptlonly nsplugin openmp pcre pppd readline reflection session spl ssl startup-notification sysfs unicode wmp x86 xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="intel radeon r128 vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 3 SpanKY gentoo-dev 2009-04-26 01:55:13 UTC
no, it should not be &&.  the current logic is correct: if fastboot *or* booting from CD, you *dont* want to check any disks.
Comment 4 Mark Tomich 2009-04-27 19:02:55 UTC
fair enough, maybe && is wrong...but the code still ain't right...how 'bout:

if [[ -f /fastboot ]]; then
  if [[ -n ${CDBOOT} ]]; then
    rm -f /fastboot
  fi
else
  ...
Comment 5 Mark Tomich 2009-04-27 19:08:41 UTC
I take that back...
this looks better:

if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]]; then
  rm -f /fastboot || true
else
  ...
Comment 6 Mark Tomich 2009-04-27 19:19:46 UTC
sorry for spamming, but I keep thinking of better ways of doing this:

if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]]; then
  [[ -n ${CDBOOT} ]] && rm -f /fastboot
else
  ...

Comment 7 Mark Tomich 2009-04-27 19:22:59 UTC
oops...

if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]]; then
  [[ -n ${CDBOOT} ]] || rm -f /fastboot
else
  ...
Comment 9 Mark Tomich 2010-03-16 17:30:27 UTC
I've tested this in my environment, and it works for me...thanks.