]> git.sev.monster Git - dotfiles.git/commitdiff
add `se' alias, update syslinux stuff
authorsev <git@sev.monster>
Sat, 30 May 2020 18:45:06 +0000 (13:45 -0500)
committersev <git@sev.monster>
Fri, 5 Apr 2024 21:27:39 +0000 (16:27 -0500)
base/.zshrc
root/syslinux.cfg [changed mode: 0755->0644]
root/update-extlinux.conf [new file with mode: 0644]

index 96f14c5157c4db28a88f3a8a8cba4c6d34181150..1f6e987903cfbc881e203661968309a1c11aebdf 100644 (file)
@@ -54,6 +54,7 @@ if [[ "$OSTYPE" =~ '^(free|net)bsd' ]] {
 } else {
     alias ll="ls -lAFh"
 }
+alias se=sudoedit
 ## ps
 local p=
 if which pstree >/dev/null 2>&1 && ! check-busybox pstree; then
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/root/update-extlinux.conf b/root/update-extlinux.conf
new file mode 100644 (file)
index 0000000..9ee0e0f
--- /dev/null
@@ -0,0 +1,92 @@
+# we are using the fact that this is a sourced sh script to take over and
+# handle updating ourselves. config is static and does not need changes.
+
+version=$version-mod
+verbose=0
+
+# replicate existing script
+everbose() {
+       if [ "$verbose" = "0" ]; then
+               return
+       fi
+
+       echo $*
+}
+
+ewarn() {
+       echo "WARNING:" $@ >&2
+}
+
+eerror() {
+       echo "ERROR:" $@ >&2
+       return 1
+}
+
+usage() {
+       echo "usage: $0 [-v|--verbose] [--warn-only]"
+}
+
+# NOTE: no-op for most options
+while [ $# -gt 0 ]; do
+       opt="$1"
+       shift
+       case "$opt" in
+       -v|--verbose)
+               verbose=1
+               ;;
+       --warn-only)
+               warn_only=1
+               ;;
+       --)
+               break
+               ;;
+       -*)
+               usage
+               exit 1
+               ;;
+       esac
+done
+
+src=/usr/share/syslinux/efi64
+boot=/boot/EFI/Boot
+everbose "Installing binaries from $src to $boot"
+cp $src/*.c32 $src/ldlinux.e64 $boot
+cp $src/syslinux.efi $boot/bootx64.efi
+
+ids=/usr/share/hwdata/pci.ids
+bootids=hdt/pci.ids
+apkargs="-q --no-progress"
+if ! apk info -e hwids-pci >/dev/null; then
+       everbose "Installing hwids-pci"
+       if apk $apkargs add hwids-pci; then
+               undo_hwids=1
+       else
+               ewarn $(cat <<EOF
+                       Unable to install hwids-pci! If update-extlinux is
+                       being called from syslinux hook during
+                       installation/upgrade, you will need to run
+                       update-extlinux after the apk database is unlocked.
+                       Alternatively, install hwids-pci manually before
+                       upgrading boot-related packages.
+EOF
+)
+       fi
+else
+       everbose "Upgrading hwids-pci"
+       if ! apk $apkargs upgrade hwids-pci; then
+               ewarn "Upgrade failed for hwids-pci, pci.ids may be out of date"
+       fi
+fi
+if [ ! -r "$ids" ]; then
+       ewarn "Cannot read $ids, can't update $boot/$bootids"
+else
+       everbose "Installing $ids to $boot/$bootids"
+       cp $ids $boot/$bootids
+fi
+if [ -n "$undo_hwids" ]; then
+       everbose "Deleting hwids-pci"
+       apk $apkargs del hwids-pci
+fi
+
+# exit from parent script
+exit 0
This page took 0.042855 seconds and 4 git commands to generate.