plinej
Group: Members
Posts: 75
Joined: Oct. 2005 |
|
Posted: Feb. 10 2006,04:20 |
|
I made a flua script remastering tool thanks to this thread. Just copy the text between the lines and save as "remaster-flua". Make it executable by opening a shell, changing to the directory you saved the file to, and then type "chmod a+x remaster-flua". Then you can run it from executing it in emelfm as super user or from a root shell. You can't run this as user dsl. Click on the getting started button for help.
--------------------------------------------------------------------------------------
#!/bin/flua
-- remaster-flua
-- DEFAULTS ww = 420 -- window width wh = 420 -- window height Fl_Widget.initializers = {textfont = 15, labelfont = 15, labelcolor = 0} Fl_Window.initializers = {box = Boxtype.thin_down, color = 15}
-- MAIN WINDOW w_main = Window{ww,wh, "remaster-flua"} b0 = Button{10,90,180,30, "getting started"} function b0.callback() w_help:show() end b1 = Button{10,130,180,30, "copy files"} function b1.callback() if whoami~="root" then fl_message("You must be root to complete this task!") end execute("aterm +tr -T -e mkdir "..browse.."/source &>/dev/null") execute("aterm +tr -T -e mkdir "..browse.."/newcd &>/dev/null") execute("aterm +tr -T -e mkdir "..browse.."/newcd/KNOPPIX &>/dev/null") execute("aterm +tr -T -e mount /dev/cdrom /mnt/cdrom &>/dev/null") execute("aterm +tr -T -e cp -Rp /mnt/cdrom/boot "..browse.."/newcd &>/dev/null") execute("aterm +tr -T -e cp -Rp /mnt/cdrom/lost+found "..browse.."/newcd &>/dev/null") execute("aterm +tr -T -e cp -Rp /mnt/cdrom/index.html "..browse.."/newcd &>/dev/null") execute("aterm +tr -T -e cp -Rp /KNOPPIX/* "..browse.."/source &>/dev/null") execute("aterm +tr -T -e cp -Rp /KNOPPIX/.bash_profile "..browse.."/source &>/dev/null") execute("aterm +tr -T -e umount /dev/cdrom &>/dev/null") execute("aterm +tr -T -e eject &>/dev/null") fl_message("now edit your source dir") end b2 = Button{10,170,180,30, "create iso"} function b2.callback() execute("mkisofs -R "..browse.."/source | create_compressed_fs - 65536 > "..browse.."/newcd/KNOPPIX/KNOPPIX && mkisofs -no-pad -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o "..browse.."/mydsl.iso "..browse.."/newcd &>/dev/null") fl_message("iso created") end
-- MENU mm = Menu_Bar{0,0,ww,25;textfont=9} file_open = Menu_Entry{"&Choose a directory/&Open..."} function file_open:callback() --browse = fl_file_chooser("Open a File","/mnt",getenv("HOME").."/") browse = fl_file_chooser("Open a File","/mnt",getenv("HOME").."/") if browse then display.value = "Open: "..browse else display.value = "Open: nothing" display.value = "Open: /" end end help = Menu_Entry{"&File/&Help"} function help:callback() w_help:show() end file_quit = Menu_Entry{"&File/&Quit"} function file_quit:callback() exit(0) end mm:add(file_open) mm:add(help) mm:add(file_quit) -- MENU END
display = Output{10,40,ww-20,20}
-- HELP WINDOW w_help = Window{ww,wh, "help window"} w_help_text = Box{10,180,0,10,"\n".. "\n".. "Thanks goes to meo's remastering help threads in the forum, and\n".. "also to Mikshaw's flua_reference.uci to help make this.\n".. "\n".. "created by plinej on 2006-02-09\n".. "\n".. "First of all check out the thread in the forums at:\n".. "http://damnsmalllinux.org/cgi-bin/forums/\n".. "ikonboard.cgi?act=ST;f=12;t=7177;st=0\n".. "\n".. "To get started you'll need to be booted up in DSL with your\n".. "live cd in the cdrom. You will also need a partition to do\n".. "your work in. meo's posts say you need to format to ext2\n".. "but I've successfully used an ext3 partition. You need to\n".. "choose a directory from the drop down box to run this script\n".. "in. Make sure the directory you choose doesn't have\n".. "subdirectories named source or newcd. Press the copy\n".. "files button to start the first part of the scripts.\n".. "This will create the source and newcd directories,\n".. "mount your cdrom, and copy all necessary files.\n".. "You'll then be prompted to make your changes to the source\n".. "directory. After you make your changes you will need to\n".. "press the create iso button which will first make your\n".. "compressed filesystem and then makes the iso mydsl.iso\n".. "in your work directory. The iso should now be ready to burn.\n".. "\n".. "If you already have your source and newcd directories\n".. "on your hard drive ready to be made into an iso you can still\n".. "use this app, just skip pushing the copy files button, You'll\n".. "still need to choose the directory from the drop down box." ;align=Align.right} w_help:end_layout() w_main:show()
whoami = getenv("USER") if whoami~="root" then fl_message("You might as well close this program now,\n".. "since root power is needed to build an iso.\n".. "Try \"sudo remaster-flua\"") end
---------------------------------------------------------------------------------
|