List of commits:
Subject Hash Author Date (UTC)
upstream sync and a bit of cleanup d52bf4a8379da8127c6f232241d84a940e1bd8e0 Sylvain BERTRAND 2017-08-04 14:23:05
put libs in gnu dynloader trusted dir c7c7a38f7e8d7ab21d44e53d2ed5147c813bb482 Sylvain BERTRAND 2015-03-17 16:28:39
rdy for 4.0.0 and switch to /bin/init 8a15ec33b2de4d3f53fd3f523e288e564f21c2fa Sylvain BERTRAND 2015-03-03 18:35:03
fix typo 50b6f4c7f64bc4fb1866a663d840b32345812cc1 Sylvain BERTRAND 2015-01-07 00:43:43
some echoes should be printfs f56a73c77e738a84358aed699404683f870d5f9a Sylvain BERTRAND 2014-12-22 19:21:52
many script fixes 184aade382453dfa4874b5d3705269f45be024dd Sylvain BERTRAND 2014-12-16 19:07:04
some minor cleanup b47f5ef4f6dff33c88943b9a175ae90fc9a02332 Sylvain BERTRAND 2014-12-08 16:47:05
some cleanup 2cf8ba8e82181b954891d688c5bf3ed51dede5ff Sylvain BERTRAND 2014-12-02 02:22:24
Massive refactoring. Support live/mobile linux OSes. dd09f40ecd7ec40b6745bafbbba0743ecafe4bdf Sylvain BERTRAND 2014-12-02 02:04:37
use kernel version for initramfs 2762a46a6eb9d9f3a63a8b69f5e826b89d1a46e9 Sylvain BERTRAND 2014-08-19 16:42:19
enforce kernel version setting, binfmt_script f0aaf75a34bd2b4fdb84bea6bd572ff5b715fd2b Sylvain BERTRAND 2013-09-11 00:41:45
Create LICENSE.md 73147c4952cdeee9ad96fe447c543ffbf6ab494a Sylvain BERTRAND 2013-07-17 19:00:49
scsi_wait_scan is gone from upstream d7bc928da1caea553b1279d131596344df93273f Sylvain BERTRAND 2012-12-19 16:24:37
wrong init place abf8267b4a36f1385facf5a4752746c121914674 root 2012-07-05 00:35:09
adapt sample script for devtmpfs 983e8e944dae73846c5e0ea5ab26726851073dec root 2012-03-28 14:47:01
must up the ethernet interface 79bd84790e904ce471101762a35dbd280bb2673f root 2012-02-02 18:30:24
init have more children than gettys 57f4231ffd8e97b7511226bfc4f058e0814a4e8e Sylvain BERTRAND 2012-01-31 13:10:32
clean sigprogmask for children 89a379820196e9a4de7d6bf38ec49a679f9de917 Sylvain BERTRAND 2012-01-31 12:52:11
ready to be used 51f3d5adedf51ab5b47a61724035141bcbb71354 Sylvain BERTRAND 2012-01-30 15:27:56
ready, now need to know why init libc is crashing 39e165e544af1632e0d1926a686173e8b7543bdd Sylvain BERTRAND 2011-12-30 02:35:57
Commit d52bf4a8379da8127c6f232241d84a940e1bd8e0 - upstream sync and a bit of cleanup
Author: Sylvain BERTRAND
Author date (UTC): 2017-08-04 14:23
Committer name: Sylvain BERTRAND
Committer date (UTC): 2017-08-04 14:23
Parent(s): c7c7a38f7e8d7ab21d44e53d2ed5147c813bb482
Signing key:
Tree: f46ba9e6b35c54700b6ca5c696b8a31f53fa52fa
File Lines added Lines deleted
4.12 1 1
DEPENDENCIES 7 7
make 98 181
uevent.c 1 1
ulinux/utils/mem.c 2 33
ulinux_namespace.h 2 2
File 4.12 copied from file 3.16 (similarity 94%) (mode: 100644) (index cc78d77..ad01488)
1 1 #Those are the modules needed to find our root filesystem can be. For a live #Those are the modules needed to find our root filesystem can be. For a live
2 2 #system, this should be most hardware block drivers without forgetting usb #system, this should be most hardware block drivers without forgetting usb
3 3 #mass storage (may need usb attached scsi) #mass storage (may need usb attached scsi)
4 HW_MODULES=sata_nv,ahci
4 HW_MODULES=ahci
5 5 #those modules are "disk" drivers which uses their respective "bus" drivers #those modules are "disk" drivers which uses their respective "bus" drivers
6 6 #(sd_mod->scsi, usb-storaye->usb...) #(sd_mod->scsi, usb-storaye->usb...)
7 7 DISK_MODULES=sd_mod,usb-storage DISK_MODULES=sd_mod,usb-storage
File DEPENDENCIES changed (mode: 100644) (index 3b1926a..6f60488)
1 1 - pkgconfig - pkgconfig
2 2 - libkmod development files: - libkmod development files:
3 * pkgconfig file
3 * pkgconfig file (libkmod)
4 4 * headers * headers
5 * ELF lib with machine code compatible with your target architectures
6 * ELF libkmod indirect build dependencies (usually liblzma libz libc...)
7 - util-linux development files:
5 * ELF static lib archive with machine code compatible with your target architectures
6 * ELF libkmod indirect build dependencies
7 - libblkid development files:
8 8 * pkgconfig file (blkid): * pkgconfig file (blkid):
9 * headers (blkid)
10 * ELF libs with machine code compatible with your target architectures
11 * ELF libs indirect dependencies
9 * headers
10 * ELF static lib archive with machine code compatible with your target architectures
11 * ELF libbklid indirect build dependencies
12 12 - linux development files: - linux development files:
13 13 * the cpio generator compiled for the host * the cpio generator compiled for the host
14 14 - the xz compression binary - the xz compression binary
File make changed (mode: 100755) (index cb4b569..d07a5ff)
1 1 #!/bin/sh #!/bin/sh
2 2
3 #this script is brutal and verbose, has no tricks and is quite linear, then
4 #quite easy to deal with
5 #for the moment, it's hardcoded for a gcc toolchain... BAD! Since now
6 #gcc is a c++ piece of shit
3 # this script is brutal and verbose, has no tricks and is quite linear, then
4 # quite easy to deal with
5 # for the moment, it's hardcoded for a gcc toolchain... BAD! Since now
6 # gcc is a c++ piece of shit
7 7
8 #stolen from ffmpeg configure like a pig
8 # stolen from ffmpeg configure like a pig
9 9 set -e set -e
10 10
11 #prevent locale nonsense from breaking basic text processing.
11 # prevent locale nonsense from breaking basic text processing
12 12 LC_ALL=C LC_ALL=C
13 13 export LC_ALL export LC_ALL
14 14
 
... ... ramfs.c
29 29 $init_ulinux_src_files $init_ulinux_src_files
30 30 " "
31 31
32 clean_do()
33 {
34 rm -f static_modules.h
35 rm -f *.cpio.xz
36 rm -f *.cpio
37 rm -f cpio
38 rm -f $init_file_name
39 for init_src_file in $init_src_files
40 do
41 init_pp_file=${init_src_file%.c}
42 init_pp_file=${init_pp_file}.pp.c
43 rm -f ${init_pp_file}
44 init_o_file=${init_src_file%.c}
45 init_o_file=${init_o_file}.o
46 rm -f ${init_o_file}
47 #clean directories, but keep root of build tree
48 tgt_dir=$(dirname $init_src_file)
49 if test -d $tgt_dir -a "$tgt_dir" != "."; then
50 rmdir --ignore-fail-on-non-empty -p $tgt_dir
51 fi
52 done
53 exit 0
54 }
55
56 32 sep_start() sep_start()
57 33 { {
58 printf '###############################################################################\n'
34 printf '###############################################################################\n'
59 35 } }
60 36
61 37 sep_end() sep_end()
62 38 { {
63 printf '###############################################################################\n\n'
39 printf '###############################################################################\n\n'
64 40 } }
65 41
66 42 subsep_start() subsep_start()
67 43 { {
68 printf '*******************************************************************************\n'
44 printf '*******************************************************************************\n'
69 45 } }
70 46
71 47 subsep_end() subsep_end()
72 48 { {
73 printf '*******************************************************************************\n'
49 printf '*******************************************************************************\n'
74 50 } }
51
75 52 ################################################################################ ################################################################################
76 53
77 is_in(){
78 value=$1
79 shift
80 for var in $*; do
81 [ $var = $value ] && return 0
82 done
83 return 1
54 is_in()
55 {
56 value=$1
57 shift
58 for var in $*; do
59 [ $var = $value ] && return 0
60 done
61 return 1
84 62 } }
85 63
86 64 die_unknown(){ die_unknown(){
87 echo "Unknown option \"$1\"."
88 echo "See $0 --help for available options."
89 exit 1
65 echo "Unknown option \"$1\"."
66 echo "See $0 --help for available options."
67 exit 1
90 68 } }
91 69
92 70 set_default(){ set_default(){
93 for opt; do
94 eval : \${$opt:=\$${opt}_default}
95 done
71 for opt; do
72 eval : \${$opt:=\$${opt}_default}
73 done
96 74 } }
97 75
98 76 CMDLINE_SET=' CMDLINE_SET='
99 linux_src_dir
100 kernel_modules_base_dir
101 init_cpp
102 init_cc
103 init_ld
104 init_ulinux_arch
105 uevents_timeout
106 gen_init_cpio
107 kernel_release
108 extra_modules
109 pkg_config
110 readelf
111 elf_interpreter
77 linux_build_dir
78 kernel_modules_base_dir
79 init_cpp
80 init_cc
81 init_ccld
82 init_ulinux_arch
83 uevents_timeout
84 gen_init_cpio
85 kernel_release
86 extra_modules
87 pkg_config
88 elf_interpreter
112 89 ' '
113 #command line set defaults
114 #if the root is not around in less than 4s, something is really wrong
90 # command line set defaults
91 # if the root is not around in less than 4s, something is really wrong
115 92 uevents_timeout_default=4000 uevents_timeout_default=4000
116 gen_init_cpio_default='$linux_src_dir/usr/gen_init_cpio'
117 linux_src_dir_default=/usr/src/linux
93 gen_init_cpio_default='$linux_build_dir/usr/gen_init_cpio'
94 linux_build_dir_default=/usr/src/linux
118 95 #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
119 #This defaults are for gcc, tested with version 4.7.3. You will need to
120 #override those for you compiler (tinycc/open64/pcc...). Additionnally, source
121 #support for different toolchains is not done.
122 #Since we use standard C runtime libs, be nice with the C runtime.
123 #The right way to do it is to have a toolchain abstraction layer since there are
124 #no standards for some
96 # this defaults are for gcc, tested with version 4.7.3. You will need to
97 # override those for you compiler (tinycc/open64/pcc...). additionnally, source
98 # support for different toolchains is not done
99 # since we use standard C runtime libs, be nice with the C runtime
125 100 init_cpp_default='gcc -E -Wall -Wextra' init_cpp_default='gcc -E -Wall -Wextra'
126 init_cc_default="gcc -Wall -Wextra -std=gnu99 -O0 \
127 -Wl,--dynamic-linker=/lib/ld.so -c"
128 init_ld_default='gcc -Wl,-O10,-s'
101 init_cc_default='gcc -Wall -Wextra -Wno-implicit-fallthrough -std=gnu99 -O2 -c'
102 init_ccld_default='gcc -Wl,-s -static'
129 103 #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
130 104 kernel_modules_base_dir_default=/ kernel_modules_base_dir_default=/
131 105 kernel_release_default=$(uname -r) kernel_release_default=$(uname -r)
132 106 init_ulinux_arch_default=$(uname -m | sed -e s/i.86/i386/ -e s/parisc64/parisc/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/sh.*/sh/) init_ulinux_arch_default=$(uname -m | sed -e s/i.86/i386/ -e s/parisc64/parisc/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/sh.*/sh/)
133 107 extra_modules_default= extra_modules_default=
134 108 pkg_config_default=pkg-config pkg_config_default=pkg-config
135 readelf_default=readelf
136 109 elf_interpreter_default= elf_interpreter_default=
137 110
138 111 set_default $CMDLINE_SET set_default $CMDLINE_SET
139 112
140 show_help(){
141 cat <<EOF
113 show_help()
114 {
115 cat <<EOF
142 116 Usage: make [options] [operations] Usage: make [options] [operations]
143 117
144 Operations: [default is to build the the initramfs xz compressed cpio archive]:
145 clean clean build products
118 default is to build the the initramfs xz compressed cpio archive:
146 119
147 120 Options: [defaults in brackets after descriptions] Options: [defaults in brackets after descriptions]
148 121
 
... ... Standard options:
153 126 --lib-path-list=LIB_PATH_LIST colon separated paths to look for target libraries --lib-path-list=LIB_PATH_LIST colon separated paths to look for target libraries
154 127 --uevents-timeout=UEVENTS_TIMEOUT uevents timeout in ms looking up for root block device to go online [$uevents_timeout] --uevents-timeout=UEVENTS_TIMEOUT uevents timeout in ms looking up for root block device to go online [$uevents_timeout]
155 128 --quiet init will be silenced (output code compiled out) --quiet init will be silenced (output code compiled out)
156 --linux-src-dir=DIR where to find the target linux source tree [$linux_src_dir_default]
129 --linux-build-dir=DIR where to find the target linux build tree [$linux_build_dir_default]
157 130 --kernel-release=RELEASE the linux releases version [$kernel_release] --kernel-release=RELEASE the linux releases version [$kernel_release]
158 131 --kernel-modules-base-dir=DIR the base dir for linux modules and support files [$kernel_modules_base_dir] --kernel-modules-base-dir=DIR the base dir for linux modules and support files [$kernel_modules_base_dir]
159 132 --extra-modules=EXTRA_MODULES coma separated list of extra module to probe --extra-modules=EXTRA_MODULES coma separated list of extra module to probe
 
... ... Standard options:
161 134 Advanced options: Advanced options:
162 135 --gen-init-cpio=GEN_INIT_CPIO_PATH use this linux host tool to build the linux cpio initramfs [$gen_init_cpio_default] --gen-init-cpio=GEN_INIT_CPIO_PATH use this linux host tool to build the linux cpio initramfs [$gen_init_cpio_default]
163 136 --pkg-config=PKG_CONFIG use PKG_CONFIG pkg-config command for target libraries [$pkg_config_default] --pkg-config=PKG_CONFIG use PKG_CONFIG pkg-config command for target libraries [$pkg_config_default]
164 --readelf=READELF use READELF readelf command for target readelf [$readelf_default]
165 --elf-interpreter=ELF_INTERPRETER copy target ELF_INTERPRETER in cpio archive [will use the interpreter from the generated init elf binary]
166 137 --init-cpp=CPP use CPP compiler command line CPP for target init process [$init_cpp_default] --init-cpp=CPP use CPP compiler command line CPP for target init process [$init_cpp_default]
167 138 --init-cc=CC use C compiler command line CC for target init process objects [$init_cc_default] --init-cc=CC use C compiler command line CC for target init process objects [$init_cc_default]
168 --init-ld=LD use linker command line LD for target init process [$init_ld_default]
139 --init-ccld=CCLD use compiler driver linker command line CCLD for target init process [$init_ccld_default]
169 140 --init-ulinux-arch=ARCH use ulinux ARCH for target init process [$init_ulinux_arch] --init-ulinux-arch=ARCH use ulinux ARCH for target init process [$init_ulinux_arch]
170 141 EOF EOF
171 exit 0
142 exit 0
172 143 } }
173 144
174 145 ################################################################################ ################################################################################
175 146
176 147 for opt do for opt do
177 optval="${opt#*=}"
178 case "$opt" in
179 clean) clean_do
180 ;;
181 --help|-h) show_help
182 ;;
183 --quiet) CPPFLAGS="$CPPFLAGS -DQUIET"
184 ;;
185 *)
186 optname=${opt%%=*}
187 optname=${optname#--}
188 optname=$(echo "$optname" | sed 's/-/_/g')
189 if is_in $optname $CMDLINE_SET; then
190 eval $optname='$optval'
191 else
192 die_unknown $opt
193 fi
194 ;;
195 esac
148 optval="${opt#*=}"
149 case "$opt" in
150 --help|-h) show_help
151 ;;
152 --quiet) CPPFLAGS="$CPPFLAGS -DQUIET"
153 ;;
154 *)
155 optname=${opt%%=*}
156 optname=${optname#--}
157 optname=$(echo "$optname" | sed 's/-/_/g')
158 if is_in $optname $CMDLINE_SET; then
159 eval $optname='$optval'
160 else
161 die_unknown $opt
162 fi
163 ;;
164 esac
196 165 done done
197 166
198 167 ################################################################################ ################################################################################
199 168
200 169 sep_start;echo 'looking for source path:' sep_start;echo 'looking for source path:'
201 170 if test -f make; then if test -f make; then
202 src_path=.
171 src_path=.
203 172 else else
204 src_path=$(cd $(dirname "$0"); pwd)
205 echo "$src_path" | grep -q '[[:blank:]]' &&
206 die "out of tree builds are impossible with whitespace in source path."
207 test -e "$src_path/config.h" &&
208 die "out of tree builds are impossible with config.h in source dir."
173 src_path=$(cd $(dirname "$0"); pwd)
174 echo "$src_path" | grep -q '[[:blank:]]' &&
175 die "out of tree builds are impossible with whitespace in source path."
209 176 fi fi
210 177 echo "source path is $src_path";sep_end echo "source path is $src_path";sep_end
211 178
 
... ... echo "source path is $src_path";sep_end
213 180
214 181 sep_start;echo 'checking libkmod and libblkid pkgconfig support:' sep_start;echo 'checking libkmod and libblkid pkgconfig support:'
215 182 if $pkg_config --exists libkmod blkid; then if $pkg_config --exists libkmod blkid; then
216 echo "found pkg-config files for libkmod and libblkid"
183 echo "found pkg-config files for libkmod and libblkid"
217 184 else else
218 echo "missing pkg-config file for libkmod or libblkid"
219 exit 1
185 echo "missing pkg-config file for libkmod or libblkid"
186 exit 1
220 187 fi fi
221 188 sep_end sep_end
222 189
223 190 ################################################################################ ################################################################################
224 191
225 #define variable in source
192 # define variable in source
226 193 CPPFLAGS="$CPPFLAGS -DUEVENTS_TIMEOUT=$uevents_timeout" CPPFLAGS="$CPPFLAGS -DUEVENTS_TIMEOUT=$uevents_timeout"
227 194 CPPFLAGS="$CPPFLAGS $($pkg_config --cflags-only-I libkmod blkid)" CPPFLAGS="$CPPFLAGS $($pkg_config --cflags-only-I libkmod blkid)"
228 195 CFLAGS="$CFLAGS $($pkg_config --cflags-only-other libkmod blkid)" CFLAGS="$CFLAGS $($pkg_config --cflags-only-other libkmod blkid)"
229 LDFLAGS="$LDFLAGS $($pkg_config --libs libkmod blkid)"
196 LIBS="$($pkg_config --libs --static libkmod blkid) $LIBS"
230 197
231 198 ################################################################################ ################################################################################
232 199
 
... ... sep_end
238 205
239 206 ################################################################################ ################################################################################
240 207
241 #generated some code/headers
208 # generated some code/headers
242 209
243 210 sep_start sep_start
244 211 revision=$(echo "$kernel_release" | egrep -o '^[[:digit:]]+\.[[:digit:]]+') revision=$(echo "$kernel_release" | egrep -o '^[[:digit:]]+\.[[:digit:]]+')
 
... ... cat $src_path/$revision
248 215 echo '--------' echo '--------'
249 216 sep_end sep_end
250 217
218 # those modules are all loaded before anything else
251 219 sep_start;echo 'generate static module list:' sep_start;echo 'generate static module list:'
252 220 $src_path/script/static_modules_h.sh $extra_modules $DISK_MODULES \ $src_path/script/static_modules_h.sh $extra_modules $DISK_MODULES \
253 221 >./static_modules.h >./static_modules.h
 
... ... sep_end
259 227 sep_start;echo 'C preprocess init src files:' sep_start;echo 'C preprocess init src files:'
260 228 for init_src_file in $init_src_files for init_src_file in $init_src_files
261 229 do do
262 init_pp_c_file=${init_src_file%.c}
263 init_pp_c_file=${init_pp_c_file}.pp.c
264 echo "INIT_CPP $init_src_file->$init_pp_c_file"
265 mkdir -p $(dirname $init_pp_c_file)
266 $init_cpp $CPPFLAGS -I. -I$src_path -o $init_pp_c_file \
267 $src_path/$init_src_file
268 init_pp_c_files="$init_pp_c_file $init_pp_c_files"
230 init_pp_c_file=${init_src_file%.c}.pp.c
231 echo "INIT_CPP $init_src_file->$init_pp_c_file"
232 mkdir -p $(dirname $init_pp_c_file)
233 $init_cpp -o $init_pp_c_file \
234 $CPPFLAGS \
235 -I. \
236 -I$src_path \
237 $src_path/$init_src_file
238 init_pp_c_files="$init_pp_c_file $init_pp_c_files"
269 239 done done
270 240 sep_end sep_end
271 241
 
... ... sep_end
274 244 sep_start;echo 'compile init preprocessed src files:' sep_start;echo 'compile init preprocessed src files:'
275 245 for init_pp_c_file in $init_pp_c_files for init_pp_c_file in $init_pp_c_files
276 246 do do
277 init_obj_file=${init_pp_c_file%.pp.c}
278 init_obj_file=${init_obj_file}.o
279 echo "INIT_CC $init_pp_c_file-->$init_obj_file"
280 $init_cc $CFLAGS -o $init_obj_file $init_pp_c_file
281 init_obj_files="$init_obj_file $init_obj_files"
247 init_obj_file=${init_pp_c_file%.pp.c}.o
248 echo "INIT_CC $init_pp_c_file-->$init_obj_file"
249 $init_cc $CFLAGS -o $init_obj_file $init_pp_c_file
250 init_obj_files="$init_obj_file $init_obj_files"
282 251 done done
283 252 sep_end sep_end
284 253
285 254 ################################################################################ ################################################################################
286 255
287 256 sep_start;echo 'link the init objects to produce the init binary:' sep_start;echo 'link the init objects to produce the init binary:'
288 echo "INIT_LD $init_file_name"
289 $init_ld -o $init_file_name $init_obj_files $LDFLAGS
290 sep_end
291
292 ################################################################################
293
294 #build the library path used by the gcc toolchain. We will need it to lookup
295 #for the dynamic shared libraries and copy them into the cpio
296 sep_start;echo "computing gcc library path:"
297 #in gcc search paths, the sysroot uses '='
298 lib_path_nosysroot=$($init_ld $LDFLAGS -print-search-dirs | egrep '^libraries' \
299 | sed -r 's/libraries:[[:space:]]+(.+)/\1/')
300 echo "gcc library path is $lib_path_nosysroot"
301 gcc_sysroot=$($init_ld -print-sysroot)
302 echo "gcc_sysroot (can be empty) is $gcc_sysroot"
303
304 IFS=:
305 #replace the sysroot marker, '=', in gcc library path
306 if test -n "$gcc_sysroot"; then
307 for p in $lib_path_nosysroot; do
308 lib_path_noncanonical="$lib_path_noncanonical:$(echo "$p" | sed -r "s:^=:$gcc_sysroot:")"
309 done
310 else
311 for p in $lib_path_nosysroot; do
312 lib_path_noncanonical="$lib_path_noncanonical:$(echo "$p" | sed -r 's/^=//')"
313 done
314 fi
315
316 lib_path_noncanonical=${lib_path_noncanonical#:}
317
318 for p in $lib_path_noncanonical; do
319 if readlink -m -q "$p" >/dev/null 2>&1; then
320 lib_path="$lib_path:$(readlink -m "$p")"
321 fi
322 done
323
324 lib_path=${lib_path#:}
325 echo "final LIB_PATH=$lib_path"
326 sep_end
327
328 ################################################################################
329
330 #locate the target elf interpreter which will be copied in the cpio archive
331 sep_start
332 if test -z "$elf_interpreter"; then
333 elf_interpreter=$($readelf -l ./init | egrep 'Requesting program interpreter' | sed -r 's/^.+interpreter:[[:space:]]*(.+)\]/\1/')
334 fi
335 echo "will copy $elf_interpreter elf interpreter in cpio archive"
257 echo "INIT_CCLD $init_file_name"
258 $init_ccld -o $init_file_name $init_obj_files $LIBS
336 259 sep_end sep_end
337 260
338 261 ################################################################################ ################################################################################
 
... ... echo "dir /lib/modules/$kernel_release 0755 0 0">>cpio
343 266
344 267 modules=$HW_MODULES,$DISK_MODULES,$FS_MODULES modules=$HW_MODULES,$DISK_MODULES,$FS_MODULES
345 268 if test -n "$extra_modules";then if test -n "$extra_modules";then
346 modules=$modules,$extra_modules
269 modules=$modules,$extra_modules
347 270 fi fi
348 271
349 272 subsep_start subsep_start
 
... ... $src_path/script/cpio_modules_add.sh $kernel_modules_base_dir $kernel_release \
352 275 $modules ./cpio $modules ./cpio
353 276 subsep_end subsep_end
354 277
355 subsep_start
356 #add proper entries in the cpio definition file related to shared elf libs
357 $src_path/script/cpio_libs_add.sh "$readelf" "$lib_path" ./init \
358 "$elf_interpreter" ./cpio
359 subsep_end
360
361 278 printf "cpio source file is:\n--------\n" printf "cpio source file is:\n--------\n"
362 279 cat cpio cat cpio
363 280 echo '--------' echo '--------'
File uevent.c changed (mode: 100644) (index e6e7af8..3ab8311)
2 2 this code is protected by the GNU affero GPLv3 this code is protected by the GNU affero GPLv3
3 3 author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com> author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com>
4 4 *******************************************************************************/ *******************************************************************************/
5 #include <blkid.h>
5 #include <blkid/blkid.h>
6 6
7 7 #include <ulinux/compiler_types.h> #include <ulinux/compiler_types.h>
8 8 #include <ulinux/types.h> #include <ulinux/types.h>
File ulinux/utils/mem.c changed (mode: 100644) (index 62463e1..6c07545)
... ... author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com>
6 6 #include <ulinux/types.h> #include <ulinux/types.h>
7 7 #include <stddef.h> #include <stddef.h>
8 8
9 /*
10 XXX:need a way to get the target CPUID flags in order to select the proper
11 code path at compilation time and not runtime
12 */
13 9 void ulinux_memcpy(ulinux_u8 *d,ulinux_u8 *s,ulinux_u64 len) void ulinux_memcpy(ulinux_u8 *d,ulinux_u8 *s,ulinux_u64 len)
14 10 { {
15 __builtin_memcpy(d,s,(size_t)len);/*use gcc builtin for this arch*/
16 }
17
18 /*
19 a memcpy implementation is needed anyway if gcc decides not to use its builtin
20 */
21 void *memcpy(void *to,const void *from,size_t len)
22 {
23 ulinux_u8 *d=to;
24 ulinux_u8 *s=(ulinux_u8*)from;
25 11 while(len--) *d++=*s++; while(len--) *d++=*s++;
26 return to;
27 12 } }
28 13
29 14 void ulinux_memset(ulinux_u8 *d,ulinux_u8 c,ulinux_u64 len) void ulinux_memset(ulinux_u8 *d,ulinux_u8 c,ulinux_u64 len)
30 15 { {
31 __builtin_memset(d,c,(size_t)len);/*use gcc builtin for this arch*/
32 }
33
34 /*
35 a memset implementation is needed anyway if gcc decides not to use its builtin
36 */
37 void *memset(void *to,int c,size_t len)
38 {
39 ulinux_u8 *d=to;
40 16 while(len--) *d++=c; while(len--) *d++=c;
41 return to;
42 }
43
44 ulinux_s8 ulinux_memcmp(ulinux_u8 *d,ulinux_u8 *c,ulinux_u64 len)
45 {
46 return __builtin_memcmp(d,c,(size_t)len);/*use gcc builtin for this arch*/
47 17 } }
48 18
49 19 /* /*
50 a memset implementation is needed anyway if gcc decides not to use its builtin
51 20 stolen from linux stolen from linux
52 21 */ */
53 int memcmp(const void *cs,const void *ct,size_t count)
22 ulinux_s8 ulinux_memcmp(ulinux_u8 *d,ulinux_u8 *c,ulinux_u64 len)
54 23 { {
55 24 const ulinux_u8 *su1,*su2; const ulinux_u8 *su1,*su2;
56 25 ulinux_i res=0; ulinux_i res=0;
57 26
58 for(su1=cs,su2=ct;0<count;++su1,++su2,count--) if((res=*su1-*su2)!=0) break;
27 for(su1=d,su2=c;0<len;++su1,++su2,len--) if((res=*su1-*su2)!=0) break;
59 28 return res; return res;
60 29 } }
File ulinux_namespace.h changed (mode: 100644) (index feb12fd..5055bad)
18 18 #define PROT_READ ULINUX_PROT_READ #define PROT_READ ULINUX_PROT_READ
19 19 #define close(a) ulinux_sysc(close,1,a) #define close(a) ulinux_sysc(close,1,a)
20 20 #define EINTR ULINUX_EINTR #define EINTR ULINUX_EINTR
21 /*avoid namespace conflict with libmod header dependencies*/
22 #ifndef _LIBKMOD_H_
21 /* avoid namespace conflict with libmod header dependencies */
22 #ifndef LIBKMOD_H
23 23 #define S_IFBLK ULINUX_S_IFBLK #define S_IFBLK ULINUX_S_IFBLK
24 24 #define S_IRUSR ULINUX_S_IRUSR #define S_IRUSR ULINUX_S_IRUSR
25 25 #define S_IWUSR ULINUX_S_IWUSR #define S_IWUSR ULINUX_S_IWUSR
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/cinitramfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/cinitramfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/cinitramfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main