# HG changeset patch # User Pascal Bellard # Date 1394374197 0 # Node ID 8cf93f4aedd19ea7ec54dfc8b408c48e06c2c547 # Parent 311ad10166ae876f65ff858c5d80f4e866431e3f syslinux/iso2exe: fix 'a la umsdos' install diff -r 311ad10166ae -r 8cf93f4aedd1 ffmpeg-git/receipt --- a/ffmpeg-git/receipt Sun Mar 09 11:49:44 2014 +0100 +++ b/ffmpeg-git/receipt Sun Mar 09 14:09:57 2014 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="ffmpeg-git" -VERSION="snapshot" +VERSION="20140308" CATEGORY="multimedia" SHORT_DESC="Record, convert and stream audio and video (Devel version)." MAINTAINER="pankso@slitaz.org" diff -r 311ad10166ae -r 8cf93f4aedd1 shell-detector/receipt --- a/shell-detector/receipt Sun Mar 09 11:49:44 2014 +0100 +++ b/shell-detector/receipt Sun Mar 09 14:09:57 2014 +0000 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="shell-detector" -VERSION="current" +VERSION="20140308" CATEGORY="network" SHORT_DESC="Web shell detection tool." MAINTAINER="pascal.bellard@slitaz.org" diff -r 311ad10166ae -r 8cf93f4aedd1 syslinux/stuff/iso2exe/boot.c --- a/syslinux/stuff/iso2exe/boot.c Sun Mar 09 11:49:44 2014 +0100 +++ b/syslinux/stuff/iso2exe/boot.c Sun Mar 09 14:09:57 2014 +0000 @@ -44,7 +44,9 @@ if (magic < 0x20630) init = ""; // Does not support multiple initramfs if (magic > 0) { - fmt = "rw root=/dev/null%s iso=%s magic=%lu mode=%s"; + fmt = "rw root=/dev/null%s iso=%s magic=%lu mode=%s autologin"; + if (rootfs[6] != '.' && !isoopen("rootfs.gz")) + loadinitrd(); // for loram isoopen(rootfs); loadinitrd(); if (*init) { diff -r 311ad10166ae -r 8cf93f4aedd1 syslinux/stuff/iso2exe/bootlinux.c --- a/syslinux/stuff/iso2exe/bootlinux.c Sun Mar 09 11:49:44 2014 +0100 +++ b/syslinux/stuff/iso2exe/bootlinux.c Sun Mar 09 14:09:57 2014 +0000 @@ -91,8 +91,7 @@ #define ZIMAGE_SUPPORT #ifdef ZIMAGE_SUPPORT -static int zimage = 0; -static unsigned zimage_base; +static unsigned zimage = 0; static unsigned getss(void) { #asm @@ -230,9 +229,8 @@ } if (!setup_version || !(buffer[LOADFLAGS] & 1)) { #ifdef ZIMAGE_SUPPORT - zimage = 1; - zimage_base = getss() + 0x1000L; - mem.base = zimage_base * 16L; + zimage = getss() + 0x1000; + mem.base = zimage * 16L; if (mem.base + syssize > SETUP_SEGMENT*16L - 32) die("Out of memory"); #else @@ -332,11 +330,12 @@ mov sp, #CMDLINE_OFFSET #endasm #ifdef ZIMAGE_SUPPORT - if (zimage) { #asm + mov bx, _zimage + or bx, bx + jz notzimage mov eax, _mem shr eax, #4 // top - mov bx, _zimage_base mov dx, #0x1000 push cs pop ds @@ -361,8 +360,8 @@ inc dx cmp ax,bx jne sysmove +notzimage: #endasm - } #endif #asm push ss diff -r 311ad10166ae -r 8cf93f4aedd1 syslinux/stuff/iso2exe/init --- a/syslinux/stuff/iso2exe/init Sun Mar 09 11:49:44 2014 +0100 +++ b/syslinux/stuff/iso2exe/init Sun Mar 09 14:09:57 2014 +0000 @@ -13,6 +13,21 @@ sed "/$1=/!d;s/.*$1=\\([^ ]*\\).*/\\1/" /proc/cmdline } +mount_proc() +{ + mount -t proc /proc /proc + mount -t sysfs /sys /sys + udevd --daemon 2> /dev/null && udevadm trigger && sleep 5 +} + +umount_proc() +{ + killall udevd 2> /dev/null + umount /sys/fs/fuse/connections 2> /dev/null + umount /sys + umount /proc +} + gettazboot() { echo "Creating $(basename $1) ..." @@ -61,7 +76,7 @@ getuuid() { dev=$(mount | sed '/ \/mnt /!d;s/ .*//;s|/dev/||;q') - blkid | sed "/$dev:/!d;s/.*UUID=.\\([^ ]*\\)\".*/\\1/" + blkid | sed "/$dev:/!d;s/.* UUID=.\\([^ ]*\\)\".*/\\1/" } mkinitrd() @@ -70,7 +85,7 @@ for i in bin lib dev proc tmp mnt etc ; do mkdir -p /tmp/fs/$i done - for i in /dev/console /dev/null /dev/tty /dev/tty1 /dev/fuse \ + for i in /dev/console /dev/null /dev/tty /dev/tty1 /dev/tty2 /dev/fuse \ /dev/hd* /dev/sd* ; do cp -a $i /tmp/fs$i done @@ -84,6 +99,10 @@ [ -e /tmp/fs/bin/${i%,} ] || ln -s busybox /tmp/fs/bin/${i%,} done ln -s /proc/mounts /tmp/fs/etc/mtab + sed 's/ .*//' /proc/modules | while read mod ; do + find /lib/modules/ | grep $mod.ko | \ + sed 's|.*|cp & /tmp/fs/lib|' | sh + done cat > /tmp/fs/init < /dev/null || ls $@ +} + doinstall() { mkdir -p /mnt/slitaz/boot /mnt/slitaz/mnt/dos - mount.posixovl -F /mnt/slitaz || return - echo "Install root filesystem..." + if ! mount.posixovl -F /mnt/slitaz -- \ + -oallow_other -odefault_permissions -osuid; then + echo "Can't install SliTaz. Abort." + sleep 5 + return 1 + fi + echo "Install root filesystem in /slitaz..." if [ -n "$1" ]; then if [ -d /media/cdrom/fs ]; then ( cd /mnt/slitaz/fs; find | cpio -o -H newc ) | gzip -9 else - ls -r /media/cdrom/boot/rootfs* | xargs cat + ls_r /media/cdrom/boot/rootfs* | xargs cat fi > /mnt/slitaz/boot/rootfs.gz mkdir /mnt/slitaz/home initrd=rootfs.gz @@ -137,13 +169,13 @@ [ -s $(basename $i) ] && continue cpio -i $i done - for i in $(ls -r /media/cdrom/boot/rootfs*); do + for i in $(ls_r /media/cdrom/boot/rootfs*); do mount -o loop,ro $i /sqfs/mnt cp -a /sqfs/mnt/. /mnt/slitaz umount -d /sqfs/mnt done else - for i in $(ls -r /media/cdrom/boot/rootfs*); do + for i in $(ls_r /media/cdrom/boot/rootfs*); do uncpio $i /mnt/slitaz done fi @@ -159,24 +191,29 @@ done gettazboot /mnt/slitaz/boot/tazboot.exe unix2dos > /mnt/slitaz/boot/tazboot.cmd <> /mnt/boot.ini <> /mnt/boot.ini <> /mnt/config.sys <> /mnt/config.sys && + echo "Update autoexec.bat ..." && + unix2dos >> /mnt/autoexec.bat < /dev/null + return 0 } install() @@ -195,10 +232,10 @@ start SliTaz Live with 'SliTaz RAM boot' menu.\n " 19 70 [ $? -eq 0 ] || return - doinstall - [ -x /sbin/init ] || return + doinstall || return + [ -x /mnt/slitaz/sbin/init ] || return umount -d /media/cdrom - umount /proc + umount_proc exec chroot /mnt/slitaz /sbin/init } @@ -218,11 +255,11 @@ start SliTaz Live with 'SliTaz RAM boot' menu.\n " 19 70 [ $? -eq 0 ] || return - doinstall tazusblike + doinstall tazusblike || return if [ -d /media/cdrom/fs ]; then zcat /mnt/slitaz/boot/rootfs.gz | cpio -idmu else - for i in $(ls -r /media/cdrom/boot/rootfs*); do + for i in $(ls_r /media/cdrom/boot/rootfs*); do ( zcat $i 2> /dev/null || unlzma -c $i ) | cpio -idmu done fi @@ -230,7 +267,7 @@ umount -d /media/cdrom mount --move /mnt /mnt/dos ln -s /mnt/dos/slitaz/home /home - umount /proc + umount_proc exec /sbin/init } @@ -338,6 +375,12 @@ dd if=/media/cdrom/boot/?pxe of=/dev/fd0 } +gotposixovl() +{ + mount.posixovl 2>&1 | grep -qi usage && + echo -en "\"$1\" \"$2\"" +} + xfile() { [ -n "$(which $1)" ] && echo -en "\"$2\" \"$3\"" @@ -481,14 +524,14 @@ umount_loram umount -d /media/cdrom umount /mnt - umount /proc + umount_proc exec /init } live() { n=0 - for i in $(ls -r /media/cdrom/boot/rootfs*); do + for i in $(ls_r /media/cdrom/boot/rootfs* 2> /dev/null); do [ $((n++)) -eq 0 ] || uncpio $i done text @@ -516,16 +559,16 @@ BIN=bin/mount.posixovl [ -x /usr/s$BIN ] || mv /bin/mount.posixovl.iso2exe \ /usr/s$BIN 2> /dev/null || mv /bin/mount.posixovl.iso2exe /$BIN -mount -t proc /proc /proc +mount_proc ISO="$(getarg iso | sed 's/.://;s|\\|/|g')" getiso mount_loram -case "$(basename $ISO | tr [A-Z] [a-z])$(getarg mode)" in +case "${ISO##*/}$(getarg mode)" in *install*) install ;; *live*) live ;; *text*) text ;; esac -which $DIALOG || live +which $DIALOG 2> /dev/null || live dmesg > /tmp/dmesg while true; do @@ -533,16 +576,16 @@ $DIALOG --clear \ --title " Welcome to SliTaz " \ --menu "" 21 70 15 \ - "live" "SliTaz RAM boot" \ +$(cdfile boot/bzImage "live" "SliTaz RAM boot") \ "text" "SliTaz RAM boot (text mode only)" \ $(cdfile README "readme" "Show the README file") \ $(cdfile md5sum "md5" "Check ISO files") \ -$(xfile mount.posixovl "install" "Hard disk installation (UMSDOS way)") \ -$(xfile mount.posixovl "installtaz" "Hard disk installation (TAZUSB way)") \ +$(gotposixovl "install" "Hard disk installation (UMSDOS way)") \ +$(gotposixovl "installtaz" "Hard disk installation (TAZUSB way)") \ $(xfile tazusb "usbkey" "USB key read/write installation") \ - "usbbootkey" "USB boot key (read only)" \ +$(cdfile boot/bzImage "usbbootkey" "USB boot key (read only)") \ $(fddata "fdbootstrap" "Floppy bootstrap") \ - "tazboot" "Get tazboot.exe Linux loader" \ +$(cdfile boot/bzImage "tazboot" "Get tazboot.exe Linux loader") \ $(cdexe boot/memtest "memtest" "Get Memtest86") \ $(cdfile boot/memtest "fdmemtest" "Create a Memtest86 boot floppy") \ $(cdexe boot/gpxe "pxe" "Get SliTaz Web boot utility") \