# HG changeset patch
# User Pascal Bellard
# Date 1444253822 -7200
# Node ID 577e6e91216d12183b32e69f9b1646c208c51130
# Parent 1d33b2a537852d6c1c76e43f111bb27c93e133f4
refresh
diff -r 1d33b2a53785 -r 577e6e91216d bootloader
--- a/bootloader Mon Sep 03 10:21:46 2012 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-#!/bin/sh
-#
-# This script creates a floppy image set from a linux bzImage and can merge
-# a cmdline and/or one or more initramfs.
-# The total size can not exceed 15M because INT 15H function 87H limitations.
-#
-# (C) 2009 Pascal Bellard - GNU General Public License v3.
-
-usage()
-{
-cat < /dev/null
- [ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2
-}
-
-# write a 32 bits data
-# usage: storelong offset data32 file
-storelong()
-{
- echo $2 | awk '{ printf "\\\\x%02X\\\\x%02X\\\\x%02X\\\\x%02X",
- $1%256,($1/256)%256,($1/256/256)%256,($1/256/256/256)%256 }' | \
- xargs echo -en | \
- dd bs=4 conv=notrunc of=$3 seek=$(( $1 / 4 )) 2> /dev/null
- [ -n "$DEBUG" ] && printf "storelong(%04X) = %08X\n" $1 $2 1>&2
-}
-
-# read a 32 bits data
-# usage: getlong offset file
-getlong()
-{
- dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \
- hexdump -e '"" 1/4 "%d" "\n"'
-}
-
-floppyset()
-{
- # bzImage offsets
- CylinderCount=496
- SetupSzOfs=497
- FlagsOfs=498
- SyssizeOfs=500
- VideoModeOfs=506
- RootDevOfs=508
- CodeAdrOfs=0x214
- RamfsAdrOfs=0x218
- RamfsLenOfs=0x21C
- ArgPtrOfs=0x228
-
- # boot+setup address
- SetupBase=0x90000
-
- stacktop=0x9E00
-
- bs=/tmp/bs$$
-
- # Get and patch boot sector
- # See http://hg.slitaz.org/wok/raw-file/711d076b277c/linux/stuff/linux-header-2.6.34.u
- dd if=$KERNEL bs=512 count=1 of=$bs 2> /dev/null
- uudecode < /dev/null
-begin-base64 644 -
-/L+6nWgAkAcGF4n8McC5HQDzq1sfD6mg8X1ABlfFd3ixBvOlZWaPR3gGH8ZF
-+D/6l1hB6DQBvgACA3QO6HYBWwseKAJ0LFNH6AoBXuhmAbAgzRCwCM0QTuhl
-ATwIdAOIBK05NigCdPDoPgE8CnXgiHz+ieb/TBD/TBi/9AGBTRz/gMdFMACc
-sBCxBUi0k4lEHLABiUQUmGaY0+BIZgMFZtPoaAAQB7+AACn4nHMCAccx21BW
-6J4AXrkAgLSH/kQczRVYnXfcoRoCvxwCsQk4RBxyuJPNE+oAACCQsEYoyL7b
-AejSAF3rI4D5E3IEOMF3a4D+AnIEOOZ3bGCB/QAGdCoGUlFTlrQCULEGtQTB
-xQSwDyHoBJAnFEAn6IwA/s117LAgzRDitOiWAJjNE2FSUCjIdwKwAZg5+HIC
-ifhQtALNE5VeWFpyoJVBjuGAxwJPdFFOdfSM4ZU4wXVFiMj+xrEBOOZ1O4j0
-/sW2AID9UHIwOi7wAXIqtQBgvt4B/kQMU+gxAFvoOAB1FlKYzRO4AQLNE1rQ
-1Dpk/nXqRgjkdeVh64sWB7AxLAO0DrsHAM0QPA1088OwDejv/6wIwHX4w79s
-BLFbZQINuA0BZToNdArNFnT0mM0Wju9Hw1g6AEluc2VydCBkaXNrIDEuBw0A
-AA==
-====
-EOT
-
- # Get setup
- setupsz=$(getlong $SetupSzOfs $bs)
- setupszb=$(( $setupsz & 255 ))
- dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs
-
- if [ -n "$TRACKS" ]; then
- [ -n "$DEBUG" ] && echo -n "--tracks " 1>&2
- n=$(getlong $CylinderCount $bs)
- store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs
- fi
- if [ -n "$FLAGS" ]; then
- [ -n "$DEBUG" ] && echo -n "--flags " 1>&2
- store16 $FlagsOfs $FLAGS $bs
- fi
- if [ -n "$VIDEO" ]; then
- [ -n "$DEBUG" ] && echo -n "--video " 1>&2
- store16 $VideoModeOfs $VIDEO $bs
- fi
- if [ -n "$RDEV" ]; then
- if [ "$(dirname $RDEV)" == "/dev" -a -b $RDEV ]; then
- [ -n "$DEBUG" ] && echo -n "--rdev " 1>&2
- RDEV=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null)
- store16 $RootDevOfs $RDEV $bs
- fi
- fi
-
- # Store cmdline after setup
- if [ -n "$CMDLINE" ]; then
- [ -n "$DEBUG" ] && echo -n "--cmdline '$CMDLINE' " 1>&2
- echo -n "$CMDLINE" | dd bs=512 count=1 conv=sync 2> /dev/null >> $bs
- storelong $ArgPtrOfs $(( $SetupBase + $stacktop )) $bs
- fi
-
- # Compute initramfs size
- initrdlen=0
- for i in $( echo $INITRD | sed 's/,/ /' ); do
- [ -s "$i" ] || continue
- [ -n "$DEBUG" ] && echo "--initrd $i " 1>&2
- initrdlen=$(( ($initrdlen + $(stat -c %s $i) + 3) & -4 ))
- done
- if [ $initrdlen -ne 0 ]; then
- [ -n "$DEBUG" ] && echo "initrdlen = $initrdlen " 1>&2
- storelong $RamfsAdrOfs \
- $(( (0x1000000 - $initrdlen) & 0xFFFF0000 )) $bs
- storelong $RamfsLenOfs $initrdlen $bs
- fi
-
- # Output boot sector + setup + cmdline
- dd if=$bs 2> /dev/null
-
- # Output kernel code
- dd if=$KERNEL bs=512 skip=$(( $setupszb + 1 )) 2> /dev/null
-
- # Pad to next sector
- Kpad=$(( 512 - ($(stat -c %s $KERNEL) & 511) ))
- [ $Kpad -eq 512 ] || dd if=/dev/zero bs=1 count=$Kpad 2> /dev/null
-
- # Output initramfs
- padding=0
- for i in $( echo $INITRD | sed 's/,/ /' ); do
- [ -s "$i" ] || continue
- [ $padding -ne 0 ] && dd if=/dev/zero bs=1 count=$padding 2> /dev/null
- dd if=$i 2> /dev/null
- padding=$(( 4 - ($(stat -c %s $i) & 3) ))
- [ $padding -eq 4 ] && padding=0
- done
-
- # Cleanup
- rm -f $bs
-}
-
-if [ "$FORMAT" == "0" ]; then # unsplitted
- floppyset > $PREFIX
- PAD=$(( 512 - ($(stat -c %s $PREFIX) % 512) ))
- [ $PAD -ne 512 ] && dd if=/dev/zero bs=1 count=$PAD >> $PREFIX 2> /dev/null
- exit
-fi
-floppyset | split -b ${FORMAT}k /dev/stdin floppy$$
-i=1
-ls floppy$$* | while read file ; do
- output=$PREFIX$(printf "%03d" $i)
- cat $file /dev/zero | dd bs=1k count=$FORMAT conv=sync of=$output 2> /dev/null
- echo $output
- rm -f $file
- i=$(( $i + 1 ))
-done
diff -r 1d33b2a53785 -r 577e6e91216d download.php
--- a/download.php Mon Sep 03 10:21:46 2012 +0200
+++ b/download.php Wed Oct 07 23:37:02 2015 +0200
@@ -24,6 +24,8 @@
download("config_files.cpio.gz");
case "Floppy" : shell_exec("./helper --mkimg ".$_POST['tmp_dir']);
download("slitaz.img");
+ case "DOS/EX" : shell_exec("./helper --mkexe ".$_POST['tmp_dir']);
+ download("slitaz.exe");
case "ISO im" : shell_exec("sudo ./helper --mkiso ".$_POST['tmp_dir']);
download("slitaz.iso");
case "System" : download("fs/boot/System.map");
diff -r 1d33b2a53785 -r 577e6e91216d helper
--- a/helper Mon Sep 03 10:21:46 2012 +0200
+++ b/helper Wed Oct 07 23:37:02 2015 +0200
@@ -43,12 +43,15 @@
esac
grep -qs "^$PACKAGE " $TMPDIR/uploadconf &&
checked='checked="checked"'
- if [ -n "$AUTO_SELECTION" ]; then
+ case "$AUTO_SELECTION" in
+ never)
+ checked='disabled' ;;
+ always)
checked='checked="checked" disabled'
cat <
EOT
- fi
+ esac
cat <
@@ -225,7 +228,7 @@
. $pkg
echo "$1 $VERSION $(md5sum $(dirname $pkg)/fs.cpio.lzma | awk '{ print $1 }')" >> $2/fs/etc/packages.conf
if grep -qs ^post_install $pkg; then
- . $2/vars
+ [ -s $2/vars ] && . $2/vars
echo "=== $pkg: $(date) ===" >> $2/post_install.log 2>&1
post_install $2/fs >> $2/post_install.log 2>&1
sed -e 's/^export/ /' -e 's/^/ /' < $2/vars >> $2/fs/etc/packages.conf
@@ -321,8 +324,9 @@
cp ../kernel boot/bzImage
fi
find -user bellard -exec chown root.root {} \;
- find | grep -v ^./boot | cpio -o -H newc | lzma e ../rootfs.gz -si
- lzma_set_size ../rootfs.gz
+ find | grep -v ^./boot | cpio -o -H newc | gzip -9 > ../rootfs.gz
+ which advdef 2> /dev/null && advdef -z4 ../rootfs.gz
+ find .. -exec ls -ld {} \; > /tmp/X
fi
if [ "x$1" == "x--mkiso" ]; then
tmp=$2
@@ -330,6 +334,7 @@
cat $tmp/fs/boot/System.map | gzip -9 > $tmp/iso/data/sysmap.gz
cat $tmp/fs/boot/config | gzip -9 > $tmp/iso/data/linconf.gz
cat $tmp/fs/boot/config-busybox | gzip -9 > $tmp/iso/data/bbconf.gz
+ cp $tmp/fs/boot/bundle $tmp/iso/data/bundle.sh
cat $tmp/post_install.log | gzip -9 > $tmp/iso/data/log.gz
cp $tmp/config_files $tmp/iso/data/files.cnf
cp $tmp/fs/etc/packages.conf $tmp/iso/data/packages.cnf
@@ -352,14 +357,18 @@
[ -x /usr/bin/isohybrid ] &&
/usr/bin/isohybrid $tmp/slitaz.iso 2> /dev/null
fi
+if [ "x$1" == "x--mkexe" ]; then
+ tmp=$2
+ cd $tmp
+ cp fs/boot/bzImage slitaz.exe
+ sh fs/boot/bundle slitaz.exe rootfs.gz exe
+fi
if [ "x$1" == "x--mkimg" ]; then
tmp=$2
- exe=$PWD
cd $tmp
- $exe/bootloader fs/boot/bzImage --initrd rootfs.gz --format 0
- mv floppy. slitaz.img
-# $exe/bootloader fs/boot/bzImage --initrd rootfs.gz
-# cat floppy.* > slitaz.img && rm -f floppy.*
+ cp fs/boot/bzImage slitaz.img
+ sh fs/boot/bundle slitaz.img rootfs.gz floppy
+ dd of=slitaz.img bs=18k seek=80 count=0 conv=notrunc 2> /dev/null
fi
if [ "x$1" == "x--mkcfg" ]; then
tmp=$2
@@ -367,3 +376,11 @@
for i in $(sed 's#^/##' < ../config_files); do find $i; done | \
sort | uniq | cpio -o -H newc | gzip -9 > ../config_files.cpio.gz
fi
+if [ "x$1" == "x--chkdist" ]; then
+ if [ pkgs/busybox-*/fs.cpio.lzma -nt dist/rootfs.cpio ]; then
+ cat pkgs/busybox-*/fs.cpio.lzma | unlzma | ( cd dist ; cpio -idmu )
+ mv -f dist/fs/* dist/
+ rmdir dist/fs
+ touch dist/*
+ fi
+fi
diff -r 1d33b2a53785 -r 577e6e91216d index.php
--- a/index.php Mon Sep 03 10:21:46 2012 +0200
+++ b/index.php Wed Oct 07 23:37:02 2015 +0200
@@ -46,7 +46,7 @@
-
Error :
$error
@@ -71,7 +71,7 @@
Useful software, expansible, easy to configure, runs fully in RAM,
simple, light and fast for minimum hardware resources: ie fits on
one floppy disk (IDE disk optional), runs on a 386sx processor and
- needs as little memory as possible (currently 8 MB with a 2.6.34
+ needs as little memory as possible (currently 4 MB with a 2.6.14
kernel).
Example
@@ -98,11 +98,9 @@
The initramfs is based on
uClibc and
busybox with its
config
- files and the packages
-
- slitaz-base-files and
-
- slitaz-boot-scripts .
+ files and this
+
+ filesystem tree .
@@ -127,6 +125,27 @@
Wikipedia
Flattr
+
+
+
+