Linux.com

langerak

langerak

  • Linux.com Member
  • Posts: 15
  • Member Since: 07 Jun 09
  • Last Logged In: 19 Mar 12

Latest Posts

Posted by
Topic
Post Preview
Posted
  • langerak
    RE: Help function of "dialog"
    That's possible, I'm only pasting the part of what's relevant, since it's a huge script by now :) [code]#!/bin/bash escaper() { action=$? if [ $action = 1 -o $action = 255 ]; then dialog --title "$title" --yesno "\nAre you sure you want to quit?" 7 35 sure=$? if [ $sure = 0 ]; then clear exit fi fi } genhour() { genhour=9 hour=$RANDOM let "hour %= $genhour" } genminute() { genminute=59 minute=$RANDOM let "minute %= $genminute" } pid=$(echo $$) if [ -z $1 ]; then genhour genminute dialog --backtitle "$backtitle" --title "$title" --keep-window --form "\nYour Backup Account Details\n" 20 60 0 \ "Username....:" 1 1 "" 1 15 14 0 \ "Password....:" 2 1 "" 2 15 14 0 \ "Server......:" 3 1 "" 3 15 30 0 \ "Backup root.:" 4 1 "/" 4 15 30 0 \ "Weeks.......:" 5 1 "0" 5 15 2 0 \ "Months......:" 6 1 "0" 6 15 2 0 \ "MySQL dumps.:" 7 1 "$mysqldumps" 7 15 1 0 \ "SQL Dir.....:" 8 1 "/var/sqlbackups/" 8 15 30 0 \ "Cron (HH)...:" 9 1 "$hour" 9 15 2 0 \ "Cron (MM)...:" 10 1 "$minute" 10 15 2 0 \ "Logging.....:" 11 1 "Y" 11 15 1 0 \ "Email log...:" 12 1 "N" 12 15 1 0 \ "Emailaddress:" 13 1 "" 13 15 30 0 2> /tmp/$pid-options escaper choice=$? array=( `cat /tmp/$pid-options `) if [ -f /tmp/$pid-options ]; then rm /tmp/$pid-options > /dev/null 2> /dev/null fi while ! [ ${#array[@]} = 13 ] do dialog --backtitle "$backtitle" --title "$title" --msgbox "\nNot all fields are populated!\n\nPlease make sure you fill in all the fields." 10 50; clear genhour genminute dialog --backtitle "$backtitle" --title "$title" --keep-window --form "\nYour Backup Account Details\n" 20 60 0 \ "Username....:" 1 1 "" 1 15 14 0 \ "Password....:" 2 1 "" 2 15 14 0 \ "Server......:" 3 1 "" 3 15 30 0 \ "Backup root.:" 4 1 "$defaultbackuppath" 4 15 30 0 \ "Weeks.......:" 5 1 "0" 5 15 2 0 \ "Months......:" 6 1 "0" 6 15 2 0 \ "MySQL dumps.:" 7 1 "$mysqldumps" 7 15 1 0 \ "SQL Dir.....:" 8 1 "/var/sqlbackups/" 8 15 30 0 \ "Cron (HH)...:" 9 1 "$hour" 9 15 2 0 \ "Cron (MM)...:" 10 1 "$minute" 10 15 2 0 \ "Logging.....:" 11 1 "Y" 11 15 1 0 \ "Email log...:" 12 1 "N" 12 15 1 0 \ "Emailaddress:" 13 1 "" 13 15 30 0 2> /tmp/$pid-options escaper choice=$? array=( `cat /tmp/$pid-options `) if [ -f /tmp/$pid-options ]; then rm /tmp/$pid-options > /dev/null 2> /dev/null fi done fi[/code] As you can see, it's showing a message if the array is not completely filled. I want that window on top of the original box, so if a user selects OK, it returns to the original window, keeping the fields with their input. As stated before, it's not the complete code, but enough to run :). Should you need more, let me know. And indeed, the manpage on dialog is very limited...
    Link to this post 29 Nov 11

    That's possible, I'm only pasting the part of what's relevant, since it's a huge script by now :)

    #!/bin/bash
    escaper()
    {
    action=$?
    if [ $action = 1 -o $action = 255 ];
    then
    dialog --title "$title" --yesno "\nAre you sure you want to quit?" 7 35
    sure=$?
    if [ $sure = 0 ];
    then
    clear
    exit
    fi
    fi
    }
    genhour()
    {
    genhour=9
    hour=$RANDOM
    let "hour %= $genhour"
    }
    genminute()
    {
    genminute=59
    minute=$RANDOM
    let "minute %= $genminute"
    }
    pid=$(echo $$)
    if [ -z $1 ];
    then
    genhour
    genminute
    dialog --backtitle "$backtitle" --title "$title" --keep-window --form "\nYour Backup Account Details\n" 20 60 0 \
    "Username....:" 1 1 "" 1 15 14 0 \
    "Password....:" 2 1 "" 2 15 14 0 \
    "Server......:" 3 1 "" 3 15 30 0 \
    "Backup root.:" 4 1 "/" 4 15 30 0 \
    "Weeks.......:" 5 1 "0" 5 15 2 0 \
    "Months......:" 6 1 "0" 6 15 2 0 \
    "MySQL dumps.:" 7 1 "$mysqldumps" 7 15 1 0 \
    "SQL Dir.....:" 8 1 "/var/sqlbackups/" 8 15 30 0 \
    "Cron (HH)...:" 9 1 "$hour" 9 15 2 0 \
    "Cron (MM)...:" 10 1 "$minute" 10 15 2 0 \
    "Logging.....:" 11 1 "Y" 11 15 1 0 \
    "Email log...:" 12 1 "N" 12 15 1 0 \
    "Emailaddress:" 13 1 "" 13 15 30 0 2> /tmp/$pid-options
    escaper
    choice=$?
    array=( `cat /tmp/$pid-options `)
    if [ -f /tmp/$pid-options ];
    then
    rm /tmp/$pid-options > /dev/null 2> /dev/null
    fi
    while ! [ ${#array[@]} = 13 ]
    do
    dialog --backtitle "$backtitle" --title "$title" --msgbox "\nNot all fields are populated!\n\nPlease make sure you fill in all the fields." 10 50; clear
    genhour
    genminute
    dialog --backtitle "$backtitle" --title "$title" --keep-window --form "\nYour Backup Account Details\n" 20 60 0 \
    "Username....:" 1 1 "" 1 15 14 0 \
    "Password....:" 2 1 "" 2 15 14 0 \
    "Server......:" 3 1 "" 3 15 30 0 \
    "Backup root.:" 4 1 "$defaultbackuppath" 4 15 30 0 \
    "Weeks.......:" 5 1 "0" 5 15 2 0 \
    "Months......:" 6 1 "0" 6 15 2 0 \
    "MySQL dumps.:" 7 1 "$mysqldumps" 7 15 1 0 \
    "SQL Dir.....:" 8 1 "/var/sqlbackups/" 8 15 30 0 \
    "Cron (HH)...:" 9 1 "$hour" 9 15 2 0 \
    "Cron (MM)...:" 10 1 "$minute" 10 15 2 0 \
    "Logging.....:" 11 1 "Y" 11 15 1 0 \
    "Email log...:" 12 1 "N" 12 15 1 0 \
    "Emailaddress:" 13 1 "" 13 15 30 0 2> /tmp/$pid-options
    escaper
    choice=$?
    array=( `cat /tmp/$pid-options `)
    if [ -f /tmp/$pid-options ];
    then
    rm /tmp/$pid-options > /dev/null 2> /dev/null
    fi
    done
    fi

    As you can see, it's showing a message if the array is not completely filled. I want that window on top of the original box, so if a user selects OK, it returns to the original window, keeping the fields with their input.

    As stated before, it's not the complete code, but enough to run :). Should you need more, let me know. And indeed, the manpage on dialog is very limited...

  • langerak
    RE: Help function of "dialog"
    Hmm, I haven't thought about that strategy yet. Though it is a bit cumbersome, especially when handling multiple actions and various dialog boxes. I would have to think about a good strategy for that. Another question, if I read the help correctly, it should be possible to keep the originating window and place the help window on top of that. Do you have any idea to accomplish this? Thanks already for your help!
    Link to this post 28 Nov 11

    Hmm, I haven't thought about that strategy yet. Though it is a bit cumbersome, especially when handling multiple actions and various dialog boxes. I would have to think about a good strategy for that.

    Another question, if I read the help correctly, it should be possible to keep the originating window and place the help window on top of that. Do you have any idea to accomplish this?

    Thanks already for your help!

  • langerak
    Help function of "dialog"
    Hi all, I'm currently writing some bash scripts using the "dialog" functionality to enhance the user experience on the command line. All is going well, but there is one problem I cannot sort out and little info is found via Google, that is, the help system of dialog. There are options to show a help button and when the user selects it, the corresponding help text appears. I can get the button to shop up, but there is no documentation on how to show the corresponding help text into a box. Dialog just quits with "HELP:". Does anyone here on the forums have any usable knowledge about the help functionality of dialog and is willing to help me out? Thanks in advance and should you need more information, please ask, so I can supply it.
    Link to this post 28 Nov 11

    Hi all,

    I'm currently writing some bash scripts using the "dialog" functionality to enhance the user experience on the command line.

    All is going well, but there is one problem I cannot sort out and little info is found via Google, that is, the help system of dialog. There are options to show a help button and when the user selects it, the corresponding help text appears.
    I can get the button to shop up, but there is no documentation on how to show the corresponding help text into a box. Dialog just quits with "HELP:<helpname>".

    Does anyone here on the forums have any usable knowledge about the help functionality of dialog and is willing to help me out?

    Thanks in advance and should you need more information, please ask, so I can supply it.

  • langerak
    RE: Using debootstrap for install X86 -> ARM
    Well, 1 week later and still haven't got any progress in this... Maybe this won't work after all? Some ppl say that they did manage to install Debian on it and some say it's not possible due to the kernel being flashed into ROM. As said before, i am now able to chroot within the LaCie linux, so chrooting into Ubuntu is what i can do. Since this is working, now i need a way to install a kernel into it and modify it so that U-Boot can boot off it. Or even better. Make an image which i can put on the harddisk (dd or partimage), put the disk back in the LaCie and let it boot. Any suggestions or tips? Still want to make this work! :D
    Link to this post 22 Feb 10

    Well, 1 week later and still haven't got any progress in this...

    Maybe this won't work after all? Some ppl say that they did manage to install Debian on it and some say it's not possible due to the kernel being flashed into ROM.

    As said before, i am now able to chroot within the LaCie linux, so chrooting into Ubuntu is what i can do.

    Since this is working, now i need a way to install a kernel into it and modify it so that U-Boot can boot off it. Or even better. Make an image which i can put on the harddisk (dd or partimage), put the disk back in the LaCie and let it boot.

    Any suggestions or tips? Still want to make this work! :D

  • langerak
    RE: Linux OS install
    [b]wrboblis wrote:[/b] [quote]New problem - creating ext3 file system in partition FAILED. I'm stumped[/quote] Mostly due to a faulty harddrive, had that problem a while ago as well with a drive which was working ok with Windows, except when formatting it to ext3, it failed. You could also try installing it on a SD card, a 4 Gb (or bigger) card should do well enough for a regular desktop and some testing. Make sure your computer can boot from USB :). It might not be as fast as a normal harddisk, but you can play around and if you're done with it, you can reformat the card and use it for other purposes :). When installing on the card, keep in mind which device the SD card is. I.e. internal HD is SDA etc. You need to remember that to install a bootloader on the SD card, place it on the root of that drive. Good luck!
    Link to this post 13 Feb 10

    wrboblis wrote:

    New problem - creating ext3 file system in partition FAILED. I'm stumped

    Mostly due to a faulty harddrive, had that problem a while ago as well with a drive which was working ok with Windows, except when formatting it to ext3, it failed.

    You could also try installing it on a SD card, a 4 Gb (or bigger) card should do well enough for a regular desktop and some testing. Make sure your computer can boot from USB :). It might not be as fast as a normal harddisk, but you can play around and if you're done with it, you can reformat the card and use it for other purposes :).
    When installing on the card, keep in mind which device the SD card is. I.e. internal HD is SDA etc. You need to remember that to install a bootloader on the SD card, place it on the root of that drive.

    Good luck!

  • langerak
    RE: Using debootstrap for install X86 -> ARM
    Hi, Thanks for the info and support so far :)! I already voided my warranty, as i got it from my work, which bought it 2 years ago, so no warranty left :). I modified in such ways that i have SSH access on the box and i have made a 1:1 copy of the entire distribution to a old S-ATA disk, so if install fails i always can roll back. I found some info as well, the bootloader is U-Boot and the partition scheme default is this: SDA1 -> EXT3 with BOOT flag, about 3Gb SDA2 -> SWAP (512 Mb) SDA3 -> EXT3 that holds the userfiles (the space you see as available) SDA4 -> Extended partition (90 Mb) SDA5 -> Unformatted (16 Mb) SDA6 -> Unformatted (8 Mb) SDA7 -> EXT3, that holds the boot kernel (if this partition is not available it won't boot at all) My guess is that there is some link in uboot to boot from the 1st partition, which automatically links to the 7th partition in order to boot and then switch back to the 1st partition to load config files etc. Is it possible to copy the debootstrapped system to the LaCie and then in fstab let it mount to it on /proc instead of the LaCie system proc? Should kernels be the same or won't that matter in this part? I also found out that there is a RS232 / JTAG interface soldered onto the main board, which can be hooked up with a Nokia DKU5 USB cable LOL! With that cable linked you can command U-Boot! I've shot 3 photo's of the main board, for reference, the board says ED MINI V2, altho, the V2 has a USB B connector for connection with a PC, and mine does not have any (which only the V1 had), strange? Maybe it's a refurb? Another strange thing is that the V2 uses XFS by default (according to LaCie) and mine uses EXT3 (also the V1 specifications...). Strangely the only thing that does seem to be true is the CPU, the ARM9, which was a PPC on V1. Also V1 had 32 Mb RAM and mine has 64 Mb. http://langerak.ath.cx/downloads/lacie (for photo's) Ok, another edit: I've managed to do a debootstrap for the ARM arch. Tarred the stuff, scp'ed it to the LaCie (with the LaCie software running). Untarred it, copied chroot to /usr/sbin and now i am able to chroot into the minimal Debian system :D. I ran debootstraps secpnd stage and got it minimally working :). Only the supplied rm executable was faulty, copied that from the LaCie system into the debian chroot and now i can install lot's of software offcourse. By the way, you said it would be trivial, is it manageable to install Linux on it? I like to learn alot from this process and really try to get this to work, but do you think it'll ever work the way i want it?
    Link to this post 13 Feb 10

    Hi,

    Thanks for the info and support so far :)!

    I already voided my warranty, as i got it from my work, which bought it 2 years ago, so no warranty left :).
    I modified in such ways that i have SSH access on the box and i have made a 1:1 copy of the entire distribution to a old S-ATA disk, so if install fails i always can roll back.

    I found some info as well, the bootloader is U-Boot and the partition scheme default is this:
    SDA1 -> EXT3 with BOOT flag, about 3Gb
    SDA2 -> SWAP (512 Mb)
    SDA3 -> EXT3 that holds the userfiles (the space you see as available)
    SDA4 -> Extended partition (90 Mb)
    SDA5 -> Unformatted (16 Mb)
    SDA6 -> Unformatted (8 Mb)
    SDA7 -> EXT3, that holds the boot kernel (if this partition is not available it won't boot at all)

    My guess is that there is some link in uboot to boot from the 1st partition, which automatically links to the 7th partition in order to boot and then switch back to the 1st partition to load config files etc.

    Is it possible to copy the debootstrapped system to the LaCie and then in fstab let it mount to it on /proc instead of the LaCie system proc? Should kernels be the same or won't that matter in this part?

    I also found out that there is a RS232 / JTAG interface soldered onto the main board, which can be hooked up with a Nokia DKU5 USB cable LOL! With that cable linked you can command U-Boot!

    I've shot 3 photo's of the main board, for reference, the board says ED MINI V2, altho, the V2 has a USB B connector for connection with a PC, and mine does not have any (which only the V1 had), strange? Maybe it's a refurb?
    Another strange thing is that the V2 uses XFS by default (according to LaCie) and mine uses EXT3 (also the V1 specifications...).
    Strangely the only thing that does seem to be true is the CPU, the ARM9, which was a PPC on V1. Also V1 had 32 Mb RAM and mine has 64 Mb.
    http://langerak.ath.cx/downloads/lacie (for photo's)

    Ok, another edit:
    I've managed to do a debootstrap for the ARM arch. Tarred the stuff, scp'ed it to the LaCie (with the LaCie software running). Untarred it, copied chroot to /usr/sbin and now i am able to chroot into the minimal Debian system :D. I ran debootstraps secpnd stage and got it minimally working :). Only the supplied rm executable was faulty, copied that from the LaCie system into the debian chroot and now i can install lot's of software offcourse.

    By the way, you said it would be trivial, is it manageable to install Linux on it? I like to learn alot from this process and really try to get this to work, but do you think it'll ever work the way i want it?

  • langerak
    RE: Using debootstrap for install X86 -> ARM
    Thanks for your reply! It looks very useful, but i have a question about it: The device does not have a screen or keyboard to attach to it, but i've read the EmDebian howto and it's focussed on the fact that the device should boot from NFS, which i think the LaCie box does not support, or am i getting something wrong? I've set up the first stage of debootstrap, which leaves me with a folder with basic Debian installed, i need to copy it over and do a chroot, but i can't chroot on the LaCie box, since it has not that utility, so there i am stuck again :(. The howto speaks of QEMU, however, nowhere in the tutorial it is being used. Should i create a ARM VM in QEMU and then run the processes again?
    Link to this post 10 Feb 10

    Thanks for your reply!

    It looks very useful, but i have a question about it:

    The device does not have a screen or keyboard to attach to it, but i've read the EmDebian howto and it's focussed on the fact that the device should boot from NFS, which i think the LaCie box does not support, or am i getting something wrong?

    I've set up the first stage of debootstrap, which leaves me with a folder with basic Debian installed, i need to copy it over and do a chroot, but i can't chroot on the LaCie box, since it has not that utility, so there i am stuck again :(.

    The howto speaks of QEMU, however, nowhere in the tutorial it is being used.

    Should i create a ARM VM in QEMU and then run the processes again?

  • langerak
    Using debootstrap for install X86 -> ARM
    Hi all! At work they gave me the following task (and i need some help from you guys!): At work we have a normal PC running Ubuntu 9.10 (32-bit), which works good. We also have a LaCie Ethernet Disk Mini v2, which runs embedded Linux (RedHat), but is so trimmed down, you can't use the disk we would like to use it. The task is this: On the X86 machine, make a bootable image for the ARM architecture and write it to a harddisk (which fits the LaCie offc.) so it can boot off it. Now i have done some investigation, but don't know how to combine it all: - I can use debootstrap to create a minimal Debian system, but there comes the problem, you can't chroot into a foreign created system (i.e. X86 cannot chroot into ARM system). - I can use QEMU, which can emulate a ARM processor, but can i use the image that QEMU uses as a normal image for a harddisk, so it would boot off it (when using dd to write it to a real harddisk)? - Current kernels support the LaCie hardware (Marvell chipset) - I know how to use tools such as dd, so if the image is generated i can write it to disk and have the LaCie boot from it. The LaCie box has the following: 1 ARM9 ARMv5TEJ (266 MHz) CPU with 64 Mb RAM, Gigabit network controller and 1 usb host port, internal there is a sata port obviously. The only thing i want at the moment is to have the LaCie boot Debian and i can SSH into it, from there the rest is easy as pie. Is someone willing to help me accomplish this task? It would seriously mean and help alot! If all goes well and if i get all things up and running i would like to make a Howto of it and place that here, maybe it will be of some use !
    Link to this post 09 Feb 10

    Hi all!

    At work they gave me the following task (and i need some help from you guys!):

    At work we have a normal PC running Ubuntu 9.10 (32-bit), which works good.
    We also have a LaCie Ethernet Disk Mini v2, which runs embedded Linux (RedHat), but is so trimmed down, you can't use the disk we would like to use it.

    The task is this: On the X86 machine, make a bootable image for the ARM architecture and write it to a harddisk (which fits the LaCie offc.) so it can boot off it.

    Now i have done some investigation, but don't know how to combine it all:

    - I can use debootstrap to create a minimal Debian system, but there comes the problem, you can't chroot into a foreign created system (i.e. X86 cannot chroot into ARM system).
    - I can use QEMU, which can emulate a ARM processor, but can i use the image that QEMU uses as a normal image for a harddisk, so it would boot off it (when using dd to write it to a real harddisk)?
    - Current kernels support the LaCie hardware (Marvell chipset)
    - I know how to use tools such as dd, so if the image is generated i can write it to disk and have the LaCie boot from it.

    The LaCie box has the following:
    1 ARM9 ARMv5TEJ (266 MHz) CPU with 64 Mb RAM, Gigabit network controller and 1 usb host port, internal there is a sata port obviously.

    The only thing i want at the moment is to have the LaCie boot Debian and i can SSH into it, from there the rest is easy as pie.

    Is someone willing to help me accomplish this task? It would seriously mean and help alot!

    If all goes well and if i get all things up and running i would like to make a Howto of it and place that here, maybe it will be of some use !

  • langerak
    Let Xserver connect via XDMCP automatically?
    Dear community, I have a server and a couple of workstations, all running Ubuntu 9.04 64-bit. The server is set up to accept XDMCP requests for the clients to remotely connect. But here it comes: If i want to connect to the server i have to go via the Actions menu in GDM and choose XDMCP. Is there a possibility to let it connect automatically to the server via XDMCP? I've read some stuff about modifying a Xservers file, but haven't got much info about how to modify it for my purpose... I hope someone has a answer for me, or at least some tips to start looking :D. Thanks in advance!
    Link to this post 10 Oct 09

    Dear community,

    I have a server and a couple of workstations, all running Ubuntu 9.04 64-bit. The server is set up to accept XDMCP requests for the clients to remotely connect. But here it comes: If i want to connect to the server i have to go via the Actions menu in GDM and choose XDMCP. Is there a possibility to let it connect automatically to the server via XDMCP? I've read some stuff about modifying a Xservers file, but haven't got much info about how to modify it for my purpose...

    I hope someone has a answer for me, or at least some tips to start looking :D.

    Thanks in advance!

  • langerak
    RE: confused over application for game
    I think you should try running it from the commandline, most of the times it will work, since it's a executable program which can't be run directly by clicking on it. Open up a terminal and type this: sh /home/wade/desktop/regnumonlineinstall_64 Or if you want to run it as a superuser type this: su sh /home/wade/desktop/regnumonlineinstall_64 I bet one of the 2 works ;)! Good luck!
    Link to this post 14 Aug 09

    I think you should try running it from the commandline, most of the times it will work, since it's a executable program which can't be run directly by clicking on it.

    Open up a terminal and type this:
    sh /home/wade/desktop/regnumonlineinstall_64
    Or if you want to run it as a superuser type this:
    su sh /home/wade/desktop/regnumonlineinstall_64

    I bet one of the 2 works ;)!

    Good luck!

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board