Before antiX hdd install: How to move previously installed OS to bootable stick?

Forum Forums General Tips and Tricks Before antiX hdd install: How to move previously installed OS to bootable stick?

  • This topic has 17 replies, 5 voices, and was last updated Jan 8-7:42 pm by Robin.
Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #45704
    Member
    Robin
      Helpful
      Up
      0
      ::

      And here comes the next version of the script, 0.26

      It will present the serial number of the stick, its USB version and the speed or different speeds it is able to communicate with. For this we use the information the system has got from it while plugging on. Also the USB version of the host plug used and its maximum speed are displayed. The latter had to get derived from its USB-version here, since I didn’t find any entry in which these values are stored in system the same way they are stored about the stick. I presume, when certified for a particular USB standard a hub simply has to understand all the speeds up to the maximum the standard provides.
      For this operation we need to start the script with sudo from now on, since lsusb command will not work properly without root permissions. Well, for the next tasks we would have needed this anyway.

      From now on I’ll paste the checksum of the script, just in case some protective filters replaces some signs within it while uploading, and then one couldn’t tell what comes out of it when starting. So just make sure to check this after downloading:

      Open a console window and cd to the folder where you have placed the downloaded archive file (…tar.gz), extract it.

      
      	cd ~/path/to/your/downloadfolder
      	tar -zxf tell-device-026.tar.gz
      	ls tell-device*
      

      you should find the script ending with the letters “.sh” aside from the archive ending “…tar.gz”

      now copy this check-line (valid for ver. 0.26 only):
      echo "8591ed6db01c0e1ed4be6787e46e44314c7ed470feef5103ef562708512083b2 tell-device.sh" | shasum -a 256 -c -
      into your commandline and execute it. Shasum is a standard veicle tool, a checksum program which computes a checksum to identify a file unambiguous. (EDIT: please put an extra blank between the letter-and-numeral-jam and the t of tell-device since there need be two blanks to make this work, our board seems to have some appetite to eat one of them while displaying, so copying and executing the line you will get an complaint about a malformatted checksum line only when not adding the blank again.)

      This will produce hopefully an “OK”. In this case you can be sure by now there is nothing got wrong with the download and you have an exact copy of what I’ve written into it.

      If you’d like to get a feeling about what it looks like in case checksum and file don’t match (which is true when there would be exchanged a single sign within the script-file on transportation) you can noodle around a little:
      echo "#" >> tell-device.sh
      which will add a line containing a “#”-Sign (marking an aditional comment) right at the end of the script, so it is modified by one single sign only now.

      And then paste the check-line from above again (EDIT don’t forget the extra blank!), and we’ll wait and see what happens. This time hopefully you’ll get a massive warning.

      To get the original script back, we’ll remove this sharp sign again (even if it wouldn’t do any harm, anyway):
      sed -i '$ d' tell-device.sh

      And for a third time paste the check-line from above and, voilà, it should pass the test again. If not, dont care, delete the noodled copy and extract it again from the downloaded archive, check it again.

      This method is also engaged by linux package-management (e.g. apt, and that one which you’ll find in antiX controlcenter also), every single package you get from the servers is checked this way without notice by your package-management system.
      So you should make a confirmed habit to check any exacutable file you download manually from somewhere by its sha-checksum, if you can grab it. The checksum might be presented as a checksum-file as well, and maybe it is given in more weak “md5” algorithm instead of “sha”.

      You dont’t need to be root for all this (actually you should never be root when not explicitly requested for a particular task.)

      and now make sure the script is executable:
      ls -l tell-device.sh
      should give something as
      -rwxr-xr-x 1 demo demo 28092 Nov 22 12:20 tell-device.sh
      the interessting part is the pattern right in the beginning. Ignore the first dash and check whether it runs “rwxr-xr-x”. If you find something else instead, key in
      chmod u=rwx,g=rx,o=rx tell-device.sh
      after which the command from above should present the result as expected.

      And now you may start the script by typing
      /bin/bash tell-device.sh -h
      Merly presenting help doesn’t need sudo, In order to get some information indeed, type
      sudo /bin/bash tell-device.sh
      Make sure you have an USB-stick within reach (if not, never mind, script will stop then anyway)

      More to come soon, it’s in pipeline already. Let come some rainy days only…

      ————
      EDIT:

      Accidentally I’ve left one line from my very last language-checking not commented out in this scriptfile (ver.026), so it’ll display in french language only. It seems I can’t replace the upload here, so you’ll have to fix this on your own:

      In order to fix it please open the script using “geany” editor from antiX menu and put a sharp sign “#” right at the beginning of line 46, which runs

      UI_LANGUAGE="fr" # <--- activate this line for testing purposes only. It'll overwrite the setting we have got from the system before. Set the value between the quotation marks equal to the desired language identifier of which you'd like to check program messages running the program.

      so it looks like this afterwards

      #UI_LANGUAGE="fr" # <--- activate this line for testing purposes only. It'll overwrite the setting we have got from the system before. Set the value between the quotation marks equal to the desired language identifier of which you'd like to check program messages running the program.

      and save (write) file to disk again. Don’t touch anything else. After that correction the script file will have a new checksum: “d51e49491a73a95cf0a8c582ce146a894dc92d028313407f289bf33a8b5618e0” in case you’d like to check whether you have been successful.
      By all means, you’ll get normal operation after this, which means english and german versions will turn up according to your system language settings again.

      Sorry for the disagreeability.

      • This reply was modified 2 years, 5 months ago by Robin. Reason: bugfix
      • This reply was modified 2 years, 5 months ago by Robin.
      • This reply was modified 2 years, 5 months ago by Robin.

      Windows is like a submarine. Open a window and serious problems will start.

      #46196
      Member
      Robin
        Helpful
        Up
        0
        ::

        New version: 0.27
        it features a more convenient way of waiting until stick is plugged. And I just found out the script works with external USB real hard disk drives as well, so not only USB-sticks are supported (thought before it should do so, but had just now the chance to check).

        After extracting archive you can check script file using the command (detailled instructions in post above).

        
        echo "ca459076210c5a80eab615467ab572477febad4e88929c2c23a11377a149c8cd  tell-device.sh" | shasum -a 256 -c -
        

        previsions: in one of the next versions I ‘ll find a way to get rid of sudoing the complete script, since most things used and done in there actually shouldn’t be run as root. Invoking only single commands inside script using sudo will fix this, I’m just testing different approaches.

        have fun with it
        Robin

        • This reply was modified 2 years, 5 months ago by Robin. Reason: double blank this time works fine so no hint for users to add one necessery

        Windows is like a submarine. Open a window and serious problems will start.

        #49388
        Member
        Robin
          Helpful
          Up
          0
          ::

          Bump 028 and 029b versions. Wait for 030er versions for some additional bugfixes.

          Windows is like a submarine. Open a window and serious problems will start.

        Viewing 3 posts - 16 through 18 (of 18 total)
        • You must be logged in to reply to this topic.