Hi again! On 02/24/2015 01:14 PM, Nio Wiklund wrote: > ...
> Hi again, I looked at your 'partition-help' file Good to add the > current RAM (and make it clear that it should be Mibibytes) and you > should add a little to be safe for suspending - or I think it is for > hibernating. Your text about MacOS is also relevant - Remember to add > lines for the xterm window (and check that it works without > scrolling). Must it work in netbook screens with 1000x600 pixels? Who > should make the final file? You or I? Best regards Nio Ok, I incorporated your suggestions. I still want xedit to the default opener for the test file, as I think it works well for this purpose, and if it doesn't exist use xterm to your specifications Look at the text in this one and double check my reasonings to make sure things are clear and correct.... they worked on my system. I ran a testfile version where I used memory numbers less than the RAM I have and it looked fine. I also tested with >= 512 and default to 512MB for all values of swap As for the final file, I will have to upload it to the obi branch... so I think we should continue to collaborate. You check my work and I will implement things, or change things as needed. If I do something you don't like here please tell me. I want OBI to work extremely well and be easier than ubiquity's manual partition (this is the reason for this help file). I want OBI to be very easy to use, very clear and very intuitive. I think we both want OBI to be the best. The only thing it is really missing is an automatic home partition setup. But this will have to wait. -- Regards -Israel ToriOS Team
#!/bin/bash if [ -f /usr/share/OBI/partition-help ] then dpath="/usr/share/OBI" elif [ -f "$HOME/partition-help" ] then dpath="$HOME" elif [ -f "$PWD/partition-help" ] then dpath="$PWD" else echoout "Error finding the OBI path... must abort, this is inconceivable" exit fi filename="$HOME/partition-help.txt" LC_ALL=C;LANG=C ram=$(free -m|grep "Mem:"|tr -s ' ' '\t'|cut -f 2) devices=($(lsblk|sed 's/..sd*//'|grep sd| sed 's/ .*//')) device=${devices[*]} num_devices="${#devices[@]}" intro="$num_devices devices" if [ "$num_devices" == "1" ] then device="/dev/${devices[0]}" intro="$num_devices device" fi drive_size=$(lsblk |grep "^${devices[0]}" | awk '{print $4}') if [[ $ram -ge 2000 ]] then ramG=$(free -g|grep "Mem:"|tr -s ' ' '\t'|cut -f 2) swapsize=$(( (ramG/2) )) swapsize="${swapsize} GB" if [[ $ramG -ge 4 ]] then laptop="4 GB" ram="${ramG} GB" else laptop=$(( (ramG*2) )) laptop="${laptop} GB" ram="${ramG} GB" fi else if [[ $ram -le 512 ]] then swapsize="512MB" laptop="512 MB" else swapsize="${ram} MB NOTE: you could get by on around 512MB" laptop=$(( (ram*2) )) laptop="${laptop} MB" ram="${ram} MB" fi fi text="You can install a system from a tarball into two partitions: one root file system partition and one swap partition This way it is possible to create a *dual boot* device with an existing (already installed) operating system. It is also possible to create a separate *data partition*, that can be used by linux as well as Windows. (Must be FAT32, FAT16, or NTFS) OSX uses HFS and HFS+, though FAT32 will work well with both OSX and Linux. NTFS is usable by OSX through 3rd party apps. OBI detects $intro ${device} Edit and create partitions One partition should be labeled 'obi-root' One (smaller) partition should be labeled 'obi-swap'. These labeled partitions can be identified and selected automatically Manual selection is also possible, if you do not want to temporarily label them this way. For example: The drive ${devices[0]} is $drive_size You have $ram RAM, so the swap should be around $swapsize NOTE, if you want to suspend you should use around $laptop for your swap " echo "${text}" > "${filename}" MIME=$(xdg-mime query default text/plain) if which xedit >/dev/null 2>&1 then xedit "${filename}" & else xterm -fa default -fg black -bg beige -fs 13 -geometry 80x26 -title "Help to partition" -hold -e fold -sw 80 "${filename}" & fi sleep 3 sudo gparted && sudo "$dpath/obi"
-- Mailing list: https://launchpad.net/~torios-dev Post to : torios-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~torios-dev More help : https://help.launchpad.net/ListHelp