shell
This commit is contained in:
parent
98f43cc3d4
commit
fb83ac9cf6
1 changed files with 145 additions and 144 deletions
|
@ -30,27 +30,27 @@ grub-legacy maintenance
|
||||||
|
|
||||||
boot/grub/grub.cfg
|
boot/grub/grub.cfg
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
search --set --fs-uuid "YYYY-MM-DD-hh-mm-ss-cc"
|
|
||||||
```
|
search --set --fs-uuid "YYYY-MM-DD-hh-mm-ss-cc"
|
||||||
|
|
||||||
Or at worst:
|
Or at worst:
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
search --set --label "LA_BEL"
|
|
||||||
```
|
search --set --label "LA_BEL"
|
||||||
|
|
||||||
# Générer une image modulaire
|
# Générer une image modulaire
|
||||||
|
|
||||||
/bin/tar
|
/bin/tar
|
||||||
```bash
|
.. code:: shell
|
||||||
tar
|
|
||||||
--create
|
tar
|
||||||
--dereference
|
--create
|
||||||
--file='grub.tar'
|
--dereference
|
||||||
--verbose
|
--file='grub.tar'
|
||||||
boot
|
--verbose
|
||||||
```
|
boot
|
||||||
|
|
||||||
* moddep.lst
|
* moddep.lst
|
||||||
* kernel.img
|
* kernel.img
|
||||||
|
@ -59,14 +59,14 @@ boot
|
||||||
* *.mod
|
* *.mod
|
||||||
|
|
||||||
/usr/bin/grub-mkimage
|
/usr/bin/grub-mkimage
|
||||||
```bash
|
.. code:: shell
|
||||||
grub-mkimage
|
|
||||||
--directory='i386-pc'
|
grub-mkimage
|
||||||
--format='i386-pc'
|
--directory='i386-pc'
|
||||||
--memdisk='grub.tar'
|
--format='i386-pc'
|
||||||
--output='i386-pc/core.img'
|
--memdisk='grub.tar'
|
||||||
modules…
|
--output='i386-pc/core.img'
|
||||||
```
|
modules…
|
||||||
|
|
||||||
i386-pc-eltorito for ISO encapsulation
|
i386-pc-eltorito for ISO encapsulation
|
||||||
|
|
||||||
|
@ -76,11 +76,11 @@ i386-pc-eltorito for ISO encapsulation
|
||||||
* core.img
|
* core.img
|
||||||
|
|
||||||
/usr/sbin/grub-bios-setup
|
/usr/sbin/grub-bios-setup
|
||||||
```bash
|
.. code:: shell
|
||||||
grub-bios-setup \
|
|
||||||
--directory="i386-pc" \
|
grub-bios-setup \
|
||||||
/dev/sd?
|
--directory="i386-pc" \
|
||||||
```
|
/dev/sd?
|
||||||
|
|
||||||
# Créer un menu de démarrage
|
# Créer un menu de démarrage
|
||||||
|
|
||||||
|
@ -122,12 +122,13 @@ cmdpath (hd?)
|
||||||
|
|
||||||
## fichier de persistence d’environnement
|
## fichier de persistence d’environnement
|
||||||
|
|
||||||
/usr/bin/grub-editenv
|
* /usr/bin/grub-editenv
|
||||||
```bash
|
|
||||||
grub-editenv file create
|
.. code:: shell
|
||||||
grub-editenv file set variable=value
|
|
||||||
grub-editenv file unset variable
|
grub-editenv file create
|
||||||
```
|
grub-editenv file set variable=value
|
||||||
|
grub-editenv file unset variable
|
||||||
|
|
||||||
## démarrer un système préparé
|
## démarrer un système préparé
|
||||||
|
|
||||||
|
@ -145,153 +146,153 @@ grub-editenv file unset variable
|
||||||
|
|
||||||
* /live/name.squashfs
|
* /live/name.squashfs
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
linux /live/subdir/vmlinuz boot="live" toram="subdir/name.squashfs"
|
|
||||||
initrd /live/subdir/initrd.img
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
linux /live/subdir/vmlinuz boot="live" toram="subdir/name.squashfs"
|
||||||
loopback loop /live/dir/name.squashfs
|
initrd /live/subdir/initrd.img
|
||||||
linux (loop)/vmlinuz boot="live" toram="dir/name.squashfs"
|
|
||||||
initrd (loop)/initrd.img
|
.. code:: shell
|
||||||
```
|
|
||||||
|
loopback loop /live/dir/name.squashfs
|
||||||
|
linux (loop)/vmlinuz boot="live" toram="dir/name.squashfs"
|
||||||
|
initrd (loop)/initrd.img
|
||||||
|
|
||||||
* Debian installed
|
* Debian installed
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
unset path
|
|
||||||
uuid="????????-????-????-????-????????????"
|
unset path
|
||||||
search --set="path" --fs-uuid "${uuid}"
|
uuid="????????-????-????-????-????????????"
|
||||||
if [ "${path}" ]; then
|
search --set="path" --fs-uuid "${uuid}"
|
||||||
path="(${path})"
|
if [ "${path}" ]; then
|
||||||
linux "${path}/vmlinuz" \
|
path="(${path})"
|
||||||
elevator=deadline \
|
linux "${path}/vmlinuz" \
|
||||||
root=UUID=${uuid}
|
elevator=deadline \
|
||||||
initrd "${path}/initrd.img"
|
root=UUID=${uuid}
|
||||||
fi
|
initrd "${path}/initrd.img"
|
||||||
```
|
fi
|
||||||
|
|
||||||
* Debian Installer
|
* Debian Installer
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
linux "/path/to/vmlinuz" priority="low"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
linux "/path/to/vmlinuz" priority="low"
|
||||||
linux "/path/to/vmlinuz" auto="true" \
|
|
||||||
file="/hd-media/path/to/preseed"
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
.. code:: shell
|
||||||
|
|
||||||
```bash
|
linux "/path/to/vmlinuz" auto="true" \
|
||||||
initrd /path/to/gtk/initrd.gz
|
file="/hd-media/path/to/preseed"
|
||||||
```
|
|
||||||
|
|
||||||
---
|
----
|
||||||
|
|
||||||
|
.. code:: shell
|
||||||
|
|
||||||
|
initrd /path/to/gtk/initrd.gz
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
La recherche d’ISO ne va pas à plus d’1 niveau d’arborescence !
|
La recherche d’ISO ne va pas à plus d’1 niveau d’arborescence !
|
||||||
|
|
||||||
Peut-on vraiment spécifier quelle ISO au préalable ?!
|
Peut-on vraiment spécifier quelle ISO au préalable ?!
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
iso-scan/ask_second_pass="true" iso-scan/filename="/path/to/file.iso"
|
|
||||||
```
|
iso-scan/ask_second_pass="true" iso-scan/filename="/path/to/file.iso"
|
||||||
|
|
||||||
* Debian Live
|
* Debian Live
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
file="/path/to.iso"
|
|
||||||
loopback loop "${file}"
|
file="/path/to.iso"
|
||||||
path="(loop)/live"
|
loopback loop "${file}"
|
||||||
linux "${path}/vmlinuz" boot="live" findiso="${file}" components
|
path="(loop)/live"
|
||||||
initrd "${path}/initrd.img"
|
linux "${path}/vmlinuz" boot="live" findiso="${file}" components
|
||||||
```
|
initrd "${path}/initrd.img"
|
||||||
|
|
||||||
* PartedMagic
|
* PartedMagic
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
file="/path/to.iso"
|
|
||||||
loopback loop ${file}
|
file="/path/to.iso"
|
||||||
path="(loop)/pmagic"
|
loopback loop ${file}
|
||||||
linux "${path}/bzImage64" iso_filename="${file}" load_ramdisk=1
|
path="(loop)/pmagic"
|
||||||
initrd "${path}/initrd.img" "${path}/fu.img" "${path}/m64.img"
|
linux "${path}/bzImage64" iso_filename="${file}" load_ramdisk=1
|
||||||
```
|
initrd "${path}/initrd.img" "${path}/fu.img" "${path}/m64.img"
|
||||||
|
|
||||||
* Windows
|
* Windows
|
||||||
|
|
||||||
```
|
.. code:: shell
|
||||||
menuentry "Windows" {
|
|
||||||
drivemap -s (hd0) (hd1)
|
menuentry "Windows" {
|
||||||
chainloader (hd0,msdos2)+1
|
drivemap -s (hd0) (hd1)
|
||||||
}
|
chainloader (hd0,msdos2)+1
|
||||||
```
|
}
|
||||||
|
|
||||||
* CloneZilla
|
* CloneZilla
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
file="/path/to/file.iso"
|
|
||||||
loopback loop "${file}"
|
|
||||||
path="(loop)/live"
|
|
||||||
linux "${path}/vmlinuz" findiso="${file}" \
|
|
||||||
boot="live" union="overlay" \
|
|
||||||
username="user" config components \
|
|
||||||
toram="filesystem.squashfs" ip="" \
|
|
||||||
locales="en_US.UTF-8" keyboard-layouts="fr-latin9" \
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
file="/path/to/file.iso"
|
||||||
|
loopback loop "${file}"
|
||||||
|
path="(loop)/live"
|
||||||
|
linux "${path}/vmlinuz" findiso="${file}" \
|
||||||
|
boot="live" union="overlay" \
|
||||||
|
username="user" config components \
|
||||||
|
toram="filesystem.squashfs" ip="" \
|
||||||
|
locales="en_US.UTF-8" keyboard-layouts="fr-latin9" \
|
||||||
|
|
||||||
```bash
|
----
|
||||||
ocs_live_batch="yes" \
|
|
||||||
ocs_prerun="mount /dev/disk/by-uuid/${cz_home} /mnt" \
|
|
||||||
ocs_prerun1="mount --bind /mnt/${cz_partimag} /home/partimag" \
|
|
||||||
ocs_live_run="ocs-live-restore" \
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
ocs_live_extra_param="\
|
|
||||||
-e1 auto -e2 -t -r -j2 -cs -k \
|
|
||||||
-p reboot restoreparts ask_user ${cz_target}"
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
ocs_live_batch="yes" \
|
||||||
ocs_live_extra_param="\
|
ocs_prerun="mount /dev/disk/by-uuid/${cz_home} /mnt" \
|
||||||
-q2 -j2 -rm-win-swap-hib -gs -z1p -i 1000000 -fsck-y \
|
ocs_prerun1="mount --bind /mnt/${cz_partimag} /home/partimag" \
|
||||||
-p reboot saveparts ask_user ${cz_target}"
|
ocs_live_run="ocs-live-restore" \
|
||||||
```
|
|
||||||
|
|
||||||
---
|
.. code:: shell
|
||||||
|
|
||||||
```bash
|
ocs_live_extra_param="\
|
||||||
ocs_live_batch="no" \
|
-e1 auto -e2 -t -r -j2 -cs -k \
|
||||||
ocs_live_run="ocs-live-general" \
|
-p reboot restoreparts ask_user ${cz_target}"
|
||||||
```
|
|
||||||
|
|
||||||
---
|
.. code:: shell
|
||||||
|
|
||||||
```bash
|
ocs_live_extra_param="\
|
||||||
initrd "${path}/initrd.img"
|
-q2 -j2 -rm-win-swap-hib -gs -z1p -i 1000000 -fsck-y \
|
||||||
```
|
-p reboot saveparts ask_user ${cz_target}"
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
.. code:: shell
|
||||||
|
|
||||||
|
ocs_live_batch="no" \
|
||||||
|
ocs_live_run="ocs-live-general" \
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
.. code:: shell
|
||||||
|
|
||||||
|
initrd "${path}/initrd.img"
|
||||||
|
|
||||||
* ISO
|
* ISO
|
||||||
|
|
||||||
```bash
|
.. code:: shell
|
||||||
xorrisofs \
|
|
||||||
\
|
xorrisofs \
|
||||||
-output live-grub.iso \
|
\
|
||||||
\
|
-output live-grub.iso \
|
||||||
-volid "LIVE_GRUB" \
|
\
|
||||||
-boot-info-table \
|
-volid "LIVE_GRUB" \
|
||||||
-no-emul-boot \
|
-boot-info-table \
|
||||||
--modification-date="YYYYMMDDhhmmsscc" \
|
-no-emul-boot \
|
||||||
-eltorito-boot live/boot/grub/2.02-2/i386-pc/core.img \
|
--modification-date="YYYYMMDDhhmmsscc" \
|
||||||
-eltorito-catalog "boot.cat" \
|
-eltorito-boot live/boot/grub/2.02-2/i386-pc/core.img \
|
||||||
--boot-catalog-hide \
|
-eltorito-catalog "boot.cat" \
|
||||||
\
|
--boot-catalog-hide \
|
||||||
-exclude live/sources \
|
\
|
||||||
-exclude live/boot/debian.squashfs/debootstrap \
|
-exclude live/sources \
|
||||||
-exclude live/boot/debian.squashfs/live \
|
-exclude live/boot/debian.squashfs/debootstrap \
|
||||||
-root "live" \
|
-exclude live/boot/debian.squashfs/live \
|
||||||
"live"
|
-root "live" \
|
||||||
```
|
"live"
|
||||||
|
|
Loading…
Reference in a new issue