Commit Graph

78 Commits (a43f97c4e35d0d9c7e6e315e11c909e86936e1cc)

Author SHA1 Message Date
Harald Hoyer 792b189317 systemd service cleanup 2012-07-10 12:22:51 +02:00
Harald Hoyer 5113a3efff rootfs-block/mount-root.sh: warn if ro mount failed and remount
remount the root filesystem, if it was not unmounted
2012-07-02 18:52:49 +02:00
Harald Hoyer 7209df9e91 do not umount root, remount it. do not mount ro if not specified
also mount /usr readonly if "ro" is specified on the command line
if /usr is a btrfs subvolume of root, use the same mount options
2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski 965c2d8760 95rootfs-block: skip checks rel. to fsck if rd.skipfsck is supplied 2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski 9fb01d49d6 new option: rd.skipfsck to skip fsck for rootfs and /usr 2012-07-02 18:52:49 +02:00
Harald Hoyer b23a2837db add PARTUUID as root=PARTUUID=<partition uuid> parameter 2012-06-14 13:04:22 +02:00
Harald Hoyer 840d8e4733 add filesystem options to fsck_single()
if we have e.g. special btrfs options for "/" and "/usr", we want to use
those for the test mount to determine if the filesystem is corrupted.
2012-05-31 12:57:23 +02:00
Harald Hoyer 8aeec251e3 rootfs-block/block-genrules.sh: install systemd mount unit 2012-05-09 13:15:32 +02:00
Daniel Drake 6625b74e90 rootfs-block: avoid remount when options don't change
Mounting, unmounting and then mounting a disk partition takes some
time.

On embedded systems such as OLPC XO where we disable fsck and fstab
reading, the root options are not going to change throughout the
mount_root() function, so remounting is time consuming and without
change.

Detect and optimize for this case so that the filesystem is only
mounted once.
2012-04-16 11:53:04 +02:00
Harald Hoyer b0692d0311 add wait_for_dev() and wait_for_mount() 2011-11-15 09:47:16 +01:00
Harald Hoyer ca8d4e8933 Do not use /run/udev/rules.d for udev rules
for rules, which should not be called in the real root.

Stale rules can cause this:
https://bugzilla.redhat.com/show_bug.cgi?id=734096
2011-09-19 12:21:51 +02:00
Harald Hoyer 459bfe02f9 95rootfs-block/mount-root.sh: also parse rootopts for "_netdev" 2011-08-11 15:36:29 +02:00
Michal Soltys c60dbcc0aa 95rootfs-block/mount-root.sh: comment out fstab generation
fsck_single() operates directly on the device, so fstab is not
necessary. fs-lib functions make sure fscks don't complain.
Code is only commented out just in case I missed something.
2011-08-11 14:27:24 +02:00
Michal Soltys 21b691152c 95rootfs-block/mount-root.sh: squash rootopts into rflags
Small simplification - prepend rootopts to rflags before mount
operations. Shortens resulting command lines quite a bit.
2011-08-11 14:27:24 +02:00
Michal Soltys fefab84fff implement fs-lib, squash a few bugs that were part of det_fs/wrap_fsck
To not pollute dracut-lib.sh, all the fsck related functions were moved
to fs-lib.sh. The functions available are as follows:

- fsck_single

this will detect/verify filesystem, check if it has necessary tools and
check the filesystem respecting additional flags (if any), using
specific "driver" (or falling back to generic one). Currently
available: fsck_drv_{com,xfs,std}. 'com' is used for tools following
typical subset of options/return codes (e.g. ext, jfs), 'std' is used
for "unknown" fs and doesn't assume it can be run non-interactively.

Please see comments around the code for more info.

- fsck_batch

this will check provided list of the devices;

Both of the above functions will fake empty fstab, to make generic fsck
not complain too much (excact devices are always provided on the command
line).

"Known" filesystems currently: ext234, reiser, jfs, xfs

- det_fs

Small bug fixed - as this function is meant to be called in $(), it may
not be verbose.
Current behaviour is:
 - if detection is successful, use its result
 - if detection is not successful, and filesystem is provided, return
   the provided one; otherwise use auto
2011-08-11 14:27:24 +02:00
Michal Soltys 1ddaffda88 95rootfs-block/mount-root.sh: '-a' for ext? is handled in fs-lib now
Previously, '-a' was added for ext[234] filesystems if other
conflicting flag were not present. It's being done automatically
in fsck_drv_com() now (also for jfs and reiser).
2011-08-11 14:27:23 +02:00
Harald Hoyer 7ed1de2f1d mount-root.sh: fixed fsck and "-a" only for "ext*" 2011-05-31 14:56:30 +02:00
Michal Soltys 0d8c1d7fa1 95rootfs-block/block-genrules.sh: Use > instead of >>
trivial, blocksymlink.sh shouldn't exist at this point.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:51 +02:00
Michal Soltys 0216d1cda3 95rootfs-block/mount-root.sh: Rely on det_fs and wrap_fsck
Use common fsck and det_fs code. Verify filesystem type more
aggressively, which has a chance to be more resistant to
accidental mistakes.

Also, there's no need to generate custom fstab for the sake of fsck
anymore.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:51 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Harald Hoyer 19f3a804e7 s#/dev/.run#/run#g
Move things where they really belong to.
2011-03-18 18:23:44 +01:00
Harald Hoyer 77e607a3a7 prepare for future udev rules.d location
future udev will have rules.d in /dev/.run/udev/rules.d

Also remove compat symlinks, because we want to get rid of these files
anyway.
2011-03-10 19:19:09 +01:00
Harald Hoyer 1e2a167fe6 rootfs-block/mount-root.sh: rename flag file for fsck
/dev/.run/initramfs/fsck -> /dev/.run/initramfs/root-fsck
2011-03-10 19:17:23 +01:00
Harald Hoyer b177e9133e move all /dev/.initramfs to /dev/.run/initramfs
We want all "/var/run" information to live in /dev/.run, until the real
root is mounted.
Therefore we mount a tmpfs on /dev/.run, which can/will be bind/move mounted
on /var/run later on.
2011-03-10 12:40:47 +01:00
Harald Hoyer 8ce58f1f42 add missing shebang 2011-02-23 09:38:25 +01:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00
Harald Hoyer 95d2dabc25 replaced check,install,installkernel with module-info.sh 2011-02-02 13:56:03 +01:00
Harald Hoyer e53fdd1c35 rootfs-block/mount-root.sh: remove $NEWROOT/.autofsck if possible 2010-11-10 22:10:54 +01:00
Harald Hoyer d884af8077 rootfs-block/mount-root.sh: remove $NEWROOT/{.autofsck,forcefsck} if possible 2010-11-10 20:47:15 +01:00
Harald Hoyer a4f88b8a49 rootfs-block/mount-root.sh: set prompt in emergency shell 2010-11-10 20:45:02 +01:00
Harald Hoyer 3d7c58ca1e rootfs-block/mount-root.sh: echo fsck return code to
/dev/.initramfs/fsck
2010-11-10 20:43:22 +01:00
Harald Hoyer ce51f3be11 rootfs-block/mount-root.sh: fixed filesystem type udev parsing 2010-11-10 20:12:05 +01:00
Harald Hoyer 4cba811f6c rootfs-block/mount-root.sh: correctly printf to fstab 2010-11-10 20:11:31 +01:00
Harald Hoyer 85de3d281a rootfs-block/mount-root.sh: only warn if fsck returned != 0 2010-11-10 20:06:34 +01:00
Harald Hoyer 3817c2f138 rootfs-block/mount-root.sh: default rootfs to auto, even without fstab 2010-11-10 20:01:30 +01:00
Harald Hoyer 13af399f65 rootfs-block/mount-root.sh: clear fsckoptions 2010-11-10 19:58:15 +01:00
Andrey Borzenkov 0e08f1de8d 95rootfs-block: fix missing root when label contains slash
It is not clearly documented, but apparently fsck
(or, probably, getmntent) is using backslash as
escape character.

Label containing slash is converted to \x2f but '\'
is eaten by fsck later. Escape '\' before writing
into fstab.

v2:
- fix sed expression
- use printf instead of echo because echo eats '\' as well

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2010-11-10 16:03:14 +01:00
Harald Hoyer 9840eaade6 rootfs-block/install: install e2fsck for slackware 2010-11-10 15:00:30 +01:00
Harald Hoyer c56e44a63a rootfs-block/mount-root.sh: fixed fsck "-a" option 2010-11-03 13:40:42 -04:00
Harald Hoyer 3871942d13 rootfs-block:mount-root.sh add fsck 2010-10-29 19:00:35 +02:00
Harald Hoyer fa7ada31d0 new parameter option names with "rd.*" namespace
Renamed Options
       Here is a list of options, which were used in dracut prior to
       version 008, and their new replacement.

       rdbreak
           rd.break

       rd_CCW
           rd.ccw

       rdcopystate
           rd.copystate

       rd_DASD_MOD
           rd.dasd_mod.dasd

       rd_DASD
           rd.dasd

       rdinitdebug rdnetdebug
           rd.debug

       rd_NO_DM
           rd.dm=0

       rd_DM_UUID
           rd.dm.uuid

       rdblacklist
           rd.driver.blacklist

       rdinsmodpost
           rd.driver.post

       rdloaddriver
           rd.driver.pre

       rd_NO_FSTAB
           rd.fstab=0

       rdinfo
           rd.info

       check
           rd.live.check

       rdlivedebug
           rd.live.debug

       live_dir
           rd.live.dir

       liveimg
           rd.live.image

       overlay
           rd.live.overlay

       readonly_overlay
           rd.live.overlay.readonly

       reset_overlay
           rd.live.overlay.reset

       live_ram
           rd.live.ram

       rd_NO_CRYPTTAB
           rd.luks.crypttab=0

       rd_LUKS_KEYDEV_UUID
           rd.luks.keydev.uuid

       rd_LUKS_KEYPATH
           rd.luks.keypath

       rd_NO_LUKS
           rd.luks=0

       rd_LUKS_UUID
           rd.luks.uuid

       rd_LUKS_UUID
           rd.luks.uuid

       rd_NO_LVMCONF
           rd.lvm.conf

       rd_LVM_LV
           rd.lvm.lv

       rd_NO_LVM
           rd.lvm=0

       rd_LVM_SNAPSHOT
           rd.lvm.snapshot

       rd_LVM_SNAPSIZE
           rd.lvm.snapsize

       rd_LVM_VG
           rd.lvm.vg

       rd_NO_MDADMCONF
           rd.md.conf=0

       rd_NO_MDIMSM
           rd.md.imsm=0

       rd_NO_MD
           rd.md=0

       rd_MD_UUID
           rd.md.uuid

       rd_NFS_DOMAIN
           rd.nfs.domain

       rd_NO_PLYMOUTH
           rd.plymouth=0

       rd_retry
           rd.retry

       rdshell
           rd.shell

       rd_NO_SPLASH
           rd.splash

       rdudevdebug
           rd.udev.debug

       rdudevinfo
           rd.udev.info

       rd_NO_ZFCPCONF
           rd.zfcp.conf=0

       rd_ZFCP
           rd.zfcp
2010-10-28 17:11:27 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer c492fe12c0 init: create /dev/.udev/rules.d with correct permissions 2010-08-02 15:58:48 +02:00
Harald Hoyer e0c1d4e79f mkdir /dev/.udev/rules.d with mode 0755 2010-08-02 15:26:55 +02:00
Harald Hoyer ae5ec68355 Write rules for symlinks to /dev/.udev/rules.d for later usage
We want some symlinks to persist in the real root, so we write them to
/dev/.udev/rules.d, that they survive a retrigger.
2010-06-22 10:30:39 +02:00
Harald Hoyer b6a7c09070 chmod 0755 *.sh 2010-05-19 09:40:48 +02:00
Harald Hoyer 0ec519f8a4 mount-root: also filter "defaults" from mount options 2010-02-18 18:05:51 +01:00
Harald Hoyer d793fc2e8b mount-root: skip comments 2010-02-18 17:46:01 +01:00