git » mk-desktop-image.git » commit c8cec95

Initial support for release/untested images

author Urja (ARMLFS builder)
2024-07-15 05:42:28 UTC
committer Urja (ARMLFS builder)
2024-07-15 05:42:28 UTC
parent 3706abcc84dd40adf49894d9f2633c7a87fd011e

Initial support for release/untested images

initial.sh +5 -0
make.sh +29 -11
pacman.conf +6 -10

diff --git a/initial.sh b/initial.sh
index c5f1446..0a4fbde 100755
--- a/initial.sh
+++ b/initial.sh
@@ -7,6 +7,11 @@ export LANG="en_US.UTF-8"
 # install all the packages
 pacman -S $(cat ./pkglist.txt)
 
+# Ignore any packages trying to overidde preconfigured stuff
+# Currently only pacman.conf, lol.
+cd /etc
+find -name '*.pacnew' -delete
+
 systemctl preset-all
 make-ca -r
 systemd-sysusers
diff --git a/make.sh b/make.sh
index 848f07a..2cce2c4 100755
--- a/make.sh
+++ b/make.sh
@@ -14,6 +14,19 @@ if [ -d $BS ]; then
 	rm -r $BS
 fi
 
+if [ "$1" == "--untested" ]; then
+	PKG_FS=/sources/pkg
+	PKG_URL=https://a64box.urja.dev/armlfs/pkg
+	DEBUGINFO_URL=https://a64box.urja.dev/armlfs-debuginfo
+	DEVMODE=1
+	IMGNAME=untested-armlfs
+else
+	PKG_FS=/mnt/nfs/pkg
+	PKG_URL=https://armlfs.urja.dev/pkg
+	DEBUGINFO_URL=https://armlfs.urja.dev/debuginfo
+	IMGNAME=armlfs-kde5
+fi
+
 rm -f $BSN.img{,.zst,.xz}
 truncate -s 15G $BSN.img
 
@@ -27,16 +40,23 @@ mount $LOOP -t ext4 $BS
 # To allow pacman-in-chroot to believe that / is a mount point
 #mount --bind $BS $BS
 
+# Setup pacman (and keys)
+mkdir -p $BS/etc/pacman.d/keys
+cp /etc/pacman.d/keys/armlfs-release-key.pub $BS/etc/pacman.d/keys/
+[ -n "$DEVMODE" ] && cp /etc/pacman.d/keys/armlfs-untested-key.pub $BS/etc/pacman.d/keys/ || true
+cp pacman.conf $BS/etc/
+CFG=$BS/etc/pacman.conf
+sed -i $CFG -e "s|@URL[@]|$PKG_URL|g"
 
 mkdir -p $BS/etc/pki/tls/certs
 cp /etc/pki/tls/certs/ca-bundle.crt $BS/etc/pki/tls/certs/
 
 mkdir -p $BS/var/lib/pacman
-pacman --config pacman.conf -Sy -b $BS/var/lib/pacman -r $BS
+pacman --config $CFG -Sy -b $BS/var/lib/pacman -r $BS
 
 cp packages.txt $BS/pkglist.txt
 yes | pacman -Scc
-pacman --config pacman.conf -S --noconfirm  --noscriptlet -b $BS/var/lib/pacman -r $BS minimal
+pacman --config $CFG -S --noconfirm  --noscriptlet -b $BS/var/lib/pacman -r $BS minimal
 
 # Greeter background image
 mkdir -p $BS/usr/share/backgrounds/armlfs/
@@ -51,15 +71,13 @@ mkdir -p $BS/boot/extlinux
 cp extlinux.conf $BS/boot/extlinux
 sed -i "s/%PARTUUID%/${FS_UUID}/" $BS/boot/extlinux/extlinux.conf
 
-# Pacman/makepkg configuration and cd into target
-cp pacman.conf $BS/etc/
+# cd into target
 cp initial.sh $BS
 cd $BS
-cp /etc/makepkg.conf etc/
 
 # Debuginfo
 mkdir -p etc/debuginfod
-echo "https://a64box.urja.dev/armlfs-debuginfo" > etc/debuginfod/armlfs.urls
+echo "$DEBUGINFO_URL" > etc/debuginfod/armlfs.urls
 
 # Timezone
 ln -s ../usr/share/zoneinfo/Europe/Helsinki etc/localtime
@@ -79,7 +97,7 @@ mount --bind /dev dev
 mkdir -p var/cache/pacman/pkg
 mkdir -p /tmp/ds{cache,work}
 cp /etc/resolv.conf etc/
-mount -t overlay -o lowerdir=/sources/pkg/armv7h/kde5:/sources/pkg/armv7h/base:/sources/pkg/armv7h/core,upperdir=/tmp/dscache,workdir=/tmp/dswork overlay var/cache/pacman/pkg
+mount -t overlay -o lowerdir=$PKG_FS/armv7h/kde5:$PKG_FS/armv7h/base:$PKG_FS/armv7h/core,upperdir=/tmp/dscache,workdir=/tmp/dswork overlay var/cache/pacman/pkg
 chmod +x ./$1
 chroot . ./$1
 umount proc sys dev var/cache/pacman/pkg
@@ -113,9 +131,9 @@ cp $BSN.img $BSN-stage2-bak.img
 mount $LOOP -t ext4 $BS
 
 tarball_and_image() {
-rm -f $1.tar.gz
+rm -f $1.tar.xz
 echo "Tarballing up the system..."
-time tar --xattrs --acls -C $BS -czf $1.tar.gz .
+time tar --xattrs --acls --xz -C $BS -cf $1.tar.xz .
 echo "Creating the microSD disk image..."
 
 # Adding the repart configuration
@@ -161,7 +179,7 @@ mv $BSN.img.xz $1.img.xz
 echo Done $1
 return 0
 }
-tarball_and_image armlfs-kde5-base
+tarball_and_image $IMGNAME-base
 
 # Restore image and loopback mount for stage 2
 mv $BSN-stage2-bak.img $BSN.img
@@ -182,4 +200,4 @@ run_in_chroot stage2.sh
 # Return to our cd
 cd -
 # Make stage2 images
-tarball_and_image armlfs-kde5-showcase
+tarball_and_image $IMGNAME-showcase
diff --git a/pacman.conf b/pacman.conf
index 8899ddf..a5d6ca2 100644
--- a/pacman.conf
+++ b/pacman.conf
@@ -37,8 +37,8 @@ CheckSpace
 ParallelDownloads = 5
 
 # PGP signature checking
-#SigLevel = Optional
-#LocalFileSigLevel = Optional
+SigLevel = Required DatabaseOptional
+LocalFileSigLevel = Optional
 #RemoteFileSigLevel = Optional
 
 #
@@ -73,19 +73,15 @@ ParallelDownloads = 5
 # An example of a custom package repository.  See the pacman manpage for
 # tips on creating your own repositories.
 
-DBPath   = /var/lib/pacman/
-CacheDir = /var/cache/pacman/pkg/
-LogFile  = /var/log/pacman.log
-SigLevel = Never
-
 [kbbpkgs]
+SigLevel = Optional
 Server = https://a64box.urja.dev/kbbpkgs/$arch
 
 [kde5]
-Server = https://a64box.urja.dev/armlfs/pkg/$arch/kde5
+Server = @URL@/$arch/kde5
 
 [base]
-Server = https://a64box.urja.dev/armlfs/pkg/$arch/base
+Server = @URL@/$arch/base
 
 [core]
-Server = https://a64box.urja.dev/armlfs/pkg/$arch/core
+Server = @URL@/$arch/core