parent
b52736fc07
commit
9b0d4c4394
@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
chroot_root="$1"
|
||||||
|
shift
|
||||||
|
new_snaps=("$@")
|
||||||
|
seed_dir="$chroot_root/var/lib/snapd/seed"
|
||||||
|
snaps_dir="$seed_dir/snaps"
|
||||||
|
assertions_dir="$seed_dir/assertions"
|
||||||
|
seed_yaml="$seed_dir/seed.yaml"
|
||||||
|
|
||||||
|
# Loop through each snap and download it, then update seed.yaml
|
||||||
|
for snap_info in "${new_snaps[@]}"; do
|
||||||
|
snap_name=${snap_info%=*}
|
||||||
|
channel=${snap_info#*=}
|
||||||
|
|
||||||
|
# Download
|
||||||
|
snap download --channel="$channel" "$snap_name" --target-directory="$snaps_dir"
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
# Get revision number
|
||||||
|
snap_file=$(ls "$snaps_dir" | grep ".snap" | grep "^${snap_name}_")
|
||||||
|
rev_num=$(echo "$snap_file" | grep -oP '(?<=_)\d+')
|
||||||
|
|
||||||
|
# Move assertions
|
||||||
|
mv "$snaps_dir/${snap_name}_${rev_num}.assert" "$assertions_dir"
|
||||||
|
|
||||||
|
# Append to seed.yaml
|
||||||
|
{
|
||||||
|
echo " - name: $snap_name"
|
||||||
|
echo " file: $snap_file"
|
||||||
|
echo " channel: $channel"
|
||||||
|
} >> "$seed_yaml"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove state.json if exists
|
||||||
|
[ -f "$chroot_root/var/lib/snapd/state.json" ] && rm "$chroot_root/var/lib/snapd/state.json"
|
||||||
|
|
||||||
|
# Validate
|
||||||
|
snap debug validate-seed "$seed_yaml"
|
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
dontChroot: false
|
||||||
|
timeout: 300
|
||||||
|
"packages.minimalInstall":
|
||||||
|
true:
|
||||||
|
- "apt-get -y --purge remove snapd vlc plasma-discover muon transmission-qt quassel 2048-qt featherpad noblenote kcalc qps zsync partitionmanager qapt-deb-installer picom qlipper qtpass libreoffice*"
|
||||||
|
- "apt-get -y autoremove"
|
||||||
|
"packages.updateNow":
|
||||||
|
true: "apt-get -y full-upgrade"
|
||||||
|
"packages.virt-manager":
|
||||||
|
true: "apt-get -y install virt-manager"
|
||||||
|
"packages.thunderbird":
|
||||||
|
true: "apt-get -y install thunderbird"
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
dontChroot: true
|
||||||
|
timeout: 600
|
||||||
|
"packages.element":
|
||||||
|
true: "calamares_snap_install ${ROOT} element-desktop=stable"
|
||||||
|
"packages.krita":
|
||||||
|
true: "calamares_snap_install ${ROOT} krita=stable kf5-5-108-qt-5-15-10-core22=stable"
|
Loading…
Reference in new issue