# HG changeset patch # User Pascal Bellard # Date 1569007245 -7200 # Node ID 26423b57df4657bb48b532805de0ad87d4436d2e # Parent 912635ac019dcc2408bca3201f1881e20df96f9a No hard coded boot menu diff -r 912635ac019d -r 26423b57df46 download.php --- a/download.php Tue Sep 17 10:24:42 2019 +0200 +++ b/download.php Fri Sep 20 21:20:45 2019 +0200 @@ -2,6 +2,8 @@ function download($file,$name='') { + $files = explode(" ",$file); + $file = $files[0]; if ($name == '') $name = basename($file); if (isset($_POST['tmp_dir'])) @@ -18,14 +20,12 @@ if (isset($_POST['download'])) { switch (substr($_POST['download'],0,6)) { case "Kernel" : download("fs/boot/bzImage","kernel"); - case "Memtes" : download("fs/boot/memtest"); - case "GPXE (" : download("fs/boot/gpxe"); - case "IPXE (" : download("fs/boot/ipxe"); case "Rootfs" : download("rootfs.gz"); case "packag" : download("fs/etc/packages.conf"); case "Config" : shell_exec("sudo ./helper --mkcfg ".$_POST['tmp_dir']); download("config_files.cpio.gz"); case "Floppy" : $n=substr($_POST['download'],6,1); + if ($n == " ") $n="1"; shell_exec("./helper --mkimg ".$_POST['tmp_dir']." ". $_POST['fdsize']." ".$n); download("floppy".$n.".img"); @@ -37,6 +37,7 @@ case "linux." : download("fs/boot/config","linux.config"); case "busybo" : download("fs/boot/config-busybox","busybox.config"); case "post_i" : download("post_install.log"); + default : download("fs/boot/".strtolower($_POST['download'])); } } if (isset($_GET['dl'])) { diff -r 912635ac019d -r 26423b57df46 helper --- a/helper Tue Sep 17 10:24:42 2019 +0200 +++ b/helper Fri Sep 20 21:20:45 2019 +0200 @@ -213,14 +213,67 @@ -get_suggested() +list_suggested() { local pkg pkg=pkgs/$1/receipt - [ -s $pkg ] || pkg=$2/pkgs/$1/receipt + TMPDIR=$2 + [ -s $pkg ] || pkg=$TMPDIR/pkgs/$1/receipt [ -s $pkg ] || pkg=$(get_receipt $@) + SUGGESTED= . $pkg - echo -n $SUGGESTED + SUGG= + for i in $SUGGESTED; do + case " $@ " in + *\ $i\ *);; + *) SUGG="$SUGG $i";; + esac + done + if [ "$SUGG" ]; then + cat < +

+ You may want to install the following package(s) too: +

+
+ + + + + + + + + + + + + +EOT + checked='checked="checked" ' + [ $TMPDIR/uploadconf ] && checked= + for i in $SUGG; do + i=$(grep -l "PACKAGE=\"$i\"" pkgs/*/receipt) + . $i + cat < + + + + + + + + + +EOT + done + cat < +
 PackageVersionDescriptionDiskMemory 
$PACKAGE$VERSION$SHORT_DESC$PACKED_SIZE$UNPACKED_SIZE$(grep -qs ^config_form $i && echo '»')
+
+EOT + fi } @@ -374,6 +427,15 @@ } +boot_files() +{ + [ -s $1/fs/boot/bootmenu ] && while read bin button text; do + cat < +EOT + done < $1/fs/boot/bootmenu +} lzma_set_size() @@ -395,19 +457,20 @@ case "$1" in - --list-modules) list_modules $@ ;; - --list-kernels) list_kernels $@ ;; - --list-pkgs) list_pkgs $@ ;; + --list-modules) list_modules $@ ;; + --list-kernels) list_kernels $@ ;; + --list-pkgs) list_pkgs $@ ;; --get-form) get_form $2 $3 ;; --get-note) get_note $2 $3 ;; - --pre-install) do_pre_install $2 $3 ;; - --post-install) do_post_install $2 $3 ;; + --pre-install) do_pre_install $2 $3 ;; + --post-install) do_post_install $2 $3 ;; --depends) get_depends $@ ;; - --pkgs-extract) pkgs_extract $2 $3 ;; + --pkgs-extract) pkgs_extract $2 $3 ;; --remove) rm -rf $2; exit ;; --get-pkg) get_package $2 $3 ;; - --get-suggested) get_suggested $2 $3 ;; + --list-suggested) list_suggested $2 $3 $@ ;; --init) init ;; + --boot-files) boot_files $2 ;; esac @@ -445,20 +508,16 @@ append initrd=/boot/rootfs rw root=/dev/null vga=normal EOT - while read bin keys; do - [ -s $tmp/fs/boot/$bin ] && - cp $tmp/fs/boot/$bin $tmp/iso/boot/ && - KEY="$KEY ${keys%% *}" && + [ -s $tmp/fs/boot/bootmenu ] && while read bin keys text; do + keys=${keys#*,} + KEY="$KEY ${keys%%,*}" + cp $tmp/fs/boot/$bin $tmp/iso/boot/$bin cat >> $tmp/iso/boot/isolinux/isolinux.cfg <> \ $tmp/iso/boot/isolinux/isolinux.cfg cat >> $tmp/iso/boot/isolinux/isolinux.cfg < /dev/null split -b ${3:-1474560} out diff -r 912635ac019d -r 26423b57df46 step4.php --- a/step4.php Tue Sep 17 10:24:42 2019 +0200 +++ b/step4.php Fri Sep 20 21:20:45 2019 +0200 @@ -34,32 +34,8 @@ $_POST['tmp_dir']); unset($pkgs[$key]); $_POST['toconfigure'] = implode(" ", $pkgs); - $suggested = shell_exec("./helper --get-suggested $pkg ". - $_POST['tmp_dir']); - if ($suggested != "") { - $sugghead = << -

- You may want to install the following package(s) too: -

-
    -EOT; - $checked = "checked=\"checked\" "; - if (file_exists($_POST["tmp_dir"]."uploadconf")) $checked = ""; - foreach (explode(" ", $suggested) as $sug) - if (!strstr(" ".$_POST['packages']." ", - " ".$sug." ")) { - $output .= $sugghead ; - $sugghead = ""; - $output .= << - $sug - -EOT; - } - if ($sugghead == "") - $output .= "
\n"; - } + $output .= shell_exec("./helper --list-suggested $pkg ". + $_POST['tmp_dir']." ".$_POST['packages']); if ($output == "") { shell_exec("sudo ./helper --post-install $pkg ". $_POST['tmp_dir']); diff -r 912635ac019d -r 26423b57df46 step5.php --- a/step5.php Tue Sep 17 10:24:42 2019 +0200 +++ b/step5.php Fri Sep 20 21:20:45 2019 +0200 @@ -21,7 +21,6 @@ @@ -101,6 +90,7 @@
Bootable images:
-
+ )" type="submit" /> )" title="For the initrd= parameter" type="submit" /> - - )" type="submit" /> - - - )" type="submit" /> - - - )" type="submit" /> - +