View Poll Results: Should knoppix scan for home and config by default?

Voters
10. You may not vote on this poll
  • Yes

    7 70.00%
  • No

    3 30.00%
Results 1 to 4 of 4

Thread: Small patch for knoppix-autoconfig

Hybrid View

  1. #1
    Senior Member registered user
    Join Date
    Aug 2003
    Location
    Dublin, Ireland
    Posts
    164

    Small patch for knoppix-autoconfig

    Currently if you have myconf=scan (or one of the equivalents =scan) then you will get an error message about failing to mount /dev/ as AES256 (really annoying if you've used splash as if seems to lock the machine), the problem being that knoppix-autoconfig doesn't check to see if it found a config and hence tries to mount an invalid point. A small patch to knoppix-autoconfig will sort it out. Find the following section:
    Code:
    MYCONFDIR="$(findfile knoppix.sh)"
    MYCONFDEVICE="${MYCONFDIR##/mnt/}"
    MYCONFDEVICE="/dev/${MYCONFDEVICE%%/*}"
    MYCONFMOUNTPOINT="/mnt/${MYCONFDEVICE##/dev/}"
    MYCONFDIR="${MYCONFMOUNTPOINT}"
    And change it to:
    Code:
    MYCONFDIR="$(findfile knoppix.sh)"
    if [ -n "$MYCONFDIR" ]; then
    MYCONFDEVICE="${MYCONFDIR##/mnt/}"
    MYCONFDEVICE="/dev/${MYCONFDEVICE%%/*}"
    MYCONFMOUNTPOINT="/mnt/${MYCONFDEVICE##/dev/}"
    MYCONFDIR="${MYCONFMOUNTPOINT}"
    else
    FOUND_CONFIG="none"
    fi

  2. #2
    Senior Member registered user
    Join Date
    Aug 2003
    Location
    Dublin, Ireland
    Posts
    164

    One step further, and a timezone bug?

    Well while the above works fine and dandy, if you have scan setup by default but actually you don't want to use any home or conf what do you do? Well why not also add the following patch so you can do home|myconf=no|none!

    Change the home section to
    ___________________________
    [Aa][Uu][Tt][Oo]|[Ss][Cc][Aa][Nn]|[Ff][Ii][Nn][Dd])
    MYHOMEDIR="$(findfile knoppix.img)"
    MYHOMEDEVICE="${MYHOMEDIR##/mnt/}"
    MYHOMEDEVICE="/dev/${MYHOMEDEVICE%%/*}"
    MYHOMEMOUNTPOINT="/mnt/${MYHOMEDEVICE##/dev/}"
    ;;
    [Nn][Oo]|[Nn][Oo][Nn][Ee])
    echo "${GREEN}Home switched off.${NORMAL}"
    ;;
    *)
    echo "${CRE}${RED}Invalid ${CYAN}home=${RED} option '$HOMEDIR' specified (must
    start with /dev/ or /mnt/ or 'scan').${NORMAL}"
    echo "${CRE}${RED}Option ignored.${NORMAL}"
    ;;
    esac
    fi
    ___________________________

    and change the conf section to
    ___________________________
    [Aa][Uu][Tt][Oo]|[Ss][Cc][Aa][Nn]|[Ff][Ii][Nn][Dd])
    MYCONFDIR="$(findfile knoppix.sh)"
    if [-n "$MYCONFDIR" ]; then
    MYCONFDEVICE="${MYCONFDIR##/mnt/}"
    MYCONFDEVICE="/dev/${MYCONFDEVICE%%/*}"
    MYCONFMOUNTPOINT="/mnt/${MYCONFDEVICE##/dev/}"
    MYCONFDIR="${MYCONFMOUNTPOINT}"
    else
    FOUND_CONFIG="none"
    fi
    ;;
    [Nn][Oo]|[Nn][Oo][Nn][Ee])
    echo "${GREEN}Configdir turned off.${NORMAL}"
    FOUND_CONFIG="off"
    ;;
    *)
    echo "${CRE}${RED}Invalid configdir '$MYCONFDIR' specified (must start with /de
    v/ or /mnt/ or 'scan').${NORMAL}"
    echo "${CRE}${RED}Option ignored.${NORMAL}"
    FOUND_CONFIG="invalid"
    ;;
    esac
    ___________________________

    I've also come across what seems to be a problem concerning timezones. I was trying to figure out why my remaster had the time an hour early, even if I was in the right timezone! I think it's because the system clock is set ignorant of the timezone because hwclock is called in knoppix-autoconfig when TZ has not been exported. Now ordering gets tricky so I'm not 100% certain of how this should best be addressed. I think the answer is to export TZ after the tz cheatcode has been picked up (and localtime set) and then run hwclock there, that way it will see the correct TZ (or the best it's going to) when it sets the system clock. I assume there would also be no problem removing the first running of hwclock Sorry I'm posting these before I've tested them (when I can get back to it, tonight or perhaps earlier), but with 3.4 so imminent I wanted to mention them as soon as I came up with/across them.

  3. #3
    Senior Member registered user
    Join Date
    Jun 2003
    Posts
    611
    I did something simialr to this so that it would not prompt the user to try to rescan for the encrypted FS if no persistent home was found where I had set home=scan as a default boot parameter in my remaster, Overclockix.

    Your code is cleaner than mine though.

  4. #4
    Senior Member registered user
    Join Date
    Aug 2003
    Location
    Dublin, Ireland
    Posts
    164

    Re: One step further, and a timezone bug?

    Quote Originally Posted by bfree
    [Aa][Uu][Tt][Oo]|[Ss][Cc][Aa][Nn]|[Ff][Ii][Nn][Dd])
    MYCONFDIR="$(findfile knoppix.sh)"
    if [-n "$MYCONFDIR" ]; then
    MYCONFDEVICE="${MYCONFDIR##/mnt/}"
    Ooops, a small error got in there somehow (no space between [ and -n)! Should be:
    Code:
    [Aa][Uu][Tt][Oo]|[Ss][Cc][Aa][Nn]|[Ff][Ii][Nn][Dd])
    MYCONFDIR="$(findfile knoppix.sh)"
    if [ -n "$MYCONFDIR" ]; then
    MYCONFDEVICE="${MYCONFDIR##/mnt/}"

Similar Threads

  1. Patch on Kernel of Knoppix
    By Frunktz in forum General Support
    Replies: 1
    Last Post: 07-27-2005, 04:08 PM
  2. KDE clock 1 hour off system time - knoppix-autoconfig prob?
    By monkeyman2000 in forum Hdd Install / Debian / Apt
    Replies: 5
    Last Post: 09-19-2004, 06:34 PM
  3. edit knoppix-autoconfig changes file sys to RO ?
    By bigal2000 in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 07-07-2004, 04:53 PM
  4. knoppix-autoconfig
    By farawayuser in forum Customising & Remastering
    Replies: 2
    Last Post: 12-06-2003, 12:28 AM
  5. knoppix-autoconfig does not detect in HD
    By kim in forum General Support
    Replies: 4
    Last Post: 12-05-2003, 04:07 AM

Posting Permissions

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


IBM System X3850-X5 Server w/4x Intel  Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD picture

IBM System X3850-X5 Server w/4x Intel Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD

$1599.99



Unused IBM 09P0037 MAINBOARD For  RS/6000 7044-170 P-Series picture

Unused IBM 09P0037 MAINBOARD For RS/6000 7044-170 P-Series

$375.00



IBM 7915 AC1 M4 E27R704 Server Intel 2650V2 32GB RAM NO HDD w/ 2x 750w PSU picture

IBM 7915 AC1 M4 E27R704 Server Intel 2650V2 32GB RAM NO HDD w/ 2x 750w PSU

$225.00



IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5

IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5" Bay Server No RAM

$179.99



IBM Power 8 S822L Server 8247-22L POWER8 Enterprise 256GB RAM 2x 00KV626 CPU picture

IBM Power 8 S822L Server 8247-22L POWER8 Enterprise 256GB RAM 2x 00KV626 CPU

$999.99



IBM Storwize V5000E V5030E SAN Storage Control Enclosure Server w/ Dual 02PX517 picture

IBM Storwize V5000E V5030E SAN Storage Control Enclosure Server w/ Dual 02PX517

$1249.99



IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES picture

IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES

$110.30



IBM System x3550 M3 1U Server 2x Xeon E5645, 192GB RAM, 2x 300GB HDD (7944-AC1) picture

IBM System x3550 M3 1U Server 2x Xeon E5645, 192GB RAM, 2x 300GB HDD (7944-AC1)

$150.00



IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon  E5620 picture

IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon E5620

$199.99



IBM EMC 091-000-091 17 Inch Rackmount LCD Keyboard KVM Console 03N7012 picture

IBM EMC 091-000-091 17 Inch Rackmount LCD Keyboard KVM Console 03N7012

$109.99