• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    postinit script changing kernel parameter "fdrive"

    Scheduled Pinned Locked Moved
    FOG Problems
    3
    5
    494
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      WT_101
      last edited by

      Hi,

      I would like to change the Host Primary Disk at postinit script. For example from the Web UI, configura as /dev/sda but during capture or deploy I would like to change it to /dev/sdb at postinit script. May i know how can i achieve this?

      Currently i’m trying with editing /proc/cmdline. Is this the right way to edit the kernel parameter or is there any better alternate ways?

      cat /proc/cmdline > /root/cmdline
      ##replace /root/cmdline content with new fdrive location --> in progress creating the replace script
      mount -n --bind -o ro /root/cmdline /proc/cmdline
      
      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @WT_101
        last edited by

        @wt_101 AFAK you can’t edit the kernel invocation line. That should be a read only attribute. You can only change it before bzImage boots.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        W 1 Reply Last reply Reply Quote 0
        • W
          WT_101 @george1421
          last edited by

          @george1421 said in postinit script changing kernel parameter "fdrive":

          before

          May i know where can i made the changes? It can be done at postinit script too?

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @WT_101
            last edited by

            @wt_101 said in postinit script changing kernel parameter "fdrive":

            May i know where can i made the changes?

            This is difficult to answer. Because when you pick an FOG iPXE menu item or pxe boot into imaging, bzImage and init.xz are transferred to the target computer and then booted. When bzImage is launched it is passed certain kernel parameter which when booted become /proc/cmdline. The /proc file system is not a real file system, but a logical file system created in the kernel’s memory so you can’t change things from the user space in it.

            So why don’t you change, in the host definition for these hosts, there is a field called primary disk which defaults to a blank field. Why not just place /dev/sdb in that primary disk field. That way when that host is booted into imaging, it sends /dev/sdb as a kernel parameter?

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by Sebastian Roth

              @george1421 said in postinit script changing kernel parameter "fdrive":

              AFAK you can’t edit the kernel invocation line.

              @WT_101 While I think George is right on this part I can still see how you might achieve what you want to do by overwriting the fdrive variable within a postinit script. The postinit script is being sourced (ref) instead of called (subshell).

              This is just from brain to keyboard and I have not done any testing. Give it a try and see…

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              217

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project