Ubuntu rootfs modify

I build the Ubuntu20.04 Gnome version, but when building an image, I have question about the following.

  • modify rootfs package
    -add new package, remove not used package
    -change emmc(rootfs) partition size

Please share any descriptions or documents you may wish to refer to.

Thank you.

1 Like

I have not done this myself, but wanted to do it,

Have you gone through the buildscripts, there might be something there…
Maybe @numbqq can help us…

  1. start krescue from SD
  2. goto krescue shell
root@Krescue:~# blkid | grep ROOTFS
/dev/mmcblk2p2: LABEL="ROOTFS" UUID="e5167dcc-5e89-402b-913a-ced587267ba7" TYPE="ext4" PARTUUID="a6bde280-02"

change rootfs size to 4G - EXAMPLE

root@Krescue:~# resize2fs /dev/mmcblk2p2 4G
resize2fs 1.44.5 (15-Dec-2018)
Resizing the filesystem on /dev/mmcblk2p2 to 1048576 (4k) blocks.
The filesystem on /dev/mmcblk2p2 is now 1048576 (4k) blocks long.

next step is change partitions by hands - recreate last partition with same size as resized rootfs is 4G - sure u can create other partitions if u need it

fdisk /dev/mmcblk2

write and flush all changes and reboot


Thank you for answer . My question is change the rootfs size during build.
I want to make it for a single application device based on ubuntu.
We will remove all unused packages from the build environment and add necessary packages.
Please respond to inquiries about how to add/remove packages.

  1. check fenix build script :wink: - and change it
  2. rootfs created as minimal and resized to maximal size (depend of emmc size)

Please respond to inquiries about how to add/remove packages.

same check build sources scripts - all packages there :wink:

@hyphop which particular script should be modified ?
which script executes “make” process ?

plz check fenix sources if u ready to change something u must understand what to do :wink:

grep deb config/*/* scripts/*/*

Thank you for answer. But I didn’t understand.
For example, if I want to install the samba server in the build environment, the following process is required.

  1. Install package
  2. package configuration
  3. Start service

During the build process 1. should be done, and it should be done 2. when creating the rootfs image.
If possible, please tell me how to add a package using samba as an example.
Also, if you have any documents for reference, please share them.

Thank you.

Yes, @hyphop can you provide us with a sample… ?

for example how to make the samba server/ or xrdp etc. pre installed in ubuntu while making the image with fenix…

edit fenix/config/config

grep PACKAGE_LIST_ADDITIONAL= fenix/config/config -A6

PACKAGE_LIST_ADDITIONAL="wget nano alsa-utils btrfs-progs dosfstools hddtemp iotop iozone3 stress sysbench screen ntfs-3g vim pciutils \
	evtest htop mmc-utils pv lsof libfuse2 libdigest-sha-perl libproc-processtable-perl aptitude dnsutils f3 haveged \
	hdparm rfkill vlan sysstat net-tools bash-completion hostapd git ethtool network-manager unzip ifenslave lirc \
	libpam-systemd iperf3 software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping bluetooth bluez bluez-tools watchdog \
	i2c-tools qrencode rng-tools clinfo ocl-icd-libopencl1 libatlas3-base p7zip p7zip-full lrzip lzip lzop ncompress unar zstd edid-decode libgtk-3-0 dnsmasq-base \
	ppp modemmanager mobile-broadband-provider-info"

add next string - its just example u must define necessary packages in this string




PS: i will push this feature in next fenix something like this

export PACKAGE_LIST_USER="samba-common xrdp supertux"

Thank you for reply. I will check it.

Yes, Thank you for your reply
I will try a test build and see if it works,

btw, how can we change the apt-package sources in fenix,
for obtaining packages from other distribution? Is that also in the configs ?

will you let Hyphop work today?
while you can cut a new box for SBC :grin:

I will, I just want to get my doubt clarified…

I would be making boxes, If I hadn’t run out of materials… :pleading_face:

Thanks for the detailed explanation