Results 1 to 7 of 7

Thread: persistent image on dvd

Hybrid View

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    9
    Quote Originally Posted by klaus2008 View Post
    You can find a file called KNOPPIX-CHEATCODES.TXT in the KNOPPIX directory of the Knoppix V6.2 CD. It has an interesting section
    I think you should save your customizations in a file update01.tar.gz using the tar program and place that file in the KNOPPIX directory before you burn your new DVD.
    thanks! that looks like an excellent approach, and one that i missed while reading the init script.

    as i reported on the thread http://www.knoppix.net/forum/threads...nt-disk-images i have been successful now with this approach using the knoppix-data.img data files (after mounting the image and "tarring" the contents), but only after removing the "dot-wh-dot" entries first. apparently this approach to the dot-wh-dot entries is not the best way forward however (see above mentioned thread).

    while tinkering with this myself i came up with a different approach, which has some benefits and some drawbacks as compared to the "update*.tar.gz" approach:

    one drawback to my approach is that it requires a hacked init script (inside minirt.gz).

    but once this is in place, the knoppix-data.img files can be used on read-only media without modification.

    i have done only basic testing of this patch, but so far it seems to work as prescribed. perhaps someone more knowledgeable will see some problems i have missed. but in case it seems useful to anyone, here are the modifications i made:

    sincerely,
    proctor


    Code:
    --- arst/init	2010-10-26 04:09:31.568928798 +0000
    +++ initramfs/init	2010-10-26 15:35:05.007733846 +0000
    @@ -571,15 +571,19 @@ createdata(){
      return 1
     }
     
    +IS_DATA_MEDIUM_WRITEABLE="ro"
    +
     mountdata(){
    - local img base ext m mods found=""
    + local img base ext m mods found="" IS_DATA_MEDIUM_WRITEABLE_MASK="555"
      for base in /mnt-system/"$knoppix_dir"/knoppix-data /mnt-system/knoppix; do
       for ext in aes img; do
        img="$base.$ext"
        [ -r "$img" ]        || continue
    +   IS_DATA_MEDIUM_WRITEABLE="ro"
    +   stat -c %A "${img}" | grep -iE 'w' > /dev/null && IS_DATA_MEDIUM_WRITEABLE="rw" && IS_DATA_MEDIUM_WRITEABLE_MASK="755"
        message -e "\r${CRE}${GREEN}${USING} ${YELLOW}$img${NORMAL}"
        [ -b /dev/loop0 ]    || mknod -m 755 /dev/loop0 b 7 0
    -   [ -d /KNOPPIX-DATA ] || mkdir -m 755 /KNOPPIX-DATA
    +   [ -d /KNOPPIX-DATA ] || mkdir -m "${IS_DATA_MEDIUM_WRITEABLE_MASK}" /KNOPPIX-DATA
        found="true"
        case "$ext" in
         aes)
    @@ -595,8 +599,8 @@ mountdata(){
           [ "$try" -gt 1 ] && echo -n "${CYAN}(#$try/3) "
           if runknoppixlib /sbin/losetup -e aes -k 256 /dev/loop0 "$img"; then
            echo -n "$NORMAL"
    -       runknoppixlib /sbin/e2fsck -y /dev/loop0 >/dev/null 2>&1
    -       mount -t ext2 -o rw /dev/loop0 /KNOPPIX-DATA && return 0
    +       [[ "${IS_DATA_MEDIUM_WRITEABLE}" == "rw" ]] && runknoppixlib /sbin/e2fsck -y "$img" >/dev/null 2>&1
    +       mount -t ext2 -o "${IS_DATA_MEDIUM_WRITEABLE}" /dev/loop0 /KNOPPIX-DATA && return 0
           fi
           echo -n "$NORMAL"
           losetup -d /dev/loop0 >/dev/null 2>&1
    @@ -604,8 +608,8 @@ mountdata(){
          done
         ;;
         *)
    -     runknoppixlib /sbin/e2fsck -y "$img" >/dev/null 2>&1
    -     mount -t ext2 -o loop,rw "$img" /KNOPPIX-DATA && return 0
    +     [[ "${IS_DATA_MEDIUM_WRITEABLE}" == "rw" ]] && runknoppixlib /sbin/e2fsck -y "$img" >/dev/null 2>&1
    +     mount -t ext2 -o loop,"${IS_DATA_MEDIUM_WRITEABLE}" "$img" /KNOPPIX-DATA && return 0
          losetup -d /dev/loop0 >/dev/null 2>&1
         ;;
        esac
    @@ -647,11 +651,17 @@ mountknoppix(){
     }
     
     mountunion(){
    - local dir tree=""
    + local dir tree="" media writeable
      for dir in /KNOPPIX /KNOPPIX[0-7]; do
       [ -d "$dir" ] && tree="$dir=ro${tree:+:$tree}"
      done
    - mount -t aufs -o "br:$1=rw:$tree,noplink" unionfs /UNIONFS
    + for media in "${@}"
    + do
    +  writeable="ro"
    +  mount | grep -iE "${media}.*\(rw," > /dev/null && writeable="rw"
    +  [[ -d "${media}" ]] && tree="$media=$writeable${tree:+:$tree}"
    + done
    + mount -t aufs -o "br:$tree,noplink" unionfs /UNIONFS
      return $?
     }
     
    @@ -659,7 +669,12 @@ if mountknoppix; then # compressed
      checkbootparam "debug" && debugshell "Past mounting /KNOPPIX."
      if ! checkbootparam "noimage" && mountdata; then
       checkbootparam "debug" && debugshell "Past mounting /KNOPPIX-DATA."
    -  mountunion /KNOPPIX-DATA
    +  if [[ "${IS_DATA_MEDIUM_WRITEABLE}" == "ro" ]]
    +  then
    +   mountunion /KNOPPIX-DATA /ramdisk ### make sure the writeable branch is last argument for aufs filo tree construction (see function mountunion)
    +  else
    +   mountunion /KNOPPIX-DATA
    +  fi
      else
       mountunion /ramdisk
      fi

  2. #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    9
    Quote Originally Posted by proctor View Post

    i have done only basic testing of this patch, but so far it seems to work as prescribed. perhaps someone more knowledgeable will see some problems i have missed. but in case it seems useful to anyone, here are the modifications i made:
    i should also mention that the above patch is for the 6.2.1 init script

Posting Permissions

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


10 PCS Cisco GLC-LH-SMD 10-2625-01 1310nm SFP Transceiver Module picture

10 PCS Cisco GLC-LH-SMD 10-2625-01 1310nm SFP Transceiver Module

$85.00



Brand New Cisco GLC-LH-SMD 1000BASE-LX/LH SFP Module 1310nm 10km SMF LC picture

Brand New Cisco GLC-LH-SMD 1000BASE-LX/LH SFP Module 1310nm 10km SMF LC

$10.99



ProLabs 10GBase-TX SFP+ RJ-45 Copper Transceiver Module P/N: SFP-10GBASE-T-C picture

ProLabs 10GBase-TX SFP+ RJ-45 Copper Transceiver Module P/N: SFP-10GBASE-T-C

$19.99



NEW Open Box Dell PowerConnect M8024-SFP+ Quad Port 10GbE SFP Module 0N805D (BH) picture

NEW Open Box Dell PowerConnect M8024-SFP+ Quad Port 10GbE SFP Module 0N805D (BH)

$29.99



Lot of 10 - HP 10Gb SR SFP+ Transceiver 455883-B21 455885-001 456096-001 850nm picture

Lot of 10 - HP 10Gb SR SFP+ Transceiver 455883-B21 455885-001 456096-001 850nm

$25.99



Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03  picture

Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03

$8.00



Cisco SFP-10G-SR  SFP+ MMF 10GBase-SR 850nm Transceiver Module 1 Year Warranty picture

Cisco SFP-10G-SR SFP+ MMF 10GBase-SR 850nm Transceiver Module 1 Year Warranty

$28.49



SFP-H10GB-CU3M Cisco 10GB SFP+ Twinax Copper 3M Passive Cable  picture

SFP-H10GB-CU3M Cisco 10GB SFP+ Twinax Copper 3M Passive Cable

$7.99



New Cisco w/ Green Hologram GLC-LH-SMD 1G SFP LX 1310nm 10km SMF LC Module picture

New Cisco w/ Green Hologram GLC-LH-SMD 1G SFP LX 1310nm 10km SMF LC Module

$16.99



New Cisco w/ Green Hologram SFP-25G-SR-S 25G SFP28 SR 850nm 300m LC MMF Module picture

New Cisco w/ Green Hologram SFP-25G-SR-S 25G SFP28 SR 850nm 300m LC MMF Module

$69.99