home *** CD-ROM | disk | FTP | other *** search
- /**
- * File:
- * bootloader_finish.ycp
- *
- * Module:
- * Step of base installation finish
- *
- * Authors:
- * Jiri Srain <jsrain@suse.cz>
- *
- * $Id: bootloader_finish.ycp 34486 2006-11-20 14:29:37Z odabrunz $
- *
- */
-
- {
-
- textdomain "bootloader";
-
- import "Arch";
- import "Bootloader";
- import "Installation";
- import "Linuxrc";
- import "Misc";
- import "Mode";
- import "Update";
-
- any ret = nil;
- string func = "";
- map param = $[];
-
- /* Check arguments */
- if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
- func = (string)WFM::Args(0);
- if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
- param = (map)WFM::Args(1);
- }
-
- y2milestone ("starting bootloader_finish");
- y2debug("func=%1", func);
- y2debug("param=%1", param);
-
- if (func == "Info")
- {
- return (any)$[
- "steps" : 3,
- // progress step title
- "title" : _("Saving bootloader configuration..."),
- "when" : [ `installation, `update, `autoinst ],
- ];
- }
- else if (func == "Write")
- {
- // provide the /dev content from the inst-sys also inside the chroot of just the upgraded system
- // umount of this bind mount will happen in umount_finish
- if (Mode::update ())
- {
- string cmd = "targetdir=" + Installation::destdir + "
- if test ${targetdir} = / ; then echo targetdir is / ; exit 1 ; fi
- grep -E \"^[^ ]+ ${targetdir}/dev \" < /proc/mounts
- if test $? = 0
- then
- echo targetdir ${targetdir} already mounted.
- exit 1
- else
- mkdir -vp ${targetdir}/dev
- cp --preserve=all --recursive --remove-destination /lib/udev/devices/* ${targetdir}/dev
- mount -v --bind /dev ${targetdir}/dev
- fi
- ";
- y2milestone ("mount --bind cmd: %1", cmd);
- map out = (map)WFM::Execute (.local.bash_output, cmd);
- if (out["exit"]:0 != 0)
- {
- y2error ("unable to bind mount /dev in chroot");
- }
- y2milestone ("mount --bind /dev /mnt/dev output: %1", out);
- }
- SCR::Execute (.target.bash, "/sbin/SuSEconfig --module bootsplash");
- // --------------------------------------------------------------
- // message after first round of packet installation
- // now the installed system is run and more packages installed
- // just warn the user that the screen is going back to text mode
- // and yast2 will come up again.
- // dont mention this "going back to text mode" here, maybe this
- // wont be necessary in the final version
-
- // we should tell the user to remove the cd on an SMP or Laptop system
- // where we do a hard reboot. However, the cdrom is still mounted here
- // and cant be removed.
-
- if (Arch::s390 ())
- {
- if (Linuxrc::usessh ())
- // for s390:
- // Message that will be displayed along with information
- // how the boot loader was installed
- Misc::boot_msg = _("
- Your system will now shut down.
- After shutdown, reload the system
- with the load address of your root DASD or
- the load adress of your zFCP device.
- Then reconnect and run the following:
- /usr/lib/YaST2/startup/YaST2.ssh
- For details, read the related chapter
- in the documentation.
- ");
- else
- // for s390:
- // Message that will be displayed along with information
- // how the boot loader was installed
- Misc::boot_msg = _("
- Your system will shut down now.
- After shutdown, reload the system
- with the load address of your root DASD or
- the load address of your zFCP device.
- For details, read the relevant chapter
- in the documentation.
- ");
- }
- else
- {
- if (Linuxrc::usessh () && !Linuxrc::vnc())
- // Final message after all packages from CD1 are installed
- // and we're ready to start (boot into) the installed system
- // Message that will be displayed along with information
- // how the boot loader was installed
- Misc::boot_msg = _("The system will reboot now.
- After reboot, reconnect and run the following:
- /usr/lib/YaST2/startup/YaST2.ssh");
- else
- // Final message after all packages from CD1 are installed
- // and we're ready to start (boot into) the installed system
- // Message that will be displayed along with information
- // how the boot loader was installed
- Misc::boot_msg = _("The system will reboot now...");
- }
-
- //--------------------------------------------------------------
- // Install bootloader (always, see #23018)
- // should also set Misc::boot_msg appropriate
-
- // FIXME: this is the plan B solution, try to solve plan A in
- // BootCommon.ycp:CreateLinuxSection() (line 435)
- // resolve symlinks in kernel and initrd paths
- Bootloader::ResolveSymlinksInSections();
-
- if (!Mode::update ())
- {
- return Bootloader::Write ();
- }
- else
- {
- return Bootloader::Update (
- Update::installedVersion,
- Update::updateVersion);
- }
- }
- else
- {
- y2error ("unknown function: %1", func);
- ret = nil;
- }
-
- y2debug("ret=%1", ret);
- y2milestone("bootloader_finish finished");
- return ret;
-
-
- } /* EOF */
-