wok-6.x rev 13194
linux-source: add rdev
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Aug 05 00:27:09 2012 +0200 (2012-08-05) |
parents | 91ed8fa372e3 |
children | f5438bbbdb73 |
files | linux-source/receipt linux-source/stuff/rdev |
line diff
1.1 --- a/linux-source/receipt Sat Aug 04 22:10:01 2012 +0200 1.2 +++ b/linux-source/receipt Sun Aug 05 00:27:09 2012 +0200 1.3 @@ -17,11 +17,15 @@ 1.4 local AUFSDIR="aufs-${_AUFSVER}" 1.5 mkdir -p $fs/usr/src/kernel-patches \ 1.6 $fs/lib/modules/$BASEVER-slitaz \ 1.7 - $fs/usr/bin 1.8 + $fs/usr/bin $fs/usr/sbin 1.9 cp -a $WOK/$WANTED/source/slitaz $fs/usr/src/kernel-patches 1.10 cp -a $stuff/buildtaz $fs/usr/src/kernel-patches/slitaz 1.11 cp -a $stuff/make-tazpkg.u $fs/usr/src/kernel-patches/slitaz 1.12 cp -a $stuff/get-linux-source $fs/usr/bin 1.13 + cp -a $stuff/rdev $fs/usr/sbin 1.14 + ln -s rdev $fs/usr/sbin/rootflags 1.15 + ln -s rdev $fs/usr/sbin/ramsize 1.16 + ln -s rdev $fs/usr/sbin/vidmode 1.17 sed -i "s|=XXX|=$VERSION|g" $fs/usr/bin/get-linux-source 1.18 # Copy Aufs2 source files 1.19 if [ -d $WOK/$WANTED/$AUFSDIR ]; then
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/linux-source/stuff/rdev Sun Aug 05 00:27:09 2012 +0200 2.3 @@ -0,0 +1,43 @@ 2.4 +#!/bin/sh 2.5 + 2.6 +sw="" 2.7 +case "$(basename $0)" in 2.8 +rootflags) sw="-R" ;; 2.9 +ramsize) sw="-r" ;; 2.10 +vidmode) sw="-v" ;; 2.11 +esac 2.12 +[ -n "$sw" ] && set -- $sw "$@" 2.13 + 2.14 +offset=508 2.15 +image= 2.16 +value= 2.17 +format="Root device 0x%X" 2.18 +while [ -n "$1" ]; do 2.19 + case "$1" in 2.20 + -R) offset=498; format="Root flags %d";; 2.21 + -r) offset=504; format="Ramsize %d";; 2.22 + -v) offset=506; format="Video mode%d";; 2.23 + -o) offset=$(($2)); shift ;; 2.24 + *) if [ -z "$image" ]; then 2.25 + image="$1" 2.26 + elif [ -z "$value" ]; then 2.27 + value="$1" 2.28 + else 2.29 + offset=$(($1)) 2.30 + fi 2.31 + esac 2.32 + shift 2.33 +done 2.34 + 2.35 +if [ ! -s "$image" ]; then 2.36 + printf "0x%04X /\n" $(cat /proc/sys/kernel/real-root-dev) 2.37 +elif [ -n "$value" ]; then 2.38 + for i in 1 2; do 2.39 + printf '\\\\x%02X' $(($value & 255)) 2.40 + value=$(($value >> 8)) 2.41 + done | xargs echo -en | \ 2.42 + dd bs=1 conv=notrunc of=$image seek=$offset 2> /dev/null 2.43 +else 2.44 + dd bs=1 conv=notrunc if=$image skip=$offset count=2 2> /dev/null | \ 2.45 + hexdump -e '"" 1/2 "$format" "\n"' 2.46 +fi