MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.89k stars 497 forks source link

DietPi-System | Update images and shrink partition #1263

Closed k-plan closed 6 years ago

k-plan commented 6 years ago

@Fourdee

Extremely time consuming to update all our images.

Yes, will do my best to get it run for devices I have here. (e.g. NanoPi Neo, OPi One, Odroid C1, Pine64) Crying around doesn't change anything. So let's launch us into image update.

Have playing around a little bit with finalise. Nice script, so far so good. (Some little quirks, depending on tested devices, but let's move forward)

Have some ideas, how to shrink ext4 partitions after running this. But better to ask, how you want or will do this, before I go about? Any tips or hints?

Thanking you in anticipation.

cu k-plan

Fourdee commented 6 years ago

@k-plan

You'll need to resize partition manually (gparted), then zerofree it (to 0 free space, reducing 7z size).

I use a desktop (LXDE), and created this bash script: Once you've saved SD/EMMC to a .img:

}

MichaIng commented 6 years ago

Just offered a PR and rearranged especially package dealing to actively use apt-mark to get rid of unnecessary packages: https://github.com/Fourdee/DietPi/pull/1266

Would be great to automate it by moving secure steps to finalise step by step. Indeed some steps need careful checks dependent on machine to prevent bootloops, network break etc in between. But should be possible to solve.

Perhaps there is a way to automize debian base image first run setup also?

k-plan commented 6 years ago

@Fourdee

Fiddling around the hole day to shrink a PineA64 image as small as possible. Use your script and tested as well a gparted-live-0.30.0-1-i686.iso live usb stick. It's seem where is a "magic" boarder of 1.7 GB with gparted for this ext4 partition (ca. 1.2 GB are in use). Can't get it close to your 1.1 GB in DietPi_v145_PineA64-arm64-(Jessie).img. :cry:

Have tested here on Pine A64+ 1GB (aarch64) the refresh image with the last longsleep 3.x kernel: Linux PineA64 3.10.105-0-pine64-longsleep #3 SMP PREEMPT Sat Mar 11 16:05:53 CET 2017 aarch64 GNU/Linux . Tested some hardware stuff like, Ethernet, wifi, usb, hdmi. For me it works.

red_led didn't work and where is a error message on hdmi output, while booting up. No big deal. Nothing that can't be fix with a futuredietpi-update

And where is a problem mounting ex-fat file system, because of missing packets:

root@PineA64:~# mount /dev/sdb1 /mnt/usb2/
mount: unknown filesystem type 'exfat'

root@PineA64:~# apt-get install exfat-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  exfat-fuse
The following NEW packages will be installed:
  exfat-fuse exfat-utils

root@PineA64:~# mount /dev/sdb1 /mnt/usb2/
FUSE exfat 1.1.0
WARN: volume was not unmounted cleanly.
root@PineA64:~# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    1  7.5G  0 disk
└─sda1        8:1    1  7.5G  0 part
sdb           8:16   1  7.5G  0 disk
└─sdb1        8:17   1  7.5G  0 part /mnt/usb2
mmcblk0     179:0    0  3.7G  0 disk
├─mmcblk0p1 179:1    0   50M  0 part /boot
└─mmcblk0p2 179:2    0  3.6G  0 part /
root@PineA64:~# ls /mnt/usb2/
DietPi_v158_PineA64-full.7z  DietPi_v158_PineA64-full.img

As well, no big deal.

Upload to your dietpi-survey directory is ready now.

Can you please have a look and give ##DietPi_PineA64-arm64-(Jessie)-by-k-plan.7z a try? If it is okay, I will try to do it for some other images from Feb/2017, as far as I own such a device.

Thanks.

k-plan commented 6 years ago

Can you please have a look and give ##DietPi_PineA64-arm64-(Jessie)-by-k-plan.7z a try?

Will you please delete this? I will try to build a new version. Thanks.

k-plan commented 6 years ago

Close.

Please reopen if needed.

Fourdee commented 6 years ago

@k-plan

Will you please delete this? I will try to build a new version. Thanks.

Done 👍 . :

root@dietpi:~# ls -lha /home/dietpi-survey/ | grep 7z
-rw-r--r-- 1 dietpi-survey dietpi-survey  79M Dec  2 18:23 ##DietPi_OrangePiOne-armv7-(Jessie)_by-kplan.7z
-rw-r--r-- 1 dietpi-survey dietpi-survey 166M Nov 30 21:05 ##DietPi_PineA64-arm64-(Jessie)-by-k-plan.7z
-rw-r--r-- 1 dietpi-survey dietpi-survey 149M Dec  2 21:24 ##DietPi_PineA64-arm64-(Jessie)_by-kplan.7z

root@dietpi:~# rm "/home/dietpi-survey/##DietPi_PineA64-arm64-(Jessie)-by-k-plan.7z"

root@dietpi:~# df -h
Filesystem         Size  Used Avail Use% Mounted on
/dev/ploop11234p1   15G   12G  2.4G  83% /