X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/6cc400b8d4dea8e50491dddbd13cf87233c43d1a..fa7e1d5fa0007e5d1d634cc4e41fdfd3aa381a8e:/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh?ds=inline diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh index d3d7ab8..5067532 100644 --- a/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh @@ -45,7 +45,8 @@ if [ -f $VTOY_PATH/ventoy_persistent_map ]; then if [ -e /sbin/dmsquash-live-root ]; then echo "patch /sbin/dmsquash-live-root for persistent ..." >> $VTLOG - $SED "/mount.*devspec.*\/run\/initramfs\/overlayfs/a . /ventoy/hook/rhel7/ventoy-overlay.sh" -i /sbin/dmsquash-live-root + $SED "/mount.*devspec.*\/run\/initramfs\/overlayfs/a . /ventoy/hook/rhel7/ventoy-overlay.sh" -i /sbin/dmsquash-live-root + $SED "s/osmin.img/osmin.imgxxxx/g" -i /sbin/dmsquash-live-root fi #close selinux @@ -85,6 +86,29 @@ fi $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/${vtPriority}-ventoy-inotifyd-start.sh $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-timeout.sh /lib/dracut/hooks/initqueue/timeout/${vtPriority}-ventoy-timeout.sh +vtNeedRepo= +if [ -f /etc/system-release ]; then + if $GREP -q 'RED OS' /etc/system-release; then + vtNeedRepo="yes" + fi +fi + +if $GREP -q 'el[89]' /proc/version; then + vtNeedRepo="yes" +fi + +if $GREP -i -q Fedora /proc/version; then + if $GREP -q 'Server Edition' /etc/os-release; then + vtNeedRepo="yes" + fi +fi + +echo "vtNeedRepo=$vtNeedRepo" >> $VTLOG + +if [ "$vtNeedRepo" = "yes" ]; then + $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh +fi + if [ -e /sbin/dmsquash-live-root ]; then echo "patch /sbin/dmsquash-live-root ..." >> $VTLOG $SED "1 a $BUSYBOX_PATH/sh $VTOY_PATH/hook/rhel7/ventoy-make-link.sh" -i /sbin/dmsquash-live-root