I have a question regarding building OpenWrt source in my Linux/Windows system. I was not happy with Windows Subsystem for Linux so I decided to dual boot my laptop with Windows 10 as my main OS and Linux Ubuntu 18.10 being used for OpenWrt development. Now hard disk being the constraint here, I have 500gb hard and only 60gb space was allocated to Linux.
I installed a minimum version of Ubuntu because I did not need any much applications in Linux but anyway now I have 42gb total allocated to /home
and 4gb to swap and 14gb to /
root. I am keeping my OpenWrt build source in /home of course and right now I have 2 different copies of the source representing latest snapshots and stable and they take around 26gb of space (more or less, because this is what df -h
shows in /home
) still leaving 14gb free.
I also decided to link the dl
folder in the stable source (from snapshots) because that would save much time for downloading the same things twice and of course save space, at least some of it. Is there any more that I can do to save space on the drive? Maybe linking some folders together so they dont need to contain the same things twice.
I would also like to know if I can keep two different builds together, for instance, if I first checkout the master and then build it and after that I checkout v18.06.2 and then build it again so would that save me any time in building source again? I think it takes me around 3 or more hours to build the source from scratch with -j 3
option and my CPU is around 85% usage and RAM, 8gb, almost at full with buffer and cache being highest.
So any thoughts for this? Thank you.
# this is the output after building the source
ahmar@ahmar-Inspiron-3521:~/Desktop/build-system/openwrt$ free
total used free shared buff/cache available
Mem: 8046412 1387668 186968 242368 6471776 6110996
Swap: 3906556 5388 3901168
ahmar@ahmar-Inspiron-3521:~/Desktop/build-system/openwrt$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 786M 1.6M 785M 1% /run
/dev/sda6 14G 7.4G 5.7G 57% /
tmpfs 3.9G 41M 3.8G 2% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 36M 36M 0 100% /snap/gtk-common-themes/1198
/dev/loop1 15M 15M 0 100% /snap/gnome-logs/45
/dev/loop2 141M 141M 0 100% /snap/gnome-3-26-1604/82
/dev/loop4 13M 13M 0 100% /snap/gnome-characters/124
/dev/loop3 13M 13M 0 100% /snap/gnome-characters/139
/dev/loop5 141M 141M 0 100% /snap/gnome-3-26-1604/70
/dev/loop6 2.3M 2.3M 0 100% /snap/gnome-calculator/238
/dev/loop7 91M 91M 0 100% /snap/core/6405
/dev/loop8 88M 88M 0 100% /snap/core/5662
/dev/loop9 2.3M 2.3M 0 100% /snap/gnome-calculator/260
/dev/loop10 43M 43M 0 100% /snap/gtk-common-themes/701
/dev/sda1 296M 32M 265M 11% /boot/efi
/dev/sda8 42G 26G 14G 66% /home
tmpfs 786M 11M 776M 2% /run/user/1000