Results 1 to 7 of 7

Thread: Script for saving changes to a live usb stick / sdcard

Hybrid View

  1. #1
    Junior Member cleguevara's Avatar
    Join Date
    Dec 2007
    Posts
    97

    Default Script for saving changes to a live usb stick / sdcard

    I've written a little script for my eee in order to save the changes to my sd-card... (the merging issue mentioned in the BT-HowTo is integrated, too)


    #!/bin/bash
    #Author: cleguevara
    #Version: 0.2


    #-------determine on which device the flash-storage is---------
    FLASHSTORAGE=""
    #(I know the following is VERY inefficient and especially SLOW...)
    slocate -u
    FLASHSTORAGE=$(slocate BT3 |grep sd |grep live |grep root.lzm |cut -d '/' -f 5)

    #to set the flash-storage manually comment the above lines and uncomment the following one after typing in your device
    #FLASHSTORAGE=


    #--------------------save the changes----------------------
    dir2lzm /mnt/live/memory/changes new-changes.lzm
    mkdir /tmp/changestmp
    lzm2dir /mnt/$FLASHSTORAGE/BT3/modules/changes.lzm /tmp/changestmp
    lzm2dir new-changes.lzm /tmp/changestmp
    dir2lzm /tmp/changestmp changes.lzm
    mv /mnt/$FLASHSTORAGE/BT3/modules/changes.lzm /mnt/$FLASHSTORAGE/BT3/changes.lzm.bak
    mv changes.lzm /mnt/$FLASHSTORAGE/BT3/modules/


    Don't forget to chmod 755 the script
    It would be great if anyone points me to a simpler solution for determining the device name of the usb-stick/sd-card/flash-storage

  2. #2
    Developer
    Join Date
    Mar 2007
    Posts
    6,126

    Default

    Why not make a save changes partition like every one else?

  3. #3
    Junior Member cleguevara's Avatar
    Join Date
    Dec 2007
    Posts
    97

    Default

    It's nice to get back to a working BT3 after realizing that all got screwed up ;-).
    And with the changes module it's simpler to make an exact copy of the configuration by just copying the file to another media where BT3 is installed

  4. #4
    Developer
    Join Date
    Mar 2007
    Posts
    6,126

    Default

    When you have two partitions, one with the bt3 base install and a second with all your changes, what could be easier than wiping out the whole save changes partition and rebooting. Simply copy your changes partition every now and then for a back up. Don't get me wrong I appreciate you sharing your script however I was just wondering why not do it the way backtrack was designed to do it.

  5. #5
    Junior Member cleguevara's Avatar
    Join Date
    Dec 2007
    Posts
    97

    Default

    I thought about "screwing it up" before running the script that time... so you're just start at the point of your last reboot. But while I' think about it, it would make sense to backup the old changes.lzm before copying the new one... I'll edit it accordingly

  6. #6
    Developer
    Join Date
    Mar 2007
    Posts
    6,126

    Default

    I think your missing my point. There is no need for the .lzm at all if you have a separate partition for changes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •