summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2012-04-10 20:30:53 +0000
committerColin Guthrie <colin@mageia.org>2012-04-10 20:30:53 +0000
commit9e3367d2f80d6d140ed921adb4d6cfcdd0778148 (patch)
tree5638610cff8940ef29b4a1e4853ba3883d6faeb1 /perl-install
parent9bb834d0897e829586c4047fa119cd71ddc95380 (diff)
downloaddrakx-9e3367d2f80d6d140ed921adb4d6cfcdd0778148.tar
drakx-9e3367d2f80d6d140ed921adb4d6cfcdd0778148.tar.gz
drakx-9e3367d2f80d6d140ed921adb4d6cfcdd0778148.tar.bz2
drakx-9e3367d2f80d6d140ed921adb4d6cfcdd0778148.tar.xz
drakx-9e3367d2f80d6d140ed921adb4d6cfcdd0778148.zip
installer: allow generation of host-only initrd during install
During install dracut will generate a generic (i.e. large) initrd. As we now start udev early, we can use udev metadata when generating our initrd and thus we can generate our default, hostonly initrd. Thus ensure relevant directories (/run) are bind mounted and fake a /run/initramfs folder which is used in dracut to detect a boot which will have sufficient metadata in the udev DB. Tested with an install on a new disk and creating LVMs and also on an install where the pre-existing LVMs were reused. Suitable fixes to drakx-in-chroot have also been added, but remain untested
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/install/install2.pm9
-rw-r--r--perl-install/install/steps.pm6
3 files changed, 14 insertions, 2 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index a03cd4eee..24f9feb88 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,5 +1,6 @@
- interactive::curses:
o make sure ranges are always within limits (mga#646)
+- allow generation of host-only initrd during install
Version 14.3 - 7 April 2012
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm
index 03f617154..44d9bf916 100644
--- a/perl-install/install/install2.pm
+++ b/perl-install/install/install2.pm
@@ -291,8 +291,11 @@ sub start_udev() {
# Ensure /run is mounted
mkdir("/run", 0755);
run_program::run("mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run");
- mkdir_p("/run/udev/rules.d");
- $ENV{UDEVRULESD} = "/run/udev/rules.d";
+
+ # Fake dracut boot (due to checks employed when running dracut during install)
+ # as we know that we'll have the needed metadata in udevadm db due to us
+ # starting udev nice and early here.
+ mkdir_p("/run/initramfs");
# Start up udev and trigger cold plugs
run_program::run("mount", "-t", "devtmpfs", "-o", "mode=0755,nosuid", "devtmpfs", "/dev");
@@ -300,6 +303,8 @@ sub start_udev() {
run_program::run("mount", "-t", "devpts", "-o", "gid=5,mode=620,noexec,nosuid", "devpts", "/dev/pts");
run_program::run("mount", "-t", "tmpfs", "-o", "mode=1777,nosuid,nodev", "tmpfs", "/dev/shm");
+ mkdir_p("/run/udev/rules.d");
+ $ENV{UDEVRULESD} = "/run/udev/rules.d";
run_program::run("/lib/udev/udevd", "--daemon", "--resolve-names=never");
run_program::run("udevadm", "trigger", "--type=subsystems", "--action=add");
run_program::run("udevadm", "trigger", "--type=devices", "--action=add");
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm
index 53e87f0c3..85de324cb 100644
--- a/perl-install/install/steps.pm
+++ b/perl-install/install/steps.pm
@@ -377,6 +377,12 @@ sub beforeInstallPackages {
run_program::run('mount', '--bind', '/tmp/.X11-unix', "$::prefix/tmp/.X11-unix");
}
+ if (-e '/run') {
+ mkdir "$::prefix/run";
+ run_program::run('mount', '--bind', '/run', "$::prefix/run");
+ }
+
+
log::l("setting excludedocs to $o->{excludedocs}");
substInFile { s/%_excludedocs.*//; $_ .= "%_excludedocs yes\n" if eof && $o->{excludedocs} } "$::prefix/etc/rpm/macros";