system

the Chamesle handbook, init, live ISO and install helpers
git clone https://github.com/tortr-rs/system
Log | Files | Refs | README | LICENSE

brand (1485B)


      1 #!/bin/sh
      2 # takes Artix's name out of what shows: os-release, the release files, GRUB and the line OpenRC boots with.
      3 # runs after install and from the hook whenever filesystem, openrc, lsb-release or grub come again
      4 cp /usr/share/chamesle/os-release /usr/lib/os-release
      5 [ -e /etc/os-release ] || ln -s ../usr/lib/os-release /etc/os-release
      6 [ -e /etc/artix-release ] && echo Chamesle > /etc/artix-release
      7 [ -e /etc/lsb-release ] && sed -i 's/^DISTRIB_ID=.*/DISTRIB_ID=Chamesle/; s/^DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="Chamesle"/' /etc/lsb-release
      8 [ -e /etc/default/grub ] && sed -i 's/^GRUB_DISTRIBUTOR=.*/GRUB_DISTRIBUTOR="Chamesle"/' /etc/default/grub
      9 [ -e /boot/grub/grub.cfg ] && sed -i 's/Artix Linux/Chamesle/g' /boot/grub/grub.cfg
     10 sed -i 's/:Artix Linux Package Management:/:Package Management:/' /etc/passwd
     11 # OpenRC has "Artix Linux" compiled in: the same bytes, Chamesle and zeros, on a copy that is then moved over
     12 for f in /usr/bin/openrc /usr/bin/openrc-run /usr/bin/openrc-shutdown /usr/bin/openrc-init /usr/bin/rc-service \
     13 	/usr/bin/rc-update /usr/bin/rc-status /usr/bin/supervise-daemon /usr/bin/start-stop-daemon /usr/lib/librc.so.* /usr/lib/libeinfo.so.*; do
     14 	[ -f "$f" ] && [ ! -L "$f" ] || continue
     15 	at=$(/usr/bin/grep -obaF 'Artix Linux' "$f" | cut -d: -f1)
     16 	[ -n "$at" ] || continue
     17 	cp -p "$f" "$f.brand"
     18 	for o in $at; do printf 'Chamesle\0\0\0' | /usr/bin/dd of="$f.brand" bs=1 seek="$o" conv=notrunc status=none; done
     19 	mv "$f.brand" "$f"
     20 done
     21 exit 0