The generic Linux installer is incompatible with Ubuntu
Posted: 20 Feb 2024, 23:10
Porteus User Forum
https://forum.porteus.org/
try this one, some quoting added , untested here, because my device names are names not sentences :p
lolncmprhnsbl wrote: ↑21 Feb 2024, 02:10try this one, some quoting added , untested here, because my device names are names not sentences :p
Code: Select all
bash Porteus-installer-for-Linux.com --info
Code: Select all
$ mkdir /home/bob/myfiles
$ touch /home/bob/myfiles/super_important_stuff
$ bash Porteus-installer-for-Linux.com --target "/home/bob/myfiles 2"
...
Installer needs roots privileges to run
# Then this happens: rm -rf /home/bob/myfiles 2/...
# super_important_stuff got deleted
apparently i didn't ..
Code: Select all
Identification: Porteus Installer
Target directory: build
Uncompressed size: 512 KB
Compression: gzip
Encryption: n
Date of packaging: Wed Feb 21 16:01:58 AEST 2024
Built with Makeself version 2.5.0
Build command was: ./makeself.sh \
"build" \
"Porteus-installer-for-Linux.com" \
"Porteus Installer" \
"./.porteus_installer/installer.com"
Script run after extraction:
./.porteus_installer/installer.com
build will be removed after extractionChecked √ncmprhnsbl wrote: ↑21 Feb 2024, 06:47md5sum: 2acc0428f66ce7bcd2a002d1493bd490 (all the previous links are the same file)
Their cleanup was different when targetdir was "." (including at one point erroring trying to remove "."
So sorry to bother you.
Code: Select all
# would have installed extlinux to user's system drive ("df -P /tmp" -> /dev/sda3)
"$bin"/$extlinux -i "$IPT"/syslinux >/dev/null 2>&1
Code: Select all
"$bin"/$extlinux -i "$USER_PWD"/syslinux >/dev/null 2>&1
Code: Select all
cd "$TMPROOT"
export USER_PWD="$tmpdir"
exec "$SCRIPT_COPY" --phase2 -- $initargs
Code: Select all
IPT="$USER_PWD"
bin="$PWD/.porteus_installer"
good catch ..
Code: Select all
IPT="$USER_PWD"
PWD="$(pwd)"
bin="$PWD/.porteus_installer"
extlinux_conf="$IPT/syslinux/porteus.cfg"
lilo_menu="$IPT/syslinux/lilo.menu"
log="/tmp/debug.txt"
PRT=$(df -P "$IPT" | grep -o '^/dev/[^ ]\+')
MPT=$(grep "^$PRT" /proc/mounts | cut -d' ' -f2)
DEV=/dev/$(lsblk -ndo pkname "$PRT")
PRTN=$(echo ${PRT#"$DEV"} | sed 's/[^0-9]*//g')
FS=$(grep -w "$PRT" /proc/mounts | head -n1 | cut -d" " -f3)Code: Select all
./makeself.sh build Porteus-installer-for-Linux.com 'Porteus Installer' './.porteus_installer/installer.com'Code: Select all
./makeself.sh <directory_containing_.porteus_installer_tree> <name_of_makeself_archive> <label> <script_executed_on_extraction>well, the breakage would only occur on building with a new version makeself with changed behavior and should become apparent at that time..
I like this
Maybe the thought behind it is: "If you aren't keep="y"'ing the files, then why should you care where it extracts? No place can be better than /tmp."
OK, I got Porteus to fully boot from exFAT on LILO, but it required a few more fixes.ncmprhnsbl wrote: ↑23 Feb 2024, 02:43Porteus-installer-for-Linux.com
md5sum: 6775063fd7eff3030e8285dfaabb886a (all the previous links are the same file)
Code: Select all
"$bin"/lilo.com -P ignore -C "$lilo_menu" -S "$IPT"/syslinux -m "$IPT"/syslinux/lilo.map >/dev/null 2>&1
Code: Select all
Warning: /media/josh/Porteus/boot/syslinux/lilo.menu should be owned by root
Warning: /dev/sdd1 is not on the first disk
Warning: partition type 0x07 on device 0x0831 is a dangerous place for
a boot sector. A DOS/Windows system may be rendered unbootable.
The backup copy of this boot sector should be retained.
Proceed? [N/y]
Code: Select all
if [ $(echo $* | grep -Eqo "\-f( |\$)") ]; then
LILO=MBR
else
Code: Select all
[ $(echo "hi" | grep -q "hi") ] && echo "this will never print"
[ $(echo "bye" | grep -q "hi") ] && echo "this will never print"
Code: Select all
if echo $* | grep -Eqo "\-f( |\$)"; then
LILO=MBR
else
Code: Select all
if [ $(echo "$FS" | grep -q xfs) ]; then
Code: Select all
if echo "$FS" | grep -q xfs; then
Code: Select all
echo "Installing Porteus to $PRT"
if [ ! $(echo $* | grep -Eqo "\-a( |\$)") ]; then
Code: Select all
echo "Installing Porteus to $PRT"
if ! echo $* | grep -Eqo "\-a( |\$)"; then
Code: Select all
sudo bash Porteus-installer-for-Linux.com -- -f
Code: Select all
if echo $* | grep -Eqo "\-f( |\$)" || echo "$FS" | grep -q exfat; then
Code: Select all
image=DO_NOT_CHANGE/vmlinuz
initrd=DO_NOT_CHANGE/initrd.xz
Code: Select all
image="DO_NOT_CHANGE/vmlinuz"
initrd="DO_NOT_CHANGE/initrd.xz"
Ah, this applies only to @ncmprhnsbl's upload.
heh, i made the fatal error of thinking i knew what i was doing.. :p ..here's an update i hopefully havn't broken some other way..
done, and this:
Code: Select all
if echo $* | grep -Eqo "\-f( |\$)" || echo "$FS" | grep -q exfat; thenI don't know how Shellcheck misses this (it does!),
Code: Select all
if $(whoami) != root; then
Code: Select all
if [ $(whoami) != root ]; then