I posted this here for anyone who would like to help on an opensource project I will be running. I am not very good at programming but, I have a lot of time on my hands to help accomplish something that currently does not exist which is a:
Anyone enteresting working on a opensource project with me that Remasters any GNU-Linux OS using bash / sh commands. No chroot | No filesystem.squashfs | After bash proof of concept is proven, UI will be made for all commands using yad GUI - 2 versions 0.40.0 for gtk2 and yad 10+ for gtk3. Here is summary shema of process (just example commands, many other ways, for example: could use dd or rysnc command to copy data). Below process based on Debian and Ubuntu based distros. Would like to cover Arch, Fedora, Antix in the fututre.
Determine data size and copy data to a file (img, iso, or )
use partition tool like fdisk or lpart to create a new and formate it to ext2, 3 or 4 to match filesystem of source partiton.
write data image file to new partiton.
get UUID from new partition and insert in to /etc/fstab file
sudo grub-install (if usb bootable drive) /dev/sdb
sudo mount /dev/sdb1 /dev/sdb
sudo grub-install –-root-directory=/mnt/sdb/boot/grub /dev/sdb
Reboot to hard drive grub2 menu
select /dev/sdb and boot it
sudo grub-mkconfig -o /mnt/sdb/boot/grub/grub.cfg
These commans are just to accomplish No. 1 above - Get data total blocks used on a partition and write data to img file:
sudo mount /dev/sdb1 /mnt/sdb
used_blocks=$(df --block-size=1K /mnt/sdb| awk 'NR==2 {print $3}')
result_MB=$(( used_blocks / 512 ))
echo "Used Data for /dev/sdb1: $result_MB"
sudo dd if=/dev/sdb1 of=./all_data_usb_sdb1 bs=1MB count=$result_MB status=progress && sync
Result: 1 img file written using dd command:
Used Data for /dev/sdb1: 1778
1761000000 bytes (1.8 GB, 1.6 GiB) copied, 46 s, 38.3 MB/s
1778000000 bytes (1.8 GB, 1.7 GiB) copied, 46.4529 s, 38.3 MB/s
DIFFICULT Step is No. 2 partition. - I have yet to accomplish this step but, I am close. I would like for users to use gparted, so the 1st release could be use of Gparted to handle partition. Or, It could be Calamares Installer setup (which is over kitll) but, Ultimately, a GUI Installer (Calamares) will be built.
Feel free to prodive suggestions and ask questions for more detail of the project. TIA Robert