Skip to content

Commit

Permalink
(=) Bugfix isopath => iso_path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Politzer Couto committed Sep 29, 2021
1 parent f2aa989 commit 4771e2a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
50 changes: 25 additions & 25 deletions boot/grub/script/autoiso.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

# NOTE: iso_path sometimes has a special meaning to the next stage of the boot.

function pathname { regexp -s 2:"$2" '^(\(.*\))/*(/.*)$' "$1"; }
function devname { regexp -s "$2" '^(\(.*\)).*$' "$1"; }

function isolinux_iso_entry {
realdev="$1"
isopath="$2"
iso_path="$2"
loopdev="$3"

if test -f /boot/isolinux/isolinux.cfg; then
Expand All @@ -34,15 +36,15 @@ function isolinux_iso_entry {
return 1;
fi

echo isolinux based $isopath: yes
echo isolinux based $iso_path: yes
probe -s label -l $realdev
menuentry "${indent}${isopath} (isolinux)" "$realdev" "$isopath" "$cfgpath" {
menuentry "${indent}${iso_path} (isolinux)" "$realdev" "$iso_path" "$cfgpath" {
set device="$2"
set isopath="$3"
set iso_path="$3"
set cfgpath="$4"

probe -s rootuuid -u $device
loopback loop "${device}${isopath}"
loopback loop "${device}${iso_path}"
set root=(loop)

# this flag requires a hacked grub!!
Expand All @@ -51,31 +53,31 @@ function isolinux_iso_entry {
set linux_extra="$langset"

# arch based
set linux_extra="${linux_extra} img_dev=/dev/disk/by-uuid/$rootuuid img_loop=$isopath earlymodules=loop"
set linux_extra="${linux_extra} img_dev=/dev/disk/by-uuid/$rootuuid img_loop=$iso_path earlymodules=loop"

# gentoo based
set linux_extra="${linux_extra} isofrom=$isopath"
set linux_extra="${linux_extra} isofrom=$iso_path"

# ubuntu based, fedora, opensuse, rosa
set linux_extra="${linux_extra} iso-scan/filename=$isopath"
set linux_extra="${linux_extra} iso-scan/filename=$iso_path"

# antiX based
set linux_extra="${linux_extra} from=all fromiso=$isopath"
set linux_extra="${linux_extra} from=all fromiso=$iso_path"

# Grml Live Linux
set linux_extra="${linux_extra} findiso=$isopath"
set linux_extra="${linux_extra} findiso=$iso_path"

# sysrcd
set linux_extra="${linux_extra} isoloop=$isopath"
set linux_extra="${linux_extra} isoloop=$iso_path"

# MagOS Linux (UIRD)
set linux_extra="${linux_extra} uird.from=${isopath},/MagOS uird.force scantimeout=3"
set linux_extra="${linux_extra} uird.from=${iso_path},/MagOS uird.force scantimeout=3"

# TODO: SUSE based
set linux_extra="${linux_extra} isofrom_device=/dev/disk/by-uuid/$rootuuid isofrom_system=$isopath"
set linux_extra="${linux_extra} isofrom_device=/dev/disk/by-uuid/$rootuuid isofrom_system=$iso_path"

# others?
set linux_extra="${linux_extra} isoboot=$isopath"
set linux_extra="${linux_extra} isoboot=$iso_path"

export linux_extra
syslinux_configfile $cfgpath
Expand All @@ -85,7 +87,7 @@ function isolinux_iso_entry {

function loopback_iso_entry {
realdev="$1"
isopath="$2"
iso_path="$2"
loopdev="$3"

if test -f /boot/grub/loopback.cfg; then
Expand All @@ -96,19 +98,17 @@ function loopback_iso_entry {
return 1
fi

echo loopback.cfg $isopath: yes
probe -s label -l $realdev
menuentry "${indent}${isopath} (loopback)" "$realdev" "$isopath" "$cfgpath" {
echo loopback.cfg $iso_path: yes
menuentry "${indent}${iso_path} (loopback)" "$realdev" "$iso_path" "$cfgpath" {
set device="$2"
set isopath="$3"
set iso_path="$3"
set cfgpath="$4"

loopback loop "${device}${isopath}"
loopback loop "${device}${iso_path}"
set root=(loop)

probe -s rootuuid -u $device
set isopath="$isopath $langset"
export isopath
export iso_path

configfile $cfgpath
loopback -d loop
Expand All @@ -125,15 +125,15 @@ function scan_isos {
for file in ${dev}${dir}/*.iso ${dev}${dir}/*.ISO; do
if ! test -f "$file"; then continue; fi

pathname $file isopath
pathname $file iso_path

if ! loopback loopdev_scan "$file"; then continue; fi
saved_root=$root
set root=(loopdev_scan)

if false; then true;
elif loopback_iso_entry $dev $isopath (loopdev_scan); then true;
elif isolinux_iso_entry $dev $isopath (loopdev_scan); then true;
elif loopback_iso_entry $dev $iso_path (loopdev_scan); then true;
elif isolinux_iso_entry $dev $iso_path (loopdev_scan); then true;
else true; fi

set root=$saved_root
Expand Down
5 changes: 5 additions & 0 deletions release
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pushd grub && {
./grub-install --boot-directory=../boot dummy.img
popd
}
tar cvf grub-iso-multiboot.tar.gz boot/

0 comments on commit 4771e2a

Please sign in to comment.