Oh, should have mentioned this is Knoppix v6.2.1.
I'd like to change the text at the persistent image creation prompt, because some of the users of my live CD find it confusing. (It gives sizes with a suffix, e.g. "400MB", but if you type the size with a suffix, image creation fails silently. I want to change the prompt to make it clear that you have to type in a pure number.) The problem is I'm having trouble finding the script responsible for doing persistent image creation. I've looked at the knoppix init scripts in /etc/init.d, and tried grepping phrases from the prompt, but haven't had any success. Can someone point me in the right direction?
Oh, should have mentioned this is Knoppix v6.2.1.
You can find the init script inside the initial ramdisk minirt.gz. If you need help to extract minirt.gz and recreate it then you should read http://www.knoppix.net/wiki/Knoppix_...up_script_text
Ah, thank you. I think that was the clue I needed.
Why don't you change it to accept both 400 ***AND*** 400MB ?
You can consider using sed to accomplish the job :-
Code:$ echo 400MB | sed "s/[^0-9]//g" 400By using sed, you can extract the number portion of the user input. If the user input something else other than 400MB and 400, you might want to prompt for error.Code:$ echo 400MB | sed "s/[0-9]//g" MB
Thanks for the suggestion. I may just do that. It would have the added benefit of working for any localization, too.
Here's my attempt at a patch. It now accepts "MB" and "GB" as units (non-case-sensitive) and will loop until it gets valid input, is canceled, or times out. I didn't attempt to add error messages because I only speak English, so I wouldn't be able to properly localize them.
Code:--- /mnt/sda1/knx/master/boot/isolinux/minirtdir/init 2010-07-02 12:59:57.000000000 +0000 +++ ./init 2010-07-02 12:48:10.000000000 +0000 @@ -531,12 +531,23 @@ } createdata(){ - local rc size avail + local rc size sizein sizeunits avail avail="$(df -m /mnt-system | awk '{size=$4}END{print size - 1}')" [ "$avail" -ge 200 ] 2>/dev/null || return 2 - runknoppixchroot /usr/bin/dialog --timeout 10 --inputbox "\n${CREATEIMG1}${avail}${CREATEIMG2}\n" 16 75 2>/tmp/knoppix.size; rc="$?" - read size </tmp/knoppix.size; rm -f /tmp/knoppix.size - [ "$rc" = "0" -a "$size" -ge 200 -a "$size" -le "$avail" ] 2>/dev/null || return 3 + until [ "$size" -ge 200 -a "$size" -le "$avail" ] ; do + runknoppixchroot /usr/bin/dialog --timeout 10 --inputbox "\n${CREATEIMG1}${avail}${CREATEIMG2}\n" 16 75 2>/tmp/knoppix.size; rc="$?" + read sizein </tmp/knoppix.size; rm -f /tmp/knoppix.size + [ "x$sizein" = "x" -o "$rc" != "0" ] && return 3 + size="$(echo $sizein | sed 's/[^0-9]//g')" + sizeunits="$(echo $sizein | sed 's/[^A-Za-z]//g' | awk '{print toupper($1)}')" + if [ "x$sizeunits" != "x" ] ; then + if [ $sizeunits = "GB" ] ; then + size=$(($size*1024)) + elif [ $sizeunits != "MB" ]; then + size=0 + fi + fi + done runknoppixchroot /usr/bin/dialog --yes-label "${ENCRYPT}" --no-label "${NO_ENCRYPT}" --defaultno --yesno "${QUESTION_ENCRYPT}" 16 75 2>/dev/null; rc="$?" [ -b /dev/loop0 ] || mknod -m 755 /dev/loop0 b 7 0 [ -d /KNOPPIX-DATA ] || mkdir -m 755 /KNOPPIX-DATA

Intel SRG17 Core i7-9700T Desktop Processor CPU
$74.99
Intel Core i5-4590T 2 GHz 5 GT/s LGA 1150 Desktop CPU Processor SR1S6
$14.99
PS5 Over Heating Problem Solver 1.5 Grams Liquid metal thermal paste CPU, GPU
$15.99
HP ProDesk 405 G8 Desktop AMD Ryzen 5 PRO 5650GE 16GB RAM 512GB SSD W11P
$319.99
Intel Core i7-9700 Octa-Core 3 GHz Desktop Processor LGA 1151
$79.99
AMD Ryzen 5 5600X Desktop Processor (3.7GHz, 6 Cores, AM4 CPU) 100-100000065
$125.00
Intel i7-8700 Coffee Lake 3.2GHz 6-Core Max Turbo 4.6GHz Processor
$69.99
Intel Core i7-7700 Kaby Lake Quad-Core 3.6 GHz Processor LGA 1151
$39.99
Intel Core i5-11500 2.70 GHz LGA 1200 Desktop CPU Processor SRKNY
$94.99
GAMING COMBO: ASUS Prime H470M-PLUS MOTHERBOARD + i5-10600KF CPU + 16GB DDR4
$229.95