Manual pages for rescue.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello list:

Lets be more intelligent with having the man pages in rescue.  Some time ago a pushed a patch (d8db548b62e3523e9b63f18c277876610fc6b81a) that supposedly fixed that fact that we couldn't see the manpages in rescue mode.  I revisited this issue today and came up with a better solution.  I had added groff package to the initrd.img and so that they could be executable from the rescue mode.  I later realized that it was not a good idea because this package must already be contained in the /mnt/sysimage (and if its not, the user could not see man pages to begin with.  Additionally I had to add to the MANPATH stuff for finding the man pages in non-chroot and in chroot (/usr/share/man and /mnt/sysimage/usr/share/man not good).  Alas it was a fast fix.

But I have come today to correct my little mistake :)  What I have done is made use of the /mnt/sysimage man executables (groff, iconv, nroff...) with links from the image.  in this way we don't add to the initrd.img and the manpages can work in both chrooted and non-chrooted environments.  Patch is attached.

Comments appreciated.
--
Joel Andres Granados
Red Hat / Brno, Czech Republic
diff --git a/rescue.py b/rescue.py
index 58a6d17..803a1fb 100644
--- a/rescue.py
+++ b/rescue.py
@@ -400,9 +400,6 @@ def runRescue(anaconda, instClass):
                 # set a library path to use mounted fs
                 os.environ["LD_LIBRARY_PATH"] =  "/lib:/usr/lib:/usr/X11R6/lib:/lib:/mnt/usr/lib:/mnt/sysimage/lib:/mnt/sysimage/usr/lib:/mnt/sysimage/usr/X11R6/lib"
 
-                # get man pages to work, add chrooted support.
-                os.environ["MANPATH"] = "/mnt/sysimage/usr/share/man:/mnt/sysimage/usr/local/share/man:/usr/share/man:/usr/local/share/man"
-
                 # find groff data dir
                 try:
                     glst = os.listdir("/mnt/sysimage/usr/share/groff")
diff --git a/scripts/mk-images b/scripts/mk-images
index 377d6cf..0e1150a 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -573,6 +573,14 @@ makeinitrd() {
     mkdir -p $MBD_DIR/var/lib
     ln -s ../../tmp $MBD_DIR/var/lib/xkb
 
+
+    #
+    # This seems a good place for this.  Lets create the links to what should be the manpage stuff.
+    #
+    for file in "nroff groff iconv geqn gtbl gpic gefer" ; do
+        ln -s /mnt/sysimage/usr/bin/$file $MBD_DIR/usr/bin/$file
+    done
+
     # s390/s390x need sshd setup
     if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then
 	setupShellEnvironment
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 664feaa..dfbeca8 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -235,7 +235,7 @@ PACKAGESGR="anaconda libpng gtk2 libglade2 fonts-ISO8859-2 fonts-ISO8859-9
 #
 # these packages are combined with the PACKAGES and PACKAGESGR for big stage 2
 #
-PACKAGESRESCUE="bzip2 bzip2-libs dump libidn groff
+PACKAGESRESCUE="bzip2 bzip2-libs dump libidn
                 findutils ftp gzip iputils joe krb5-libs less man
                 modutils mtools mt-st mtr net-tools open smartmontools
                 openssh openssh-clients pciutils rsh traceroute tar rsync
@@ -820,8 +820,6 @@ usr/bin/shred
 usr/bin/ssh
 usr/bin/termidx
 usr/bin/xargs
-usr/bin/groff
-usr/bin/iconv
 usr/bin/ntfscat
 usr/bin/ntfscluster
 usr/bin/ntfscmp
@@ -1045,12 +1043,23 @@ cp $DEST/etc/libuser.conf $DESTGR/etc/libuser.conf
 sed -i 's|\(installforallkernels\) = 0|\1 = 1|' $DEST/etc/yum/pluginconf.d/fedorakmod.conf
 cp $DEST/etc/yum/pluginconf.d/fedorakmod.conf $DESTGR/etc/yum/pluginconf.d/
 
-# fixup man.config to point into /mnt/sysimage for rescue
+#
+# Manual pages in rescue: We dont have man pages in the image, so we point everything (The pages
+# and the man scripts to the /mnt/sysimage.  We want the man command to depend only on the 
+# man.conf file, so we don't use the $MANPATH env variable.  The executables stay unchanged as
+# they will be soft links to /mnt/sysimage.
+#
 if [ -n "$NEEDGR" ]; then
     echo "Fixing up /etc/man.config to point into /mnt/sysimage"
-    mv $DESTGR/etc/man.config $DESTGR/etc/man.config-old
-    cat $DESTGR/etc/man.config-old | sed 's^/usr/bin^/mnt/sysimage/usr/bin^' | sed 's^/bin/cat^/mnt/sysimage/usr/bin/cat^'  > $DESTGR/etc/man.config
-    rm -f $DESTGR/etc/man.config-old
+    #
+    # Lets avoid the lines with MANPATH_MAP for now
+    #
+    sed -i "s,^MANPATH[^_MAP][ \t]*,&/mnt/sysimage," $DESTGR/etc/man.config
+
+    #
+    # Lets change the lines with MANPATH_MAP.  Don't know how much of a difference this will make.
+    #
+    sed -i "s,^MANPATH_MAP[ \t]*[a-zA-Z0-9/]*[ \t]*,&/mnt/sysimage," $DESTGR/etc/man.config
 fi
 
 if [ -n "$NEEDGR" ]; then
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux