Changeset b7dc3d8


Ignore:
Timestamp:
05/02/2021 08:27:58 AM (6 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
xry111/usr-move
Children:
7a57861
Parents:
811f42a
git-author:
Xi Ruoyao <xry111@…> (05/02/2021 08:17:35 AM)
git-committer:
Xi Ruoyao <xry111@…> (05/02/2021 08:27:58 AM)
Message:

usr-move: bye bye mv /usr/foo/xxx /foo

Files:
28 edited

Legend:

Unmodified
Added
Removed
  • chapter04/creatingminlayout.xml

    r811f42a rb7dc3d8  
    2121  <systemitem class="username">root</systemitem>:</para>
    2222
    23 <screen revision="sysv"><userinput>mkdir -pv $LFS/{etc,var} $LFS{/usr,}/{bin,lib,sbin}
    24 
    25 case $(uname -m) in
    26   x86_64) mkdir -pv $LFS/lib64 ;;
    27 esac</userinput></screen>
    28 
    29 <screen revision="systemd"><userinput>mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin}
     23<screen><userinput>mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin}
    3024
    3125for i in bin lib sbin; do
     
    3731esac</userinput></screen>
    3832
    39     <note revision="systemd">
     33    <note>
    4034      <para>
    4135        The above command is correct.  The <command>ln</command> command has
  • chapter05/glibc.xml

    r811f42a rb7dc3d8  
    5555    ;;
    5656esac</userinput></screen>
    57 
    58     <note revision="sysv">
    59       <para>
    60         The above command is correct.  The <command>ln</command> command has
    61         a few syntactic versions, so be sure to check
    62                 <command>info coreutils ln</command> and <filename>ln(1)</filename>
    63                 before reporting what you may think is an error.
    64           </para>
    65     </note>
    6657
    6758    <para>Some of the Glibc programs use the non-FHS compliant
  • chapter06/bash.xml

    r811f42a rb7dc3d8  
    7575<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    7676
    77     <para revision="sysv">Move the executable to where it is expected:</para>
    78 
    79 <screen revision="sysv"><userinput remap="install">mv $LFS/usr/bin/bash $LFS/bin/bash</userinput></screen>
    80 
    8177    <para>Make a link for the programs that use <command>sh</command> for
    8278    a shell:</para>
  • chapter06/coreutils.xml

    r811f42a rb7dc3d8  
    8484    programs harcode executable locations:</para>
    8585
    86 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin
    87 mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm}        $LFS/bin
    88 mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname}               $LFS/bin
    89 mv -v $LFS/usr/bin/{head,nice,sleep,touch}                    $LFS/bin</userinput></screen>
    9086<screen><userinput remap="install">mv -v $LFS/usr/bin/chroot                                     $LFS/usr/sbin
    9187mkdir -pv $LFS/usr/share/man/man8
  • chapter06/file.xml

    r811f42a rb7dc3d8  
    9191<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    9292
    93     <para revision="sysv">Move a shared library into its final location in the LFS system,
    94     and recreate the symlink for it:</para>
    95 
    96 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/lib/libmagic.so.* $LFS/lib
    97 ln -sfv ../../lib/$(readlink /usr/lib/libmagic.so) $LFS/usr/lib/libmagic.so</userinput></screen>
    98 
    9993  </sect2>
    10094
  • chapter06/findutils.xml

    r811f42a rb7dc3d8  
    5858<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5959
    60     <para revision="sysv">Move the executable to its final expected location:</para>
    61 
    62 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/bin/find $LFS/bin
    63 sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb</userinput></screen>
    64 
    6560  </sect2>
    6661
  • chapter06/gzip.xml

    r811f42a rb7dc3d8  
    5656<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5757
    58     <para revision="sysv">Move the executable to its final expected location:</para>
    59 
    60 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/bin/gzip $LFS/bin</userinput></screen>
    61 
    6258  </sect2>
    6359
  • chapter06/ncurses.xml

    r811f42a rb7dc3d8  
    149149    </variablelist>
    150150
    151     <para revision="sysv">Move the shared libraries to the
    152     <filename class="directory">/lib</filename> directory, where they are
    153     expected to reside:</para>
    154 
    155 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib</userinput></screen>
    156 
    157     <para revision="sysv">Because the libraries have been moved, one symlink points to
    158     a non-existent file. Recreate it:</para>
    159 
    160 <screen revision="sysv"><userinput remap="install">ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so</userinput></screen>
    161 
    162 
    163151  </sect2>
    164152
  • chapter06/xz.xml

    r811f42a rb7dc3d8  
    6060<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6161
    62     <para revision="sysv">Make sure that all essential files are in the correct directory:</para>
    63 
    64 <screen revision="sysv"><userinput remap="install">mv -v $LFS/usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat}  $LFS/bin
    65 mv -v $LFS/usr/lib/liblzma.so.*                       $LFS/lib
    66 ln -svf ../../lib/$(readlink $LFS/usr/lib/liblzma.so) $LFS/usr/lib/liblzma.so</userinput></screen>
    67 
    6862  </sect2>
    6963
  • chapter08/acl.xml

    r811f42a rb7dc3d8  
    7070<screen><userinput remap="install">make install</userinput></screen>
    7171
    72     <para revision="sysv">The shared library needs to be moved to
    73     <filename class="directory">/lib</filename>, and as a result the
    74     <filename class="extension">.so</filename> file in
    75     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    76 
    77 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libacl.so.* /lib
    78 ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so</userinput></screen>
    79 
    8072  </sect2>
    8173
  • chapter08/attr.xml

    r811f42a rb7dc3d8  
    6969<screen><userinput remap="install">make install</userinput></screen>
    7070
    71     <para revision="sysv">The shared library needs to be moved to
    72     <filename class="directory">/lib</filename>, and as a result the
    73     <filename class="extension">.so</filename> file in
    74     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    75 
    76 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libattr.so.* /lib
    77 ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so</userinput></screen>
    78 
    7971  </sect2>
    8072
  • chapter08/bash.xml

    r811f42a rb7dc3d8  
    8989<screen><userinput remap="install">make install</userinput></screen>
    9090
    91     <para revision="sysv">Move the main executable to
    92     <filename class='directory'>/bin</filename>:</para>
    93 
    94 <screen revision="sysv"><userinput remap="install">mv -vf /usr/bin/bash /bin</userinput></screen>
    95 
    9691    <para>Run the newly compiled <command>bash</command> program (replacing the one that is
    9792    currently being executed):</para>
  • chapter08/bzip2.xml

    r811f42a rb7dc3d8  
    8989
    9090<screen><userinput remap="install">cp -v bzip2-shared /bin/bzip2</userinput></screen>
    91 
    92     <para revision="sysv">Adjust some symbolic links, and clean up:</para>
    93 
    94 <screen revision="sysv"><userinput remap="install">cp -av libbz2.so* /lib
    95 ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
    96 rm -v /usr/bin/{bunzip2,bzcat,bzip2}
    97 ln -sv bzip2 /bin/bunzip2
    98 ln -sv bzip2 /bin/bzcat</userinput></screen>
    9991
    10092    <para>Remove an useless static library:</para>
  • chapter08/coreutils.xml

    r811f42a rb7dc3d8  
    143143    <para>Move programs to the locations specified by the FHS:</para>
    144144
    145 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
    146 mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
    147 mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin</userinput></screen>
    148 
    149145<screen><userinput remap="install">mv -v /usr/bin/chroot /usr/sbin
    150146mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
    151147sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8</userinput></screen>
    152 
    153     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    154     depend on <command>head</command>, <command>nice</command>,
    155     <command>sleep</command>, and <command>touch</command>.  As <filename
    156     class="directory">/usr</filename> may not be available during the early and
    157     late stages of booting, those binaries need to be on the root partition to
    158     maintain FHS compliance:</para>
    159 
    160 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/{head,nice,sleep,touch} /bin</userinput></screen>
    161148
    162149  </sect2>
  • chapter08/dbus.xml

    r811f42a rb7dc3d8  
    9898<screen><userinput remap="install">make install</userinput></screen>
    9999
    100     <para revision="sysv">The shared library needs to be moved to
    101     <filename class="directory">/lib</filename>, and as a result the
    102     <filename class="extension">.so</filename> file in
    103     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    104 
    105 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libdbus-1.so.* /lib
    106 ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so</userinput></screen>
    107 
    108100    <para>Create a symlink so that D-Bus and systemd can use the same
    109101    <filename>machine-id</filename> file:</para>
  • chapter08/file.xml

    r811f42a rb7dc3d8  
    5858<screen><userinput remap="install">make install</userinput></screen>
    5959
    60     <para revision="sysv"><command>/bin/more</command> from util-linux will link to
    61     <filename class="libraryfile">libmagic.so</filename>, so the shared
    62     library should be moved to <filename class="directory">/lib</filename>,
    63     and as a result the
    64     <filename class="extension">.so</filename> file in
    65     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    66 
    67 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libmagic.so.* /lib
    68 ln -sfv ../../lib/$(readlink /usr/lib/libmagic.so) /usr/lib/libmagic.so</userinput></screen>
    69 
    7060  </sect2>
    7161
  • chapter08/findutils.xml

    r811f42a rb7dc3d8  
    7575<screen><userinput remap="install">make install</userinput></screen>
    7676
    77     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    78     depend on <command>find</command>.  As <filename
    79     class="directory">/usr</filename> may not be available during the early
    80     stages of booting, this program needs to be on the root partition.  The
    81     <command>updatedb</command> script also needs to be modified to correct an
    82     explicit path:</para>
    83 
    84 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/find /bin
    85 sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb</userinput></screen>
    86 
    8777  </sect2>
    8878
  • chapter08/gzip.xml

    r811f42a rb7dc3d8  
    5858<screen><userinput remap="install">make install</userinput></screen>
    5959
    60     <para revision="sysv">Move a program that needs to be on the root filesystem:</para>
    61 
    62 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/gzip /bin</userinput></screen>
    63 
    6460  </sect2>
    6561
  • chapter08/inetutils.xml

    r811f42a rb7dc3d8  
    115115<screen><userinput remap="install">make install</userinput></screen>
    116116
    117     <para revision="sysv">Move some programs so they are available if <filename
    118     class='directory'>/usr</filename> is not accessible:</para>
    119 
    120 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
    121 mv -v /usr/bin/ifconfig /sbin</userinput></screen>
    122 
    123     <para revision="systemd">Move a program to the proper location:</para>
    124 
    125 <screen revision="systemd"><userinput remap="install">mv -v /{,s}bin/ifconfig</userinput></screen>
     117    <para>Move a program to the proper location:</para>
     118
     119<screen><userinput remap="install">mv -v /{,s}bin/ifconfig</userinput></screen>
    126120
    127121  </sect2>
  • chapter08/libcap.xml

    r811f42a rb7dc3d8  
    7373
    7474<screen><userinput remap="install">make prefix=/usr lib=lib install</userinput></screen>
    75 
    76     <para revision="sysv">Make sure the essential libraries are in
    77     the correct directory:</para>
    78 
    79 <screen revision="sysv"><userinput remap="install">for libname in cap psx; do
    80     mv -v /usr/lib/lib${libname}.so.* /lib
    81     ln -sfv ../../lib/lib${libname}.so.2 /usr/lib/lib${libname}.so
    82 done</userinput></screen>
    8375
    8476    <para>Adjust the permission of the shared libraries:</para>
  • chapter08/ncurses.xml

    r811f42a rb7dc3d8  
    100100
    101101<screen><userinput remap="install">make install</userinput></screen>
    102 
    103     <para revision="sysv">Move the shared libraries to the
    104     <filename class="directory">/lib</filename> directory, where they are
    105     expected to reside:</para>
    106 
    107 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libncursesw.so.6* /lib</userinput></screen>
    108 
    109     <para revision="sysv">Because the libraries have been moved, one symlink points to
    110     a non-existent file. Recreate it:</para>
    111 
    112 <screen revision="sysv"><userinput remap="install">ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so</userinput></screen>
    113102
    114103    <para>Many applications still expect the linker to be able to find
  • chapter08/procps.xml

    r811f42a rb7dc3d8  
    103103<screen><userinput remap="install">make install</userinput></screen>
    104104
    105     <para revision="sysv">Finally, move essential libraries to a location that can be found
    106     if <filename class="directory">/usr</filename> is not mounted.</para>
    107 
    108 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libprocps.so.* /lib
    109 ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so</userinput></screen>
    110 
    111105  </sect2>
    112106
  • chapter08/psmisc.xml

    r811f42a rb7dc3d8  
    5555
    5656<screen><userinput remap="install">make install</userinput></screen>
    57 
    58     <para revision="sysv">Finally, move the <command>killall</command> and <command>fuser</command>
    59     programs to the location specified by the FHS:</para>
    60 
    61 <screen revision="sysv"><userinput remap="install">mv -v /usr/bin/fuser   /bin
    62 mv -v /usr/bin/killall /bin</userinput></screen>
    6357
    6458  </sect2>
  • chapter08/readline.xml

    r811f42a rb7dc3d8  
    9595<screen><userinput remap="install">make SHLIB_LIBS="-lncursesw" install</userinput></screen>
    9696
    97     <para revision="sysv">Now move the dynamic libraries to a more appropriate location
    98     and fix up symbolic links:</para>
    99 
    100 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/lib{readline,history}.so.* /lib
    101 ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
    102 ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so</userinput></screen>
    103 
    10497    <para>If desired, install the documentation:</para>
    10598
  • chapter08/shadow.xml

    r811f42a rb7dc3d8  
    119119
    120120<screen><userinput remap="install">make install</userinput></screen>
    121     <!--
    122     <para>Move a misplaced program to its proper location:</para>
    123 
    124 <screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
    125     -->
    126 
    127     <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
    128 
    129 <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
    130 rm -v /lib/libshadow.so
    131 ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
    132121
    133122  </sect2>
  • chapter08/xz.xml

    r811f42a rb7dc3d8  
    6262
    6363<screen><userinput remap="install">make install</userinput></screen>
    64 
    65   <para revision="sysv">Make sure that all essential files are in the
    66   correct directory:</para>
    67 
    68 <screen revision="sysv"><userinput remap="install">mv -v   /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
    69 mv -v   /usr/lib/liblzma.so.* /lib
    70 ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so</userinput></screen>
    7164
    7265  </sect2>
  • chapter08/zlib.xml

    r811f42a rb7dc3d8  
    5858<screen><userinput remap="install">make install</userinput></screen>
    5959
    60     <para revision="sysv">The shared library needs to be moved to
    61     <filename class="directory">/lib</filename>, and as a result the
    62     <filename class="extension">.so</filename> file in
    63     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    64 
    65 <screen revision="sysv"><userinput remap="install">mv -v /usr/lib/libz.so.* /lib
    66 ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></screen>
    67 
    6860    <para>Remove an useless static library:</para>
    6961
  • chapter08/zstd.xml

    r811f42a rb7dc3d8  
    5757    <para>Remove the static library:</para>
    5858<screen><userinput remap="install">rm -v /usr/lib/libzstd.a</userinput></screen>
    59 
    60     <para revision="sysv">Move the shared library to
    61     <filename class="directory">/lib</filename>. Also, the
    62     <filename class="extension">.so</filename> file in
    63     <filename class="directory">/usr/lib</filename> will need to be recreated:</para>
    64 
    65 <screen revision="sysv"><userinput remap="install">
    66 mv -v /usr/lib/libzstd.so.* /lib
    67 ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) /usr/lib/libzstd.so</userinput></screen>
    6859
    6960  </sect2>
Note: See TracChangeset for help on using the changeset viewer.